Hi
i am working with bap_billingdoc_createmultiple
when i am trying to create the billing,
if the customers are repeated it is adding the values of conditiontype it is adding all the records creating only one document for one customer
loop at it_bill1 INTO WA_BILL1.
wa_billingdata-salesorg = WA_bill1-sorg.
wa_billingdata-distr_chan = WA_BILL1-dist.
wa_billingdata-division = WA_BILL1-div.
wa_billingdata-doc_type = 'ZSO5'.
wa_billingdata-ordbilltyp = 'FX'.
wa_billingdata-bill_date = WA_BILL1-BDATE.
wa_billingdata-sold_to = WA_BILL1-CUSTNO.
wa_billingdata-price_date = WA_BILL1-BDATE.
wa_billingdata-country = WA_BILL1-CNTRY.
wa_billingdata-plant = WA_BILL1-PLANT.
wa_billingdata-material = WA_BILL1-MATDESC.
wa_billingdata-REQ_QTY = '2'.
wa_billingdata-currency = WA_BILL1-CURR.
wa_billingdata-wbs_elem = it_posid-posid.
append wa_billingdata to billingdata.
wa_CONDITIONDATA-cond_value = WA_BILL1-ADVERTISCOST.
wa_conditiondata-cond_type = 'EK01'.
endif.
conditiondata-cond_value = WA_BILL1-COMM.
conditiondata-cond_type = 'ZCOM'.
append wa_conditiondata to conditiondata.
*
endloop.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
EXPORTING
CREATORDATAIN = creaord
TESTRUN = 'X'
POSTING =
TABLES
BILLINGDATAIN = billingdata
CONDITIONDATAIN = conditiondata
CCARDDATAIN =
TEXTDATAIN =
ERRORS =
RETURN = bapiret
SUCCESS = succ
.
please help me how to work this
if u have please send the code
Regards,
Edited by: abap on Jul 16, 2008 8:51 AM