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 in Module Pool

Former Member
0 Likes
1,152

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

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
1,138

Refer this link -

Regards,

Amit

Reward all helpful replies.

10 REPLIES 10
Read only

amit_khare
Active Contributor
0 Likes
1,139

Refer this link -

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
1,138

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

Read only

Former Member
0 Likes
1,138

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

Read only

0 Likes
1,138

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

Read only

0 Likes
1,138

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.

Read only

0 Likes
1,138

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.

Read only

Former Member
0 Likes
1,138

Hi Guys,

My issue is not resolved. Please help me in providing examples of similar requirment.

Thanks for your kind help.

Regards,

Shankar

Read only

0 Likes
1,138

Hi,

Can you paste your code here ??

Regards,

Mukul

Read only

0 Likes
1,138

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.

Read only

0 Likes
1,138

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