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

Saving Ztable using Module Pool

Former Member
0 Likes
965

hi

I want to save the entries into a Ztable using Module pool programming.. I want the Module Pool Program to work like the SM30 table maintenance...

Right now.. I have 2 module pool screen on the screen... one which displays the entries of Ztable and the other which is an input enabled screen so that I can enter records into it..

When I save the records the Ztable should get updated and when the screen again comes to PBO the enetered records should be displayed in the first table control

Right now I am stuck here

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0001.r45
MODULE FILL_TABLE.
LOOP AT TBL_ZTVM3 into wa_ztvm3 WITH CONTROL TC1 CURSOR TC1-TOP_LINE.
ENDLOOP.

LOOP AT TBL2_ZTVM3 into ztvm3 WITH CONTROL TC2 CURSOR TC2-TOP_LINE.
ENDLOOP.

*
PROCESS AFTER INPUT.
LOOP AT TBL_ZTVM3.
ENDLOOP.

LOOP AT TBL2_ZTVM3.
ENDLOOP.

MODULE USER_COMMAND_0001.

user command goes like this

*&---------------------------------------------------------------------*
*&  Include           YENTRIES_ZTABLE_I01
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0001  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0001 INPUT.

CASE SY-ucomm.
when 'SAVE'.
modify tbl2_ztvm3 from wa2_ztvm3 INDEX TC2-CURRENT_LINE.
ENDCASE.

ENDMODULE.                 " USER_COMMAND_0001  INPUT

SO quite a simple code.. but after 1 year I just lost touch with this.. I have defined the Selection Column check rows too for the table control

Can you please help me with this.. I <REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Mar 27, 2008 1:41 PM

4 REPLIES 4
Read only

Former Member
0 Likes
627

Not sure if I get it, but you mean updating the Z table on the data dictionary from the data you've changed on the internal table?

If that's the point, you'll have to use the MODIFY this way, just after updating your internal table:


MODIFY <dtable> FROM TABLE <itable>.

Read only

0 Likes
627

hi

Question still open.. I mean to say how do I read the values which are entered into the Table Control 2...

Where are they stored... please post sample code if you have it

Read only

0 Likes
627

IN PAI of the Module flow logic

you need to modify the internal table with the modified content.

Like this

PROCESS AFTER INPUT.
  MODULE EXIT AT EXIT-COMMAND.
  MODULE CHECK_PAI.
  LOOP WITH CONTROL TC. 
    MODULE MODIFY_DATA. 
  ENDLOOP.

IN side the MODIFY_DATA

You need to update the Internal table with the modified content. then your internal table will have the latest Information.

You save the latest information.

Read only

Former Member
0 Likes
627

Almost done, thanks for the code sample.. I searched for this command in forums and got the required help