‎2008 Jan 04 6:07 AM
hello friends,
I need to create a module pool program where the screen was field with fields from a ztable. and know my requirement is when i give the entries and click the update button then the ztable has to get updated.
If anyone knows how to do it please help me. and also provide me example if you can.
thanks and regards
vamshi sreerangam
‎2008 Jan 04 6:15 AM
Hi Vamshi,
write the code like below in your PAI event.
&----
*& Module USER_COMMAND_0210 INPUT
&----
text
----
module USER_COMMAND_0210 input.
OKCODE = SY-UCOMM.
CLEAR SY-UCOMM.
CASE OKCODE.
WHEN 'BACK'.
LEAVE TO SCREEN 200.
WHEN 'UPDATE'.
UPDATE ZSTUDINFO1 FROM TABLE ITAB1.
IF SY-SUBRC EQ 0.
COMMIT WORK AND WAIT.
MESSAGE I999 WITH 'UPDATION COMPLETED'.
LEAVE TO SCREEN 100.
ENDIF.
ENDCASE.
endmodule. " USER_COMMAND_0210 INPUT
Thanks,
Muralik
‎2008 Jan 04 6:16 AM
HI
Vamshi
what u do is first design a screen with table control with the same structure of the ztable in the databse and then u enter those records u want to update and then in the PAI of the screen write one module such tht u will get all the entered values into the internal table by looping tht table u can modify the exiasting records by using UPDATE keyword see u can upadate only non key fields if u want to update key fields u cant please keep this in mind ok
plzz reward if i am usefull to u
for any furthere quiries uy can contact me on mutyalasunilkumar@gmail.com
plzz dont forget to reward......
‎2008 Jan 04 6:19 AM
Hi,
The following link will be useful to you.
http://www.esnips.com/doc/f15b749d-0a58-4dd1-824e-dc0776cf0bd0/module-pool
Regards
Vadi
‎2008 Jan 04 6:23 AM
hi
PROGRAM YVTRANS.
TABLES : ZEMP.
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
module USER_COMMAND_0100 input.
case sy-ucomm.
when 'INSERT'.
insert zemp.
if sy-subrc <> 0.
message i000(0) with 'record not inserted'.
else.
message i000(0) with 'record inserted'.
endif.
when 'EXIT'.
leave program.
endcase.
endmodule. " USER_COMMAND_0100 INPUT
Regards
Nagesh.Paruchuri
‎2008 Jan 04 7:32 AM
Hi,
In the module pool write the code.
In top include:
tables:
<your ztable>.
In PAI:
when your push button for the purpose of update
case sy-ucomm.
when 'UPDATE'.
update <your ztable>.
endcase.
This will work.
Regards,
Renjith Michael.