Hi all, i are creating a credit memo using BAPI_BILLINGDOC_CREATEMULTIPLE with manual price condition for each position and have a problem.
All the positions use the last condition value of the CONDITIONDATAIN table.
Thes is an example code used.
t_billing-salesorg = 'SI01'.
t_billing-DISTR_CHAN = '05'.
t_billing-DIVISION = '01'.
t_billing-DOC_TYPE = p_dtype. " ZC07 o TA
t_billing-ORDBILLTYP = 'ZC06'. " ZC06 o FX
t_billing-SOLD_TO = p_clie. "'0000200002'.
t_billing-ITEM_CATEG = 'ZG2N'. " ZG2N o TAN
t_billing-PLANT = '1100'.
t_billing-BILL_TO = p_clie. "'0000200002'.
t_billing-PAYER = p_clie. "'0000200002'.
t_billing-SHIP_TO = p_clie. "'0000200002'.
t_billing-MATERIAL = '0000000000300003'.
t_billing-REQ_QTY = p_cant. "'1.000'.
t_billing-item = '1'.
APPEND t_billing.
t_conditions-DATA_INDEX = '1'.
t_conditions-COND_TYPE = 'ZCON'.
t_conditions-COND_VALUE = '12.0000'.
append t_conditions.
t_billing-salesorg = 'SI01'.
t_billing-DISTR_CHAN = '05'.
t_billing-DIVISION = '01'.
t_billing-DOC_TYPE = p_dtype. " ZC07 o TA
t_billing-ORDBILLTYP = 'ZC06'. " ZC06 o FX
t_billing-SOLD_TO = p_clie. "'0000200002'.
t_billing-ITEM_CATEG = 'ZG2N'. " ZG2N o TAN
t_billing-PLANT = '1100'.
t_billing-BILL_TO = p_clie. "'0000200002'.
t_billing-PAYER = p_clie. "'0000200002'.
t_billing-SHIP_TO = p_clie. "'0000200002'.
t_billing-MATERIAL = '0000000000300004'.
t_billing-REQ_QTY = p_cant. "'1.000'.
t_billing-item = '2'.
APPEND t_billing.
t_conditions-DATA_INDEX = '2'.
t_conditions-COND_TYPE = 'ZCON'.
t_conditions-COND_VALUE = '24.0000'.
append t_conditions.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
EXPORTING
CREATORDATAIN = t_creator
TABLES
billingdatain = t_billing
CONDITIONDATAIN = t_conditions
return = t_return
success = t_success.
In these example, the first position have a value of 12 and the seccond a value of 24.
The generated document have a value of 24 for the two positions.
Do you helpme??
Regards
Adrián Callejón
Message was edited by:
Adrian Callejon