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

Error ! No field defined for function Code

Former Member
0 Likes
1,430

Hello ,

I have defined everything correctly but when i try to use the push button to go to next screen this message comes up 'No field defined for function Code' .Please advise .

Thank you ,

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,188

Make sure that you put define the name of the OK_CODE field in your screen. Go to your screen, click on the element list tab. You should have a line which as a TYpe as "OK". Put the name as OK_CODE.

Now in your program.....you need a DATA statement for OK_CODE, and you need to handle the OK_CODE in your PAI of the screen.

data: ok_code type sy-ucomm.



************************************************************************
*      Module  USER_COMMAND_0100  INPUT
************************************************************************
module user_command_0100 input.

  case ok_code.
    when 'BACK' or 'EXIT' or 'CANCEL'.
      clear ok_code
      set screen 0.
      leave screen.
  endcase.

endmodule.

Regards,

RIch Heilman

7 REPLIES 7
Read only

Former Member
0 Likes
1,188

Hi,

Are you using dialog programming?

In the properties of the push-button, enter the function code, and in the PAI event check if sy-comm is equal to your function code then do the further processing.

Regards

Subramanian

Read only

0 Likes
1,188

Yes I am doing Dialog Programming . But still not sure why its not going further to the next screen .

Read only

Former Member
0 Likes
1,188

Hi,

You assigned the Function code correctly and written the code in the PAI module, see there whethe you have writen the correct code, Seems the Function code is empty when you click the pushbutton, so see in the Debugging whethere you are assigend the correct fucntion code or not?

Regards

Sudheer

Read only

Former Member
0 Likes
1,188

Hello,

Assign a function code for the Push button and write the code in the PAI module of the screen.

Regards,

Vasanth

Read only

Former Member
0 Likes
1,188

hi hari,

u must assign the function code to the push button and use that function code in the PAI event of module pool.

Regards...

Arun.

Read only

Former Member
0 Likes
1,188

Hi,

I am not sure of the reason.

Can you please show the code that you have written for handling the sy-ucomm ( generated by functon code ) to go to next screen.

Also, although incorrect function code or absence of function code will not give tis kinda error but still can you just check once if you are handling the correct function code in sy-ucomm. This function code must be defined for the push-button that you are using.

Regards

Nishant

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,189

Make sure that you put define the name of the OK_CODE field in your screen. Go to your screen, click on the element list tab. You should have a line which as a TYpe as "OK". Put the name as OK_CODE.

Now in your program.....you need a DATA statement for OK_CODE, and you need to handle the OK_CODE in your PAI of the screen.

data: ok_code type sy-ucomm.



************************************************************************
*      Module  USER_COMMAND_0100  INPUT
************************************************************************
module user_command_0100 input.

  case ok_code.
    when 'BACK' or 'EXIT' or 'CANCEL'.
      clear ok_code
      set screen 0.
      leave screen.
  endcase.

endmodule.

Regards,

RIch Heilman