‎2008 Jul 03 9:58 AM
Dear all,
How can i get the corresponding sales document number form a billing document number?
Plz let me know.
Rahul.
‎2008 Jul 03 11:37 AM
Hi,
Pass the Billing document no to the table VBFA -Vbeln using the condition vbtyp_v = 'C'
Get the VBELV value from the VBFA .
This is the sales document number .Pass this value in Vbak/Vbap - vbeln to get the sales details.
Hope this helps you
reward points if helpfull.
Thanks & Regards,
Y.R.Prem Kumar
‎2008 Jul 03 10:02 AM
Hi,
Using the table VBFA (Document flow table) u can get
corresponding sales document number form a billing document number.
Pass the Precending , Subsequent documents and the document type.
Regards,
Jaya Vani
‎2008 Jul 03 10:05 AM
check out the table VBRP
there u get billing document no. and
Sales Document aubel
Hope it helps
Regards
Bhanu
‎2008 Jul 03 11:13 AM
Please look at the below code.. It will give you the sales document no corresponding to the billing document no:
DATA: wa_comwa TYPE vbco6,
i_vbfa TYPE STANDARD TABLE OF vbfa INITIAL SIZE 0,
wa_vbfa TYPE vbfa,
l_vbeln TYPE vbeln.
*billing document no
l_vbeln = '90000049'.
*Padding leading zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = l_vbeln
IMPORTING
output = wa_comwa-vbeln.
*Get the order info
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
belegtyp = 'M' "Billing docu
comwa = wa_comwa
TABLES
vbfa_tab = i_vbfa
EXCEPTIONS
no_vbfa = 1
no_vbuk_found = 2
OTHERS = 3.
IF sy-subrc = 0.
READ TABLE i_vbfa INTO wa_vbfa
WITH KEY vbtyp_n = 'J' "Shipment
vbtyp_v = 'C'. "Order
IF sy-subrc = 0.
Display order
WRITE wa_vbfa-vbelv.
ENDIF.
ENDIF.
Please reward if useful
-Tushar
‎2008 Jul 03 11:37 AM
Hi,
Pass the Billing document no to the table VBFA -Vbeln using the condition vbtyp_v = 'C'
Get the VBELV value from the VBFA .
This is the sales document number .Pass this value in Vbak/Vbap - vbeln to get the sales details.
Hope this helps you
reward points if helpfull.
Thanks & Regards,
Y.R.Prem Kumar