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

Push Button in module pool.

Former Member
0 Likes
3,570

Hi Gurus,

I have created a screen and i have some buttons in the screen which are meant to call other transactions.

i used the following code in PAI:

case 'ok_code'.

WHEN 'BACK' OR 'CANC'.

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'SAVE'.

CLEAR ok_code.

WHEN 'BUTTON1'.

CALL TRANSACTION 'SE38'.

WHEN 'BUTTON2'.

CALL TRANSACTION 'SE11'.

WHEN OTHERS.

CLEAR ok_code.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE.

It does not work.

Regards,

Sukumar.

Message was edited by:

sukumar kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,736

Hi,

Try using case sy-ucomm.

Regards,

keerthi

10 REPLIES 10
Read only

Former Member
0 Likes
1,737

Hi,

Try using case sy-ucomm.

Regards,

keerthi

Read only

0 Likes
1,736

I have already declared ok_code.

DATA: ok_code TYPE sy-ucomm.

Regards,

Sukumar.

Read only

0 Likes
1,736

Hi Sukumar,

Did you declare the OK_CODE in the Module Pool? It should be declared in the Element list for ok.

Srini.

Read only

Former Member
0 Likes
1,736

Hi,

Make sure you have given OK_CODE in the element list..

Meaning..If you go the element list of the screen..

At the end you a row which of type OK..Give OK_CODE in the name column for the corresponding row..

Then in the PAI..have the following code..

case <b>OK_CODE</b>.

WHEN 'BACK' OR 'CANC'.

Thanks,

Naren

Read only

0 Likes
1,736

Hi,

Guess i know what iam missing. I have to declare the custom buttons in the screen area, where do i do that.

Regards,

Sukumar.

Read only

0 Likes
1,736

there is small error in your program given sukumar...do give the OK_CODE in the single quote...you had mentioned CASE 'ok_code' this is wrong CASE ok_code.

Try this it must work if everthing is declared well...

Srini.

Read only

0 Likes
1,736

do not give give in single quote...

Read only

0 Likes
1,736

I guess i solved the problem. Since i had worked less on module pool. I had to give a function code for the buttons.

Thanks for the replies

Regards,

Sukumar.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,736

Assumed Solved.

Rich Heilman

Read only

Former Member
0 Likes
1,736

I was able to solve it.