03-16-2007 1:02 PM
hi experts,
i have to update the database table created by me,,i hv to insert multiple rows in it ,i m using table controls in module pool with insert button ,cud u plz send me the code n logic...as i m new to module pool ,,plz help me..
03-16-2007 1:09 PM
Hi,
It's not that easy for you even if I send some code to you. Because on the screens, what elements are there, and what modules you wrote on PAI and PBO, don't know.
But in PAI based on the Function codes, by handling the OK_codes you have to write the code:
Case OK_code.
when 'UPDT'.
you will be having data in the internal table related to table control.
After modifications, you can update the db table with that internal table.
Insert <dbtable> from ITAB....
sample piece of code:
REPORT ZBHMOD1 .
DATA:OKCODE1 LIKE SY-UCOMM,
OKCODE2 LIKE SY-UCOMM.
DATA:N1(10) TYPE N,N2(10) TYPE N,RES(12) TYPE N.
MODULE USER_COMMAND_1000 INPUT.
CASE OKCODE1.
WHEN 'NEXT'.
RES = N1 + N2.
SET SCREEN 1001.
WHEN 'CLEA'.
CLEAR:N1,N2.
WHEN 'BACK'.
SET SCREEN '0'.
ENDCASE.
ENDMODULE. " USER_COMMAND_1000 INPUT
MODULE STATUS_1000 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'TIT1'.
ENDMODULE. " STATUS_1000 OUTPUT
MODULE USER_COMMAND_1001 INPUT.
CASE OKCODE2.
WHEN 'BACK'.
SET SCREEN 1000.
ENDCASE.
ENDMODULE. " USER_COMMAND_1001 INPUT
MODULE STATUS_1001 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'TIT2'.
ENDMODULE. " STATUS_1001 OUTPUT
FLOW LOGIC:
PROCESS BEFORE OUTPUT.
MODULE STATUS_1000.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1000.
PROCESS BEFORE OUTPUT.
MODULE STATUS_1001.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1001.
Reward if useful.
Regards,
Anji
Message was edited by:
Anji Reddy Vangala
03-16-2007 1:30 PM
Mr Reddy,
Try and get your own logic and post it.Do not copy from other posts.
please be honest and dont act toooo smart to get points.
Prajith
03-16-2007 1:10 PM
hi Ravi,
Check out these sample programs
RSDEMO_TABLE_CONTROL
DEMO_DYNPRO_TABLE_CONTROL_1
DEMO_DYNPRO_TABLE_CONTROL_2
RSDEMO_TABLE_CONTROL
RSDEMO02
Regards,
Santosh
03-16-2007 1:10 PM
i think whatever the changes made in the tab ctrl they are all reflected in the internal table also as in grid display.if it is so u can modify easily.
check that first.
regards,
bharat.