12-23-2008 12:31 PM
Hi friends,
on my selection screen i have 2 fields
S_TKNUM = Shipment
S_KUNNR = Ship to
Based on the values on the selection screen entered for shipment the report is getting the delivery number and shipment for vttp table in a internal table t_vttp.
and now based on the delivery number in the internal table t_vttp it is getting the delivery number and shipto from likp table into a internal table t_likpand its also cheking for the ship to (s_kunnr ) ie : its only getting the shipto which are entered in the selection screen..
later after fetching the data its looping both internal tables t_vttp and l_likp and moving the data to another internal table t_final.
in the final internal table t_final i have 3 fileds delivery number , shipment and shipto and its displaying it on to the screen.
now i need to change the report in the following way.
we need to add anothe filed on the selection screen customer purchase order no ( S_BSTNK )
now my new selection screen should be in the below format.
S_BSTNK = Customer Purchase Order number
S_TKNUM = Shipment
S_KUNNR = Ship to
Now my requiremnt is when the user enters only shipment on the screen then only the previous logic shouls excute ( ie old report logic )
and when the user enters the value in the field customer purchase order number ( s_bstnk )
when the user enters the value in S_BSTNK , it should get all the invoices fromVBRK table.
and later for those all invoices i should get the deliveries from VBFA table.
Now for all those deliveries i should get the SHIPMENT & SHIPTO and should check for the values entered in S_TKNUM and S_KUNNR ( ie : if the user enters shipment and shipto in S_TKNUM and S_KUNNR it should get only those values which are entered ).
now later i should get Customer purchase order number ( BSTNK ) Shipment (TKNUM ) and shipto ( KUNNR ) in one internal table .
Can any one tell me how to link it.
Regards,
Priyanka.
12-23-2008 1:29 PM
HI
Try this
If s_bstnk is initial.
old Logic
else.
New Logic
endif.
New Logic
for s_bstnk better get a data from vbfa for po invoice instead of using vbrk as it will effect performance.
Table i_invoce.
Then for using i_invoce then get deliveries from vbfa into i_deliveries
Then get the shipment based on i_deliveries.
Now
Loop at shipment table
read the delivery table .
read the invoice table
append the final table.
endloop.
Hope this hint help
Cheers
Joginder
12-23-2008 12:42 PM
make d additional field as mandatory and develop the logic as fetching starting from dat input
12-23-2008 12:46 PM
12-23-2008 12:49 PM
hi,
take all the values into internal table then put the condition if the field is not initail pull the data else don't append into final tbale
12-23-2008 1:29 PM
HI
Try this
If s_bstnk is initial.
old Logic
else.
New Logic
endif.
New Logic
for s_bstnk better get a data from vbfa for po invoice instead of using vbrk as it will effect performance.
Table i_invoce.
Then for using i_invoce then get deliveries from vbfa into i_deliveries
Then get the shipment based on i_deliveries.
Now
Loop at shipment table
read the delivery table .
read the invoice table
append the final table.
endloop.
Hope this hint help
Cheers
Joginder