ā2013 Mar 01 6:04 AM
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.
ā2013 Mar 01 6:22 AM
hi,
refer these links,
http://scn.sap.com/thread/3201708
http://scn.sap.com/thread/828288
thanks,
Mathan R.
ā2013 Mar 01 6:23 AM
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
ā2013 Mar 01 7:30 AM
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.
ā2013 Mar 01 7:41 AM
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
ā2013 Mar 01 6:30 AM
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
ā2013 Mar 01 6:34 AM
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
ā2013 Mar 01 6:41 AM
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