Application Development and Automation 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: 
Read only

Program on Document Flow

Former Member
0 Likes
530

Hi Floks,

I need a solution for this:

Write a small program which shows the the document flow given a Sales order no.

Rewards would be given for quick responses.

Regards

Nanda

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
445

Well, do you want to throw the dialog which you see in VA02 for document flow, or do you just want the data from the database directly?

If you just want to throw the dialog that you see in VA02, you can do something like this.



report zrich_0001.

data: xvbco6 type vbco6.
data: xvbak type vbak.


parameters: p_vbeln type vbak-vbeln.

clear xvbco6. clear xvbak.

select single * from vbak into xvbak
             where vbeln = p_vbeln.

move-corresponding xvbak to xvbco6.

call dialog 'RV_DOCUMENT_FLOW'
     exporting
          vbco6  from xvbco6
          ivkorg from xvbak-vkorg
          ivtweg from xvbak-vtweg.

Otherwise, you will need to look at transparent table VBFA.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
446

Well, do you want to throw the dialog which you see in VA02 for document flow, or do you just want the data from the database directly?

If you just want to throw the dialog that you see in VA02, you can do something like this.



report zrich_0001.

data: xvbco6 type vbco6.
data: xvbak type vbak.


parameters: p_vbeln type vbak-vbeln.

clear xvbco6. clear xvbak.

select single * from vbak into xvbak
             where vbeln = p_vbeln.

move-corresponding xvbak to xvbco6.

call dialog 'RV_DOCUMENT_FLOW'
     exporting
          vbco6  from xvbco6
          ivkorg from xvbak-vkorg
          ivtweg from xvbak-vtweg.

Otherwise, you will need to look at transparent table VBFA.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
445

Hi,

Use Table VBFA to get the document flow of a particular Sales Order. Following Code will give you a list of documents for a particular sales order. Here, field VBTYP_N determines whether it is another Sales Order or a Delivery or a Quotation etc.

TYPES : BEGIN OF x_vbfa,

vbeln TYPE vbeln_von,

vbtyp_n TYPE vbtyp_n,

END OF x_vbfa.

DATA : it_vbfa TYPE TABLE OF x_vbfa,

x_vbfa TYPE x_vbfa.

SELECT vbeln vbtyp_n

FROM vbfa

INTO TABLE it_vbfa

WHERE vbelv = sales_order_no.

IF sy-subrc = 0.

LOOP AT it_vbfa INTO x_vbfa.

WRITE : /x_vbfa-vbeln, 20 x_vbfa-vbtyp_n.

ENDLOOP.

ENDIF.

Reward points if the answer is helpful.

Regards,

Mukul