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

Table Control values disappear.

Former Member
0 Likes
3,347

hii

I have a requirement .

The table control that i have has 5 columns .The values which i enter in the table control are getting SAVED into the table when am pressing the SAVE button. . But my problem is after that the  values get disappeared but its getting saved in table.My requirement is i want the values to be displayed in the tableControl without getting disappeared while SAVING.

regards.

Arshad.

7 REPLIES 7
Read only

Former Member
0 Likes
1,801
Read only

davis_raja
Active Participant
0 Likes
1,801

Dear Arshad,

          You need to add a module in the loop of table control which you are using in the PAI.

          In the module you need to modify your table control contents to keep on updated, otherwise your contents in table screen will be refreshed.

   MODIFY ith_zpmbbclreceipt INDEX table_clreceipt-current_line.
   IF sy-subrc <> 0.
     APPEND ith_zpmbbclreceipt.
   ENDIF.

In the above example, ith_zpmbbclreceipt is the internal table which you are using for table control

and table_clreceipt is the table control.

Hope this helps your problem.

Thanks and Regards

Davis

Read only

0 Likes
1,801

Dear Davis Raja

I tried your syntax but in that internal tables values are not updating.

MODIFY itab_appcode INDEX appcode-current_line.

    IF sy-subrc <> 0.

      APPEND itab_appcode.

    ENDIF.

itab_appcode is my internaltable. In debugger am not getting any values in thz internalTable.

thanks.

arshad.


Read only

0 Likes
1,801

Dear Arshad,

     There is an another method for that which is a slight modification of the above method. This looks absurd, but you can give a try of this method.

     Create a module in the LOOP.. ENDLOOP of  PAI event.

     Inside the module, try the assign the values of the field to a variable.

     Eg. v_x = itab_appcode-x.

            v_y = itab_appcode-y.

     And again assign  the value back to the internal table fields before our MODIFY command.

    itab_appcode-x = v_x.

    itab_appcode-y = v_y.

    MODIFY itab_appcode INDEX appcode-current_line.

    IF sy-subrc <> 0.

      APPEND itab_appcode.

    ENDIF.

     Hope it will work.

Thanks and Regards

Davis

Read only

vinoth_aruldass
Contributor
0 Likes
1,801

hi arshad,

as Davis Raja explained,

you need to update the internal table which you assigned for the table control in the program PAI.

you need to create a module..

hope it helps,

Vinoth

Read only

vinoth_aruldass
Contributor
0 Likes
1,801

hi arshad ,

you need to update the table which you assigned for the table control ..

for that in PAI you need to create the module for updating the internal table..

  MODIFY  zit_table INDEX table_clreceipt-current_line.

   IF sy-subrc <> 0.

     APPEND zit_tablet.

   ENDIF.

hope it helps,

Vinoth

Read only

former_member182379
Contributor
0 Likes
1,801

Hi,

   If you have created the table control using table control with wizard and have the insert delete button on the screen to add the new records  in PBO  add the below code

default it will be as below

   MODULE TAB1_CHANGE_TC_ATTR OUTPUT.
       DESCRIBE TABLE IT_ITAB LINES TAB1-lines. 
  ENDMODULE.

change it as below

   MODULE TAB1_CHANGE_TC_ATTR OUTPUT.

      IF IT_ITAB IS INITIAL.                                    "it_itab is internal table with work area wa_itab
       APPEND WA_ITAB TO IT_ITAB.
    ENDIF.


  DESCRIBE TABLE IT_ITAB LINES TAB1-lines.
ENDMODULE.

regards,

  zafar