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: 

Error in module pool

Former Member
0 Kudos

Hai,

I have created one main screen & calling a sub screen from there.in the subscreen I have created a push button with function code. the corresponding OK_CODE is defined in the main screen.

The problem is if I click on the pushbutton the error message'Invalid field format (screen error)' is been displayed. If I remove the function code the error is not coming.

Can any one tell what is the problem here?

Thanks & Regards,

Bhaskar.

1 ACCEPTED SOLUTION

0 Kudos

Hi Bhaskar,

Declare all the input fields you are using in the main screen or subscreen as global fields in the program with same data type and length.

Edited by: venugopal katikam on May 4, 2009 11:03 AM

10 REPLIES 10

Former Member
0 Kudos

What is the OK-CODE which you have given for the pushbutton?

0 Kudos

Hai Anil,

it is just some text like 'DISP'.we can give anything here.

Regards,

Bhaskar.

0 Kudos

Try to declare the OKCODE in the TOP include also so that it can be globally accessed.

DATA OKCODE TYPE sy-ucomm.

Regards,

Anil

Former Member
0 Kudos

Hi,

Declare this globaly so that the main screen as well as ur

subscreen wil able to acess the variable and the error wont ciome.

DATA OK_CODE TYPE sy-ucomm.

Regards

Former Member
0 Kudos

Hi,

try to create the push button in the main screen not in the sub screen.

and declare the varibale in TOP of type sy-ucomm.

regards

Rajesh Kumar

Former Member
0 Kudos

Hi,

Please check whether you have declared push button globally in module pool program. If you have decalared already check the data type. In module pool screen field data type and decalaration data type both should be the same.

Hope its helps

Former Member
0 Kudos

Please find here the restrictions related to subscreen. Hope this may help you to trace-out reason for your problem.

1. GUI status cannot be set to the sub screen.

2. OKCODE is not applicable to the sub screen.

3. It cannot contain AT EXIT-COMMAND.

4. Function codes linked to user actions on subscreens are placed in the OK_CODE field of the main screen. (If you add a pushbutton on a subscreen, and assign a function code to it there, you should be able to pick up this in your "module dnnnn_user_command" logic within the PBO of the main screen.)

5.The flow logic of a subscreen screen may not contain any dialog modules containing the statements SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN. Any of these statements causes a runtime error.

6. You cannot change the GUI status of a main screen in a subscreen screen.

Regards

Former Member
0 Kudos

Hi ,

There is no need to define ok code in the main screen i think, as you already defined the function code for the push button in the sub screen.

0 Kudos

Hi Bhaskar,

Declare all the input fields you are using in the main screen or subscreen as global fields in the program with same data type and length.

Edited by: venugopal katikam on May 4, 2009 11:03 AM

digvijay_rai
Participant
0 Kudos

The problem is if I click on the pushbutton the error message'Invalid field format (screen error)' is been displayed. If I remove the function code the error is not coming.

hi ,

Perhaps problem is not bcoz of ur push button instead bcoz of I/P O/P texfield in which ur

getting some value or entering any value change the data type of that text field in char

you won't get any error .

Regrds

Digvijay Rai