‎2011 Mar 03 5:57 AM
Hi experts,
I have a requirement to create billing request based on Sales order, I tried BAPI (BAPI_BILLINGDOC_CREATEMULTIPLE).
This bapi create document no for each sales order, But i want one billing request irespective of number of sales order, say some example i have 2 sales order with n number of item, which it has to be create single billing request number, So kindly guide me the same which BAPI i have to use.
‎2011 Mar 03 11:34 AM
Hi,
Check this,
CALL FUNCTION 'RV_INVOICE_CREATE'
EXPORTING
invoice_date = sy-datum
vbsk_i = vbsk_i
with_posting = 'B'
id_no_enqueue = 'X'
IMPORTING
vbsk_e = vbsk_i
TABLES
xkomfk = xkomfk
xkomv = xkomv
xthead = xthead
xvbfs = xvbfs
xvbpa = xvbpa
xvbrk = xvbrk
xvbrp = xvbrp
xvbss = xvbss.Here internal table xkomfk will contain ur orders and their line items.
Foe Ex :
vbsk_i-smart = 'F'.
vbsk_i-ernam = sy-uname.
vbsk_i-erdat = sy-datum.
vbsk_i-uzeit = sy-uzeit.
LOOP AT it_final INTO wa_final WHERE cb = 'X'.
wa_xkomfk-vbeln = wa_final-vbeln.
wa_xkomfk-posnr = wa_final-posnr.
wa_xkomfk-fkimg = wa_final-lfimg.
wa_xkomfk-vrkme = wa_final-meins.
wa_xkomfk-vbtyp = 'J'.
APPEND wa_xkomfk TO xkomfk.
CLEAR wa_xkomfk.
ENDLOOP.
‎2011 Mar 03 11:34 AM
Hi,
Check this,
CALL FUNCTION 'RV_INVOICE_CREATE'
EXPORTING
invoice_date = sy-datum
vbsk_i = vbsk_i
with_posting = 'B'
id_no_enqueue = 'X'
IMPORTING
vbsk_e = vbsk_i
TABLES
xkomfk = xkomfk
xkomv = xkomv
xthead = xthead
xvbfs = xvbfs
xvbpa = xvbpa
xvbrk = xvbrk
xvbrp = xvbrp
xvbss = xvbss.Here internal table xkomfk will contain ur orders and their line items.
Foe Ex :
vbsk_i-smart = 'F'.
vbsk_i-ernam = sy-uname.
vbsk_i-erdat = sy-datum.
vbsk_i-uzeit = sy-uzeit.
LOOP AT it_final INTO wa_final WHERE cb = 'X'.
wa_xkomfk-vbeln = wa_final-vbeln.
wa_xkomfk-posnr = wa_final-posnr.
wa_xkomfk-fkimg = wa_final-lfimg.
wa_xkomfk-vrkme = wa_final-meins.
wa_xkomfk-vbtyp = 'J'.
APPEND wa_xkomfk TO xkomfk.
CLEAR wa_xkomfk.
ENDLOOP.
‎2011 Mar 03 3:06 PM
Don't use RV_INVOICE_CREATE as the other poster suggested. It won't work either.
You don't need a different BAPI. If you have multiple documents billing to separate documents, then you have criteria that are causing the documents to split. Check your billing copy control routines and the specification of the ZUKRI values. Also check any other fields which would cause the comparision to split: sold-to/payer, region, assignment, address number, etc.
‎2011 Mar 14 7:16 AM
Hi brad,
We are tried to create billing with 2 sales order with same document type , the billing created for both sales document as one billing document, the same thing we are doing in BAPI it create seperate billing document for each sales order. I dont want each billing document, i want one billing document irrespective of number of sales order..