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 program to update a ztable

Former Member
0 Likes
2,403

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

5 REPLIES 5
Read only

Former Member
0 Likes
963

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

Read only

Former Member
0 Likes
963

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......

Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
963

Hi,

The following link will be useful to you.

http://www.esnips.com/doc/f15b749d-0a58-4dd1-824e-dc0776cf0bd0/module-pool

Regards

Vadi

Read only

paruchuri_nagesh
Active Contributor
0 Likes
963

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

Read only

Former Member
0 Likes
963

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.