Skip to Content
author's profile photo Former Member
Former Member

table control

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 07:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 07:49 AM

    Hi Anitha,

    Plesae folow this link Two table controls in single screen

    Regards,

    Pravin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 14, 2009 at 08:07 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Posted on Aug 14, 2009 at 09:12 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.