Application Development 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: 

Regardinf module pool programming......

Former Member
0 Kudos
65

Hi friends,

I am trying to learn module pool programming, where in i got stuck up in a situation that, i want to delete, update, modify/insert the database table.

I have used a table control for that. i have inserted 4 buttons (exit E, updateU,deleteD,getdataG). Getdata and exit are working fine but how to make use of these update and delete. Please help me in this regard.....

Here is the code.......please make the neccesary changes

********This is the flow logic**********************

PROCESS BEFORE OUTPUT.

  • MODULE STATUS_1000.

*

LOOP AT IT_ITAB WITH CONTROL TCL.

MODULE COPY_DATA.

ENDLOOP.

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_1000.

MODULE EXIT.

LOOP AT IT_ITAB.

*MODULE READ_DATA.

ENDLOOP.

*********This is the code of my program***************

PROGRAM ZBADRI_SCREEN_PROG_EXMP10.

*CALL SCREEN 1000.

TABLES : ZOMEGA_EMP_DET.

CONTROLS : TCL TYPE TABLEVIEW USING SCREEN 1000.

DATA : BEGIN OF IT_ITAB OCCURS 0,

EMPNO TYPE ZEMPNO,

EMPNAME TYPE ZEMPNAME,

MOBNUM TYPE ZMOBNUM,

END OF IT_ITAB.

&----


*& Module EXIT INPUT

&----


  • text

----


module EXIT input.

CASE SY-UCOMM.

WHEN 'E'.

LEAVE PROGRAM.

WHEN 'G'.

SELECT EMPNO

EMPNAME

MOBNUM

FROM

ZOMEGA_EMP_DET INTO CORRESPONDING FIELDS OF TABLE IT_ITAB.

WHEN 'U'.

READ TABLE IT_ITAB WITH KEY IT_ITAB-EMPNO.

MOVE-CORRESPONDING IT_ITAB TO ZOMEGA_EMP_DET.

UPDATE ZOMEGA_EMP_DET FROM TABLE IT_ITAB.

ENDCASE.

endmodule. " EXIT INPUT

&----


*& Module COPY_DATA OUTPUT

&----


  • text

----


module COPY_DATA output.

MOVE-CORRESPONDING IT_ITAB TO ZOMEGA_EMP_DET.

endmodule. " COPY_DATA OUTPUT

&----


*& Module READ_DATA INPUT

&----


  • text

----


module READ_DATA input.

  • READ TABLE IT_ITAB.

  • MOVE-CORRESPONDING IT_ITAB TO ZOMEGA_EMP_DET.

  • CASE SY-UCOMM.

  • WHEN 'U'.

  • UPDATE ZOMEGA_EMP_DET FROM TABLE IT_ITAB.

  • ENDCASE.

endmodule. " READ_DATA INPUT

Points will be rewarded.

Regards

Badri

Message was edited by:

Badrinath Thiriveedhi

2 REPLIES 2

gopi_narendra
Active Contributor
0 Kudos
41

Check the answer in ur other thread and plz close this thread to avoid confusion.

Regards

- Gopi

Former Member
0 Kudos
41

in PAI do the foll thing .

loop with control tc_abc .

chain .

field : a ,

b,

c .

module update on chain-request .

endchain .

endloop .

whenever fields of ur table displayed in table control changes module update will be called .

do all ur processing here .