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

Former Member
0 Likes
278

how can we develop module pool programs to update standard tables

1 REPLY 1
Read only

Former Member
0 Likes
242

Hi,

Follow the steps to update the database table records.

1.TOP INCLUDE code

TABLES: EKKO.

DATA: OK_CODE TYPE SY-UCOMM.

CONTROLS: TC100 TYPE TABLEVIEW USING SCREEN 100.

DATA: IT_EKKO LIKE EKKO OCCURS 0 WITH HEADER LINE.

DATA: CUR TYPE I.

DATA: I_EKKO2 LIKE EKKO OCCURS 0 WITH HEADER LINE.

DATA: V_FNAM TYPE I,V_FVAL(10) TYPE N.

2.Create screen with number(e.g 123) and click on layout tab

Give the table control name as TC100.

SELECT THE FIELDS FROM INTERNAL TABLE (IT_EKKO). DRAG THE TEXT FIELDS INTO THE TABLE CONTROL FOR FIELD HEADINGS.

Create 4 pushbuttons(insert,fetch,delete and exit)

CLICK ON “Element list” TAB AND ENTER THE “OK_CODE”.

CLICK ON FLOWLOGIC TAB.

3.Flowlogic code

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

LOOP AT IT_EKKO CURSOR CUR WITH CONTROL TC100.

ENDLOOP.

*

PROCESS AFTER INPUT.

LOOP AT IT_EKKO.

MODULE MODIFY_ITAB.

ENDLOOP.

MODULE USER_COMMAND_0100.

4.Double click on MODIFY_ITAB and write as

module MODIFY_ITAB input.

APPEND IT_EKKO TO I_EKKO2.

endmodule. " MODIFY_ITAB INPUT

5.Activate PAI and double click on it and write the code as

module USER_COMMAND_0100 input.

CASE OK_CODE.

WHEN 'INS'.

LOOP AT I_EKKO2.

MODIFY EKKO FROM I_EKKO2.

ENDLOOP.

SELECT * FROM EKKO INTO TABLE IT_EKKO.

IF SY-SUBRC = 0.

MESSAGE S003(ZCSMSG).

ENDIF.

WHEN 'FETCH'.

SELECT * FROM EKKO INTO TABLE IT_EKKO UP TO 2000 ROWS.

TC100-LINES = SY-DBCNT.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

endmodule. " USER_COMMAND_0100 INPUT

6.Create Transaction code and execute it.

Reward,if useful.

Thanks,

Chandu