Skip to Content
avatar image
Former Member

Accessing data from Table control

Hi,

I created a table control using report program and i am trying to enter data in the table control which i want to update in the DB table. How can i get the data entered in table control to the report program, so that i can update the DB table.

Please help me finding out which variable will hold the data entered in table control(dynamically).

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Sep 17, 2008 at 09:15 AM

    U will have to append data to internal table in PAI

    Between(write this code)

    LOOP

    Modify itab index TC-Current_line.

    If sy-subrc ne 0.

    append itab.

    endif.

    ENDLOOP.

    now this internal table data can be used to modify

    the database table

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2008 at 09:24 AM

    hi

    u need to create a table where all the data entered by u to be stored from that table only u can update the DB tble.

    for this purpose u ve to create push button for that

    and when save this data will update in one table.

    regards

    Sachhidananda

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      had u putted modify data into pai???

      use this code.

      LOOP

      Modify itab index TC-Current_line.

      If sy-subrc ne 0.

      append itab.

      endif.

      ENDLOOP.

  • avatar image
    Former Member
    Sep 17, 2008 at 09:27 AM

    Hi Sachhidananda,

    i created a push button and i had the table.

    But the thing is im unable to access the data which is entered in table control.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2008 at 09:28 AM

    hi gautham,

    1. While designing set the table control as input field.

    2. In ur program create an internal table, with the same structure as your table control.

    3. Whenever an entry is made in the table control, modify your internal table.

    4. While saving use the internal table data to update the custom table.

    If internal table name is same in both screen painter(table control) and in the program then the values will automatically come into the internal table in the program with out programming.

    Otherwise we have programtically transfer the values.

    In the PAI event using move or move-corresponding statement.

    Check the program *RSDEMO02*

    check the links

    http://help.sap.com/saphelp_nw04/helpdata/EN/9f/dbac9f35c111d1829f0000e829fbfe/content.htm

    Yogesh N

    Add comment
    10|10000 characters needed characters exceeded