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: 

problem in PAI

Former Member
0 Kudos

hello friends,

i need little help,

i have a screen which has two input values,gscreen_exdiv and gscreen_door# as input.

how do i update a ztable in the database, with these fields along with system userid, system date.

can any one please give a step by step approach, presently the development was done till PAI,

when i double click on PAI it takes me to few modules already built. now i have to

write a module that does this job. can any one plz give details of sample code.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You should implement your code into the USER_COMMAND module in the PAI. You should have some kind of button on your screen which is mapped to a function code, when the user presses this button, you need to check for the functon code in this module and do the logic to update your database.

Case ok_code.
   when 'BACK'.
        set screen 0.
        leave screen.
   when 'BUTTON1'.
       clear ok_code.
       data: xztab type ztable.
       xztab-exdiv = gscreen-exdiv.
       xztab-door# = gscreen-door#.
       xztab-uname = sy-uname.
       xztab-datum = sy-datum.
       modify ztab from xztab.
endcase.

Regards,.

Rich Heilman

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You should implement your code into the USER_COMMAND module in the PAI. You should have some kind of button on your screen which is mapped to a function code, when the user presses this button, you need to check for the functon code in this module and do the logic to update your database.

Case ok_code.
   when 'BACK'.
        set screen 0.
        leave screen.
   when 'BUTTON1'.
       clear ok_code.
       data: xztab type ztable.
       xztab-exdiv = gscreen-exdiv.
       xztab-door# = gscreen-door#.
       xztab-uname = sy-uname.
       xztab-datum = sy-datum.
       modify ztab from xztab.
endcase.

Regards,.

Rich Heilman

0 Kudos

thanks rich,

great help.

i will try that and come back to you.

thanks again for your reply.

former_member387317
Active Contributor
0 Kudos

Hi kutumba rao,

You can use your own modules also just write the module name...

eg. module mod1.

now double click on mod1 ..

then choose main progaram and then enter.

now here you can write your own code as your logic says...

for system date you can use sy-datum . you can use other system variables as per your requirement..

in that module you can write like..

case sy-ucomm.

when 'PUSH'. " Function code for the Push Button you had given...

call transaction 'se11'.

when 'EXIT'.

leave program.

-


-


encase.

Hope this will help you..

Regards.

ilesh Nandaniya