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 To create a collective billing document

Former Member
0 Likes
660

Hi,

I have to know a BAPI for creating a billing document for a sold-to party having many sales documents.

for example.. I have to create a single billing document for the below condition....

sold-to party -


sales documents

5000 --- 40001

--- (creditmemo)

5000 --- 40002

(creditmemo)

Billing document

only one for both

Sold to party 5000 has two sales documents

whose order type is ZCMR (credit memo request) for which i have to create one billing document.

What are all the conditions to be met for creating such a billing document?

Let me know some pointers how to use the BAPI by passing parameters.

Thanks in advance,

A.Karthikeyan

1 REPLY 1
Read only

Former Member
0 Likes
423

Hi,

Please find the sample code for Billing document BAPI. Please award the points if it is working for you.

t_billing-salesorg = vbak-vkorg.

t_billing-DISTR_CHAN = vbak-vtweg.

t_billing-DIVISION = vbak-spart.

t_billing-DOC_TYPE = vbak-auart.

t_billing-ref_doc = vbak-vbeln.

t_billing-ref_item = vbap-posnr.

t_billing-doc_number = vbak-vbeln.

t_billing-ITM_NUMBER = vbap-posnr.

t_billing-ordbilltyp = 'BILLING TYPE'.

t_billing-price_date = sy-datum.

t_billing-ref_doc_ca = vbak-vbtyp.

t_billing-sold_to = vbak-kunnr.

t_billing-material = vbap-matnr.

t_billing-plant = vbap-werks.

APPEND t_billing.

CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'

TABLES

billingdatain = t_billing

return = t_return

success = t_success.

commit work.

Thanks,

Naren