‎2009 Mar 09 1:58 PM
Hi,
I am facing a strange issue in my module pool program for a infotype
I have created module pool with different screens.
screen contains 2 tabs and 2 subscreens.
in one subscreen, if i go into edit mode and change the values in screen, If i save (usnig standard SAVE button) it is not holding the new value. it is refreshing picking the value from old value only.
Please help me here
‎2009 Mar 10 3:45 AM
Hi,
What you need to do is to modify the contents of the table control back into the internal table whenever any user action is performed.
So in PAI of the screen on which you have a table control write code to modify the internal table from the table control.
it_zekpo is my internal table w/o header line,
wa_zekpo is work area.
Name of input/output fields on screen are:-
wa_zekpo-field1,
wa_zekpo-field2, and so on...
At Screen Logic:-
PROCESS BEFORE OUTPUT.
* MODULE status_8003.
LOOP WITH CONTROL po_tab. "po_tab is table control on screen 8003
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
* MODULE user_command_8003.
LOOP WITH CONTROL po_tab.
MODULE modify_data.
ENDLOOP.
In PBO:-
*&---------------------------------------------------------------------*
*& Module READ_DATA OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
READ TABLE it_zekpo INTO wa_zekpo INDEX po_tab-current_line. "po_tab is table control name
data : line_count type i.
describe it_zekpo
lines line_count.
po_tab-lines = line_count + 10.
"to increase the number of lines in table control dynamically
ENDMODULE. " READ_DATA OUTPUT
In PAI,
*&---------------------------------------------------------------------*
*& Module MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tab-currentline.
"this will modify the contents of existing line
ENDMODULE. " MODIFY_DATA INPUT
Now whenever you change contents in table control and perform any user action, PAI will be triggered and data in internal table will be modified. Now when PBO is executed then it will read the data again from internal table (modified in this case) into table control.
Hope this helps you.
Regards,
Tarun
‎2009 Mar 18 5:51 AM