New Table PRCD - ELEMENTS in S - 4 HANA

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

New table PRCD_ELEMENTS in S/4 HANA


05/13/2020

Dear SAPLearners, in this blog post we will learn about KONV SD pricing data model changes and
new table PRCD_ELEMENTS in S/4 HANA. 

This blog post is part of S/4 HANA technical tutorials, you can find all tutorials here.

Introduction
Firstly, we all know that SD pricing results are stored in the KONV table for sales business
documents such as sales order and we have been using this table in custom code SELECT queries
etc..

In S/4 HANA system, SAP has reviewed this table and new changes were implemented. When you
are moving to S/4 HANA system from ECC, these changes to be followed and custom code is
modified accordingly.

Lets see these changes in detail

x
1. New table PRCD_ELEMENTS

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 1/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

A new database table called PRCD_ELEMENTS is introduced to replace the KONV table to store all x
SD document conditions. It is of type Transparent table. 

The data is no longer stored in the KONV table. You need to use new table PRCD_ELEMENTS in
custom code to SELECT pricing conditions.

2. CDS view V_KONV


Further to the table and a new ABAP CDS view V_KONV is also available to get the price
x
conditions. CDS view V_KONV can be used in custom CDS views.

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 2/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

x

In addition to the CDS view, an API is also available to Get, Update and Delete the pricing
conditions.

3. New API 
The factory class CL_PRC_RESULT_FACTORY is used to retrieve the pricing data.

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 3/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

Following methods are provided within the API to read, write and delete the data. x

GET_PRICE_ELEMENT_DB Get price elements from DB
GET_PRICE_ELEMENT_DB_BY_KEY Get price elements from DB by semantic key
SAVE_PRICE_ELEMENT_DB Save price elements on DB
Delete price element from DB by semantic key (one
DELETE_PRICE_ELEMENT_DB_BY_KEY
document)
DELETE_PRICE_ELEMENT_DB Delete price elements from DB (multiple documents)
Delete list of dedicated price elements (multiple
DELETE_PRICE_ELEMENTS_DB
documents)

Now you know quite a bit about data model changes to KONV. Its time to see the how we can
migrate our custom code to S/4 HANA system compatible.

Here is the old code from ECC system to get SD pricing conditions.

SELECT knumv

kposn

stunr

zaehk

kappl

x
kschl

kdatu FROM konv

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 4/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

INTO TABLE lt_konv


x
WHERE knumv = vbak-knumv. 

Now lets look at the new code

Using PRCD_ELEMENTS table:

"new table PRCD_ELEMENTS

SELECT knumv

kposn

stunr

zaehk

kappl

kschl

kdatu FROM prcd_elements

INTO TABLE lt_konv

WHERE knumv = vbak-knumv.

x
With V_KONV CDS view:

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 5/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

" CDS view


x
SELECT knumv

kposn

stunr

zaehk

kappl

kschl

kdatu FROM v_konv

INTO TABLE lt_konv

WHERE knumv = vbak-knumv.

Using factory class CL_PRC_RESULT_FACTORY:

TRY.

cl_prc_result_factory=>get_instance( )->get_prc_result( )-
>get_price_element_db_by_key(

EXPORTING

iv_knumv = vbak-knumv

IMPORTING

et_prc_element_classic_format = hkonv ).

CATCH cx_prc_result. "implement suitable error handling

ENDTRY.

"or other alternative way

TRY.

cl_prc_result_factory=>get_instance( )->get_prc_result( )-
>get_price_element_db(

EXPORTING

it_selection_attribute = VALUE #( ( fieldname = 'KNUMV' value =


komk-knumv ) )

IMPORTING

x
et_prc_element_classic_format = hkonv ).

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 6/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

CATCH cx_prc_result. "implement suitable error handling


x
ENDTRY.

Like wise, now lets look at DDIC enhancements to KONV table.

4. DDIC enhancements
At some times we need to enhance KONV table with custom fields catering to the customer
requirements. This is usually achieved using append structure to the database table KONV

In S/4 HANA system, you should NOT append directly to PRCD_ELEMENTS table.

Instead add append structure to the new structure PRCS_ELEMENTS_DATA which is included in
database table PRCD_ELEMENTS.

Subsequently to PRCD_ELEM_DRAFT which is included in database table


PRCD_ELEM_DRAFT(used to temporarily store pricing results as a draft prior to save)
x
Similarly ABAP CDS view V_KONV can also be used to get pricing data, therefore it is necessary to
enhance the CDS view.

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 7/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

Click here to know how you can extend a CDS view with custom fields. x

Congrats!!! 👍 you have successfully KONV SD pricing data model changes in S/4 HANA.

Please feel free to comment and let us know your feedback. Subscribe for more updates

If you liked it, please share it! Thanks!

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 8/9
2022/4/28 下午5:49 New table PRCD_ELEMENTS in S/4 HANA

x

https://saplearners.com/new-table-prcd_elements-in-s-4-hana-konv-table-is-obsolete/ 9/9

You might also like