‎2006 Aug 01 8:01 AM
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
‎2006 Aug 01 4:22 PM
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