‎2007 Jan 24 9:14 PM
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
‎2007 Jan 24 9:18 PM
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
‎2007 Jan 24 9:18 PM
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
‎2007 Jan 24 9:22 PM
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