cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI for WCOCO tcode in S4HANA

former_member494960
Discoverer
0 Kudos
2,757

Hi everyone!

I've been looking for BAPI than I can use to upload multiple Rebate Contract which is created in Tcode WCOCO manually. I tried BAPI_CONDITION_CONTRACT_CREATE but I'm getting errors in Business Volume. Can you please send me your sample code on how to correctly populate the tables in BAPI? Thank you so much!

Regards,

Cams

View Entire Topic
0 Kudos

if you need to pass the extensionin in your bapi, you can fill the data like below

DATA: lw_bapi_te_komg TYPE bapi_te_komg,
lw_bapi_te_komgx TYPE bapi_te_komgx.
CLEAR: lw_bapi_te_komg,
lw_bapi_te_komgx.

lw_bapi_te_komg-order_key = lv_cnt.
lw_bapi_te_komg-zzaufnr = lw_main-internal_order.

gw_extensionin-structure = 'BAPI_TE_KOMG'.
gw_extensionin-valuepart1 = lw_bapi_te_komg.
APPEND gw_extensionin TO gt_extensionin.

lw_bapi_te_komgx-order_key = lv_cnt.
lw_bapi_te_komgx-zzaufnr = abap_true.

gw_extensionin-structure = 'BAPI_TE_KOMGX'.
gw_extensionin-valuepart1 = lw_bapi_te_komgx.
APPEND gw_extensionin TO gt_extensionin.

before this step, you need to append new structure to BAPI_TE_KOMG, BAPI_TE_KOMGX and also KOMG structure