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: 

table control

Former Member
0 Kudos

hi,

in module pool i used two table controls one have header details another have item details.

first table control getting correctly.

now i select any row first table control corresponding details can be get in second table control.

where we write the code and tell me the code.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI Anitha,

You need to create a button for display items.

The code for this button should be in PAI of first screen within the case statement of SY-UCOMM and fill the required internal table for display of items, now call other screen with this internal table.

Thanks

Rohit

5 REPLIES 5

Former Member
0 Kudos

HI Anitha,

You need to create a button for display items.

The code for this button should be in PAI of first screen within the case statement of SY-UCOMM and fill the required internal table for display of items, now call other screen with this internal table.

Thanks

Rohit

Former Member
0 Kudos

Hi Anitha,

Plesae folow this link

Regards,

Pravin

Former Member
0 Kudos

hi,

now my data is in first table control screen.

now i need to select any row that details only populated in second screen.

but it takes only last line.

0 Kudos

Hi,

Please follow the suggestions as given above. Also, have a w/sel column for your table control. Enable it by checking the w/sel column in the Screen Attributes (layout). Also, have a field declared in your internal table correspondingly. So whenever you check the first column in the table control, update your field to hold 'X' denoting that it has been checked. Capture the row details in another internal table or a work area and use this to query the details for the second table control.

Please post your code here so that we can check and help you out.

former_member218674
Contributor
0 Kudos

Hello Anitha,

The only mechanism you need right now is the event to catch the row value.

In this case you need to set the sel. col. attributes for tableview in screen painter also add same attribute to your internal table

with char1 length. for example your itab will look like following:

data: begin of itab occurs 0,

mark type char1,

your field 1

your field 2

....

end of itab.

Here mark is same as the selection col attribute given on selection screen.

create one command button to select data on the basis of selected rows from table one.

Now, in PAI write following code:

PROCESS AFTER INPUT.

loop at itab.

module move_to_itab.

endloop.

MODULE USER_COMMAND_0200.

This code will transfer the table control content to internal table so in this case it will also transfer the select rows header

that is the MARK field above.

Now in MODULE USER_COMMAND you can code for selecting data for second internal table which will be displayed in second table view as follow:

module USER_COMMAND_0200 input.

case sy-ucomm.

when 'SEL'. <-- function code for the command button for selecting data.

you can get the selected row from internal table where MARK EQ 'X'.

select data for second internal table based on the selected row values

endcase.

endmodule.

Hope this helps!

For more information on TABLEVIEW and DIALOG PROGRAMMING you can refer to SAP Help!

Thanks,

Augustin.