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

Button is not generating Function COde

Former Member
0 Likes
896

hellow Sirs.

i m creating a module pool , for that i have got a screen and there are 2 buttons. for Confirmation and one for selection..

but when i m using them in my Code. it is not Generating any code .

so they are not workin.

please provide any solution nd if possible provide an example how it is using!!

thanking you

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
832

Hi,

While providing attributes for buttons we have to maintain function code field in attributes and while writing code we have to mention that function code under that we will write respective code.

for example if you maintain button conform in layout.for that if u had given function code as conform then in flowlogic we have to write like this

case sy-ucomm.

when 'conform'.

/respective logic/

endcase.

Regards,

Swetha

5 REPLIES 5
Read only

Former Member
0 Likes
833

Hi,

While providing attributes for buttons we have to maintain function code field in attributes and while writing code we have to mention that function code under that we will write respective code.

for example if you maintain button conform in layout.for that if u had given function code as conform then in flowlogic we have to write like this

case sy-ucomm.

when 'conform'.

/respective logic/

endcase.

Regards,

Swetha

Read only

prasanth_kasturi
Active Contributor
0 Likes
832

once check your code

either you have given the fct code in small letter between the quotes in pai event

or the fct code you provided in the screen painter is different remove the unecessary blanks etc

regards

prasanth

Read only

Former Member
0 Likes
832

Hi,

1. Check your code

2. You might have given the fct code in small letter between the quotes in pai event

3. The fct code you provided in the screen painter is different remove the unecessary blanks etc

Reward if Helpful.

Jagadish

Read only

Former Member
0 Likes
832

Hi,

There may be 2 problems. One you have not set Function code in the Psh button attributes. Please check the screen field attributes. If that is fine, Check if you have given a OKCODE in your screen. There will be an entry in your screen element list without a name. you have to give a name to this field. Then you have to write your logic in the PAI.

For example the push button FCODE is 'SUBMIT'. screen okcode name is W_OKCODE.

You have declare a variable in your main program DATA: w_okcode TYPE sy-ucomm.

Now in PAI MODULE USER_COMMAND,

case w_okcode.

when 'SUBMIT'.

< Action to be performed>

when others.

<Action........>

endcase.

This should solve your problem.

Reward points if helpful.

Thanks and Regards,

Lakshmi.

Read only

Former Member
0 Likes
832

Hi,

Check the function code used in attributes is exactly same as the one which u used in ur code also. Give OK_CODE in the element list also.

When u add a button in ur screeen n by maitaining fct code, it'll not generate any code by itself but u'v to code it in case sy-ucomm.

i.e...

case sy-ucomm.

when 'CONFORM'

.........................

when 'SUBMIT'

.......................

reward if helpful,

Iyswarya