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

module pool data buffer refresh

Former Member
0 Likes
1,416

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

2 REPLIES 2
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
650

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

Read only

Former Member
0 Likes
650

thanks