‎2014 Apr 23 8:17 AM
Hi Experts,
I have created a program using table control. But after filling a row when i press enter the entire row getting blank.
So i need to append the last inserted row from table control to internal table so that when i press enter that row remains on screen.
Thanks & Regards
Ashutosh Katara
‎2014 Apr 23 11:41 AM
Hi
Try as below.
PBO
Loop itab into wtab with *****
Module Show data: Here
Endloop
PAI
Loop itab
Module modify_data:
Endloop
Module show_data.
move watab to (structure used in table control)
Endmodule
Module modify_data.
move (table control structure) to watab
modify itab from watab index tctrl-current_line
if sy-subrc <> 0.
append watab to itab.
endif.
Endmodule
Regards
Anand
‎2014 Apr 23 8:24 AM
Hi Ashutosh,
Can you try below?
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT ITAB WITH CONTROL TABC.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE MODIFY_TABLE_CONTROL.
ENDLOOP.
Write the read_table_control module like below
MODULE modify_table_control INPUT.
MODIFY itab INDEX tabc-current_line.
ENDMODULE.
Cheers,
Aditya
‎2014 Apr 23 11:23 AM
Hi Aditya,
Thanks for your reply but its not working.
Regards
Ashutosh
‎2014 Apr 23 11:41 AM
Hi
Try as below.
PBO
Loop itab into wtab with *****
Module Show data: Here
Endloop
PAI
Loop itab
Module modify_data:
Endloop
Module show_data.
move watab to (structure used in table control)
Endmodule
Module modify_data.
move (table control structure) to watab
modify itab from watab index tctrl-current_line
if sy-subrc <> 0.
append watab to itab.
endif.
Endmodule
Regards
Anand
‎2014 Apr 26 11:17 AM
Hi Anand,
Thanks for you reply it was helpful.
Resolved the query.
Regards
Ashutosh
‎2014 Apr 23 12:22 PM
Hi,
try this code in PAI,
IF sy-ucomm = 'ENTER'.
if tabc-col1 is NOT INITIAL and
tabc-col2 is NOT INITIAL and
tabc-col3 is NOT INITIAL and
tabc-col4 is NOT INITIAL.
w_tab-field1 = tabc-col1.
w_tab-field2 = tabc-col2.
w_tab-field3 = tabc-col3.
w_tab-field3 = tabc-col4.
modify <itab> FROM <workarea> INDEX sy-tabix.
ENDIF.
ENDIF
‎2014 Apr 23 12:38 PM
Hello Ashutosh,
Firstly, whenever you make any entry in table control, it automatically gets updated in the internal table. This you can check in debugger also (switch ON debugger, just before pressing ENTER).
Secondly, the sy-ucomm value for ENTER is generally ' ' (Space). So, just check once, if you wrote any code already for sy-ucomm = ' '. If it's so, that part of code will trigger when you press ENTER. Might be that is why your entire row is getting blank when you press enter.
Thirdly, please check if you are clearing the work area for the internal table in the PBO/PAI part. In that case, the newly added record might get blank.
I'll suggest to debug once thoroughly from entering the value in table control till it disappears from the screen and you might end up finding and resolving the issue yourself.
Regards,
Anubhab
‎2014 Apr 23 12:58 PM