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

module pool, table control line selection

I am getting some output in my table control as per my select query.

now i am selecting a few lines from my table control and those lines that i have selected needs to be saved in my ztable.

i dont know how to read those selected lines,

Please help me.

Regards,

Roshan Lilaram.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:14 AM

    Hi,

    First define the SELECTION KEy in the Table control Attributes like v_CHK

    along with vertical and horizontal scroll bars.

    In the PAI of that LOOP..Endloop. write some module and in that module write the code like:

    loop at itab where v_chk = 'X'.

    move the fields from itab to your Ztable fields.

    modify your Ztable .

    endloop.

    reward if useful

    regards,

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:20 AM

    Hi,

    I guess this piece of code will help you. In PAI of the screen. Inside the LOOP

    ENDLOOP, write a statement ' FIELD sel MODULE XXXX ON INPUT'.

    This module gets triggered only for those values which you have selected on table control. This 'sel' field value will turn to 'X' when you select a line on table control.

    You part of code can be included in the module above.

    If you think this helped you in any way request you to award me points.

    Regards,

    Sravanthi.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:23 AM

    Hi Roshan,

    As it is a MODULE pool program it is difficult to send the code.But,follow these steps to.....

    <b>See this standard program and follow the below steps to get your problem solved :

    </b>

    <b>DEMO_DYNPRO_TABCONT_LOOP_AT</b>

    1. After execution, you see some data in TABLE CONTROL.

    2. Press Display/Change button on the application tool bar to get into change mode.

    3.Select some records.

    4.Now press on delete button which is again on the application tool bar.

    <b>

    5. Now you have to observe one thing i.e., How come only these lines are deleted ???</b>

    6. Check functionality in debugging mode if required.

    7.Instead of DELETE statement in the program whereever it is there, put INSERT command .

    8.This solves your problem.

    <b>

    Reward all helpful answers</b>

    Regards,

    V.Raghavender.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 23, 2007 at 10:11 AM

    Hi,

    Try like this ..

    when the user press SAVE Button.

    CASE OK_9000.

    When 'SAVE'.

    Loop at itab where sel = 'X'.

    ztable = itab.

    INSERT ztable .

    Endloop.

    Endcase.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      i have defined a field called chk in the attributes as well as in the itab,

      when i select a few lines and then i check in the debugger, there is no value in the chk column.

      I dont know what i am missing.

      in attributes the w/selcolumn = itab-chk is been defined by me, i hope this is correct and

      the code is

      When 'SAVE'.

      Loop at itab where CHK = 'X'.

      • some code ***

      Endloop.

      here nothing is in chk.

      the whole column is blank after pressing save and after selecting a few lines and i am also not getting any vertical scrol bar.

      Please help.

      Regards,

      Roshan Lilaram.

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 10:19 AM

    Hello Roshan,

    First include a checkbox for ur tale control and add the same field in ur internal table also.

    In the screen add a button to save the selected entry to the ZTABLE.

    Then in the PAI write this code:

    CASE SY-UCOMM.
    WHEN 'SAVE'.
    LOOP AT ITAB INTO WA_ZTABLE WHERE SEL = 'X'.
    MODIFY ZTABLE FROM WA_ZTABLE.
    ENDLOOP.
    ENDCASE.

    Hope this will solve ur problem.

    IF USEFUL REWARD.

    REgards,

    VAsanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 01:04 PM

    i have continued this thread into another one with the same title, please help me .

    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.