Application Development 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: 

to get no of invoice

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

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

6 REPLIES 6

former_member188685
Active Contributor
0 Kudos

Use the Function module

RV_ORDER_FLOW_INFORMATION

0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

former_member387317
Active Contributor
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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.