‎2007 Jul 03 7:39 PM
Hi Guys,
I had created the table control in module pool,. My requirement is I will be entering the values in the table and the moment i give executed, the values will get updated in the database table. When i enter the values and give enter, the values is getting disappeared. Please help.
Regards,
Shankar
‎2007 Jul 03 7:46 PM
‎2007 Jul 03 7:46 PM
‎2007 Jul 03 8:10 PM
Hi,
Every table is associated with an internal table in the program. When you go for execution, PAI is called and once PAI is over, again PBO is called. Now, you have to update the internal table in PAI with new values entered on the screen so that those values will be shown when your table is displayed again after going thorugh PAI and PBO.
Now in your case, you are not updating your internal table in PAI, so new values entered on the screen are not inserted into your internal table. Hence, your values don't appear again.
To solve this, use following code in PAI.
LOOP AT internal_table.
MODULE modify_internal_table.
ENDLOOP.
MODULE modify_internal_table.
MODIFY internal_table INDEX current_loop_index.
ENDMODULE.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jul 03 9:46 PM
Hi Guys,
Thanks for your quick response. But my requirements is when enter the values in the table via module pool program and give enter, the value disappears. Please help.
Regards,
Shan kar
‎2007 Jul 03 10:05 PM
Hi,
<b>Case 1:</b> Internal table is not updated
Again as I have given in my previous reply, you need to update the internal table with new values in PAI cause PAI gets fired when you press enter.
<b>Case 2:</b> Internal table is getting refreshed
If the initial data i.e data which was showed when the table was displayed for the first time, is getting removed on pressing enter, then you need to change the code in the module that you have written to update the table in PAI. There is some code in PAI which is refreshing the table.
If it is neither of above two cases, then please explain it in detail.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jul 04 4:11 AM
Check the screen attribute, and select the radio button 'HOLD DATA'.
If this is set and still have the problem, when pressing enter, in PAI module, write the code.
‎2007 Jul 04 4:18 AM
How you created the table control, manually or table control with wizard? always use the second option, which will generate the code automatically, keep the necessary code and delete the rest. Hope this will work.
‎2007 Jul 07 12:09 AM
Hi Guys,
My issue is not resolved. Please help me in providing examples of similar requirment.
Thanks for your kind help.
Regards,
Shankar
‎2007 Jul 07 12:11 AM
‎2007 Jul 07 12:15 AM
you have to make sure you are pulling the values for the fields in the PBO module of the current screen. it should work.
module PAI input.
Case sy-ucomm.
when 'ENTER'.
clear sy-ucomm.
set screen 'Current screen'.
endcase.
endmodule.
‎2007 Jul 07 12:29 AM
Here is my code.
PROCESS BEFORE OUTPUT.
MODULE STATUS_1001.
LOOP WITH CONTROL CREATE_TABLE_CONTROL.
MODULE FILL_CR_TABLECONTROL.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL CREATE_TABLE_CONTROL.
CHAIN.
FIELD : ZVMI_BASE_BONUS-SHIPTO,
ZVMI_BASE_BONUS-BASEUPC,
ZVMI_BASE_BONUS-BASEACT,
ZVMI_BASE_BONUS-BONUSUPC,
ZVMI_BASE_BONUS-BONUSACT.
ENDCHAIN.
MODULE READ_CR_TABLECONTROL.
ENDLOOP.
MODULE USER_COMMAND_1001.
*****************
MODULE FILL_CR_TABLECONTROL OUTPUT.
READ TABLE ITAB_BASE_BONUS INTO ZVMI_BASE_BONUS INDEX CREATE_TABLE_CONTROL-CURRENT_LINE.
ENDMODULE. " FILL_CR_TABLECONTROL OUTPUT
***********************
MODULE FILL_CR_TABLECONTROL OUTPUT.
READ TABLE ITAB_BASE_BONUS INTO ZVMI_BASE_BONUS INDEX CREATE_TABLE_CONTROL-CURRENT_LINE.
ENDMODULE. " FILL_CR_TABLECONTROL OUTPUT
***********************
Wud appreciate if you could help me in this.
Regards,
Shankar