cancel
Showing results for 
Search instead for 
Did you mean: 

How to use create condition contract when the condition involves product hierarchy 2

VCII
Explorer
0 Kudos
217

Hello,

One of our condition contracts involve using product hierarchy 2 as a key field (Both for determination of business volume as well as pricing condition) . Since the volume is high, we wrote a program to upload the data using BAPI_CONDITION_CONTRACT_CREATE. We are able to create the condition contract and settle it manually. But the upload program using BAPI does not work, due to PRODH2 not being a key SAP field . I end up with an error to update the key field product hierarchy 2 (W_CB 064). We tried extending BAPI_TE_KOMG with PRODH2 . But the error continues. Any help from the experts is welcome. 

 

Accepted Solutions (0)

Answers (2)

Answers (2)

YordanG
Discoverer
0 Kudos

Hello,

What version of S/4HANA are you running?

Thanks

VCII
Explorer
0 Kudos
Not yet on S4 Hana. We are using ECC. I checked the note 2467118 . It could not be implemented.
YordanG
Discoverer
0 Kudos
You have two options really - 1) try to append BAPICCCONDITIONKEY and BAPICCCONDITIONKEYX with PROD_HIER1 PROD_HIER2 PROD_HIER3 and see if your version of the BAPI will take them, or 2) open an incident with SAP to ask if this is even possible. From what I see, the BAPI we use was changed by SAP back in 2023.
VCII
Explorer
0 Kudos
Thanks a lot for the suggestions. Option 1 is tried but did not work . So I will try the option 2.
YordanG
Discoverer
0 Kudos

Hello,

If you need to use BAPI_CONDITION_CONTRACT_CREATE to create condition contracts and populate rates in a condition table which has PRODH2 as a field, you need to populate conditionkeydatain-prod_hier2. You need the following populated:

  • conditionkeydatain
  • conditionkeydatainx
  • conditionitemdatain
  • conditionitemdatainx  

 

 

VCII
Explorer
0 Kudos
Hi, Conditionkeydatain does not have individual prodh1, prodh2 ,prodh3 fields but the full product hierarchy field. I have tried using product hierarchy full field expecting it to update product hierarchy 2. But that approach does not work. I have mentioned extending BAPI_TE_KOMG with product hierarchy 2. I get an error that PRODH2 is not a SAP supported key field. So both approaches did not work for me
YordanG
Discoverer
0 Kudos

Hello,

Structure BAPICCCONDITIONKEY has fields PROD_HIER1, PROD_HIER2 and PROD_HIER3. It also has the full hierarchy field PROD_HIER. Check the screenshot. We have successfully created a load program using BAPI_CONDITION_CONTRACT_CREATE and were able to upload condition tables which have various levels of the product hierarchy.

Screenshot.png

Thanks

VCII
Explorer
0 Kudos
Hmm. that is strange. I am not able to edit BAPICCCONDITIONKEY to add the PRODH2 field. I get an error "Structure BAPICCCONDITIONKEY cannot be enhanced (creating new fields is not possible)".
VCII
Explorer
0 Kudos

Also BAPICCCONDITIONKEY ends with REP_MATERIAL_LONG as the last component. PRODHIER1, 2,3 ... that are shown in your screen are not available to us.

BAPICCCONDITIONKEY.jpg