07-26-2008 7:03 AM
hello all,
can anyone let me know how can i get total number of invoice for a particular sale order.
in VBRP its taking more time, so performance is problem.
07-26-2008 7:17 AM
Use VBFA table... To get invoice
DATA : BEGIN OF WA_VBFA,
VEBLN TYPE VBFA-VBELV,
VBELV TYPE VBFA-VBELV,
END OF WA_VBFA.
DATA : IT_VBFA LIKE STANDARD TABLE OF WA_VBFA WITH HEADER LINE.
SELECT VBELN VBELV FROM VBFA
INTO TABLE IT_VBFA
WHERE VBTYP_N = 'M' AND " M => invoice
VBTYP_V = 'C' AND
VBELV = '0000800044'. " Sales order
DATA: V_LINE TYPE I.
DESCRIBE TABLE IT_VBFA LINES V_LINE.
WRITE : 'No of invoice for sales order is ' , V_LINE.
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
07-26-2008 7:10 AM
07-26-2008 7:15 AM
hello vijay,
i went thru this function module RV_ORDER_FLOW_INFORMATION
but could not got what data i hav to pass as input and wot ll be output.
Thanks
07-26-2008 7:22 AM
Did you check the table VBFA,
There Preceeding document and Succeeding Document.
One is sales order and other is Invoice, So you can
VBTYP_N
VBTYP_V
Pass Proceeding Document VBELV "sales order number
VBTYP_V = 'C' "for Order
VBTYP_N = 'M'
and you will get the details. Same you have to pass the Function module.
07-26-2008 7:16 AM
Hi,
first get the data from table VBFA where vbtyp_N = 'M'.
then you can get data from vbrp table using VBELN
POSNN of vbfa tble. Performance would be fine in this case.
Rgds,
Paras
07-26-2008 7:17 AM
Use VBFA table... To get invoice
DATA : BEGIN OF WA_VBFA,
VEBLN TYPE VBFA-VBELV,
VBELV TYPE VBFA-VBELV,
END OF WA_VBFA.
DATA : IT_VBFA LIKE STANDARD TABLE OF WA_VBFA WITH HEADER LINE.
SELECT VBELN VBELV FROM VBFA
INTO TABLE IT_VBFA
WHERE VBTYP_N = 'M' AND " M => invoice
VBTYP_V = 'C' AND
VBELV = '0000800044'. " Sales order
DATA: V_LINE TYPE I.
DESCRIBE TABLE IT_VBFA LINES V_LINE.
WRITE : 'No of invoice for sales order is ' , V_LINE.
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
07-26-2008 7:56 AM
The above post(you gave 10 point) is modifed with the code after i posted the information how to proceed.
Did you check that.
It is left to you.