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

What is the ok-code for selected line items in Module Pool programming

Former Member
0 Likes
1,512

Hi,

I have a requirement on Goods Receipt/Reversal.Currently the existing program display header and Item level data(ex:10 line items) for selected shipment number.

My requirement is need to add new field (i.e date field )on header level which shoud be editable.When the user enter the date and user may select few line item(ex:3 line items) and when he click on SAVE button ,it shoud display the selected items only in item level.

Please Help me to solve this Issue.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
917

Hello Reddyne,

First of all Welcome to SDN.

1. Select the table control then-> select status from help(in Menubar)-> double click on the screen number appearing there.

2. It opens the flowlogic screen-> now click on Layout Push button.

3. In layout check the attribute of the table control

towards the bottom of the Attribute screen there is a parameter w\selection _________ .

4. this is the parameter which is marked 'X' when you select a item in the screen.

Now in PAI

1. within the loop endloop.

add this code to get the selected header details.

LOOP AT itab WITH CONTROL tbcl.

MODULE check_selected_item.

ENDLOOP.

-


MODULE check_selected_item.

IF <w\selection> = 'X'.

MOVE tbcl to wa.

append wa to itab1.

ENDIF.

ENDMODULE.

-


Now you can fetch the item details based on the contents of itab1 i.e selected items for header.

Hope this discussion would be really helpful to you.

Cheers,

Suvendu

6 REPLIES 6
Read only

Former Member
0 Likes
918

Hello Reddyne,

First of all Welcome to SDN.

1. Select the table control then-> select status from help(in Menubar)-> double click on the screen number appearing there.

2. It opens the flowlogic screen-> now click on Layout Push button.

3. In layout check the attribute of the table control

towards the bottom of the Attribute screen there is a parameter w\selection _________ .

4. this is the parameter which is marked 'X' when you select a item in the screen.

Now in PAI

1. within the loop endloop.

add this code to get the selected header details.

LOOP AT itab WITH CONTROL tbcl.

MODULE check_selected_item.

ENDLOOP.

-


MODULE check_selected_item.

IF <w\selection> = 'X'.

MOVE tbcl to wa.

append wa to itab1.

ENDIF.

ENDMODULE.

-


Now you can fetch the item details based on the contents of itab1 i.e selected items for header.

Hope this discussion would be really helpful to you.

Cheers,

Suvendu

Read only

Former Member
0 Likes
917

hi.

To select a item in Table control , We have enable the select button .

go to table control properties , w/sel : give field name in Internal table which is of char 1.

when the user selected the line and PAI is trigged.

loop with itab.

endloop.

will run.

inside a loop call module.

check for 'x' in the field if it is 'x' then line is selected.

By this you can get the selected lines.

Read only

Former Member
0 Likes
917

Thanks for your help.

Read only

Former Member
0 Likes
917

Need some more help on this

Read only

Former Member
0 Likes
917

Hi Guys,

The table control was not used in the exist program.They were used field catalog and ALV function module.In that case,how to handle the selected items and how to do the same in ALV.Pls help me out on this.

Read only

Former Member
0 Likes
917

hi

when ever u access a pushbutton in PAI

each and very push button has a function code attached to ii

and it will be stored in sy-ucomm system variable.

in Abap programs since we should not change system varible

declare a variable called OK-CODE and pass the value of sy-ucomm to it.

Regards