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: 

changing the code of report based on additional field on selection screen

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

joginder_singh
Active Participant
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

make d additional field as mandatory and develop the logic as fetching starting from dat input

0 Kudos

can you tell me how to link it.

Regards

Priyanka.

0 Kudos

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

joginder_singh
Active Participant
0 Kudos

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