on 09-01-2008 9:09 AM
Hi All,
I am working with module pool programm.
I written code like this
SELECT * FROM vbfa WHERE vbeln EQ vbfa-vbeln
AND vbtyp_n EQ c_vbtyp_n
AND vbtyp_v EQ c_vbtyp_v.
endselect.
in this code vbeln is follow-on document based on this it retrieves preceding documents (vbelv's) .
as per above code it retrieves last vbelv ..it is working fine .
but, in production system it selects first one only..
means i'll give any level of invoice in selection-screen..it gives initial one(vbelv) only...
plz anybody provide the solution very very slowly while I read [the rules|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
rgrds...
Edited by: Julius Bussche on Sep 1, 2008 8:42 AM
hi,
Your select query was as follows;
SELECT * FROM vbfa WHERE vbeln EQ vbfa-vbeln
AND vbtyp_n EQ c_vbtyp_n
AND vbtyp_v EQ c_vbtyp_v.
endselect.
But the syntax is :
SELECT * FROM vbfa
INTO <itab>
WHERE vbeln EQ vbfa-vbeln
AND vbtyp_n EQ c_vbtyp_n
AND vbtyp_v EQ c_vbtyp_v.
endselect.
where itab is an internal table that you have to declare using DATA command.
Hope this helps.
Thanks,
rashmi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
Actually I designed one transaction with selection screen , it contains invoice as I/p field..based on this it selects respective delivery number..means plz see the below sd document flow:
Sales order
Delivery one
Invoice one
Sales order two
Delivery two
Invoice twou2026like this ..here can I give invoice two it will be give delivery twou2026
(or) will I give invoice one ..then it will give invoice one..
for the above requirement I written that code ..that is working fine in dev-system, but in production system for any irrespective invoice number it gives only delivery one..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ranadheer,
You dont have to write select query on your own, use Function module RV_ORDER_FLOW_INFORMATION, read its documentation.
And Sample Report Program code can be found @ below links,
[Read sales document flow using a function module|http://learningabap.wordpress.com/2007/03/28/read-sales-document-flow-using-a-function-module/]
[Sales Order Flow u2013 Tree Report|http://www.erpgenie.com/abap/SalesOrderFlow.htm]
Hope the above code will help you for sure....
Regards
Karthik D
Hi Ranadheer,
Welcome to SDN..
You extract all the data into an internal table and then use that internal table for further process..
Then you would get that correctly.
Select * from <table> into <itab> where <cond>
<table> -- Any Dictionary table
<itab> -- Internal table like standard table of dictionary table.
Hope this would help you.
Good luck
Narin
Hi,
Can you be more clear on your question?
Regards,
Naresh Durki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.