Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI billing

Former Member
0 Likes
418

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
375

you have to refresh conditiondata and billingdata before each new billingrecord .

and where is the if of the endif within the loop ??

Edited by: A. de Smidt on Jul 16, 2008 9:08 AM

1 REPLY 1
Read only

Former Member
0 Likes
376

you have to refresh conditiondata and billingdata before each new billingrecord .

and where is the if of the endif within the loop ??

Edited by: A. de Smidt on Jul 16, 2008 9:08 AM