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

LOOP AT screen Error

Former Member
0 Likes
2,311

Hello, I created a Module Pool which has two screens. On the first screen there are some radio buttons, and depending on which one you select, another row of radio buttons appear. The way I do that is by using a LOOP AT screen which sets the screen-input and screen-invisible to 1 or 0 depending on the selection. It has been working fine up until now. I made a change to the file, and when I tried to activate it I get this Syntax error:

"The type of "SCREEN" must be compatible with the type(s) of "SCREEN""

I tried removing the change I made, but now the error keeps appearing. Below is the code I have for this part:

MODULE STATUS_0101 OUTPUT.

SET PF-STATUS '0101_STATUS'.

SET TITLEBAR 'TITLE'.

LOOP AT screen.

IF screen-name = 'LINEAR' OR screen-name = 'NONLINEAR'.

screen-input = INP.

screen-invisible = INV.

modify screen.

ENDIF.

ENDLOOP.

ENDMODULE. " STATUS_0101 OUTPUT

Both of the screens that I have in my program are "Normal" with none of the settings selected. I tried to say activate anyway, but when I try to run the program I get a runtime error. If it's any help, this is what the internal notes say:

The termination was triggered in function "ab_genprog"

of the SAP kernel, in line 1585 of the module

"//bas/701_REL/src/krn/runt/abgen.c#8".

The internal operation just processed is " ".

Internal mode was started at 20110928143655.

Program name.........: "ZPPD0102 ".

Error message........: "The type of "SCREEN" must be compatible with the

type(s) of "SCREEN"".

I even tried creating a new Module Pool from scratch, and it gives me the error. I'm hoping someone can help me figure out the problem here. Thank you in advance for any help/suggestions you can provide me with.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,002

Hi Franco,

You have a redefinition of the type SCREEN somewhere in your code I guess...

If this is the case, just remove it!

Kr,

m.

6 REPLIES 6
Read only

Former Member
0 Likes
2,002

Hi Franco - welcome to SDN.

Are both INP and INV defined as char(1)

Rob

Read only

0 Likes
2,002

And are you passing 0 or 1 in these variables?

Rob

Read only

Former Member
0 Likes
2,003

Hi Franco,

You have a redefinition of the type SCREEN somewhere in your code I guess...

If this is the case, just remove it!

Kr,

m.

Read only

0 Likes
2,002

That was absolutely right, thanks for your help. Just out of curiosity, how did you know that with the error I provided? It was't very descriptive, so I'm surprised you were able to get that without seeing the rest of my code. Again, thank you very very miuch for your help. Also, this is my very first ABAP program, so please excuse my ignorance.

Read only

0 Likes
2,002

well "The type of "SCREEN" must be compatible with the type(s) of "SCREEN"

seemed totally clear to me after reading it a couple of times...

cheers,

m.

Read only

Former Member
0 Likes
2,002

i am developing a On-Line examination system in ABAP , i have made a screens using screen painter . In this there is main screen which is having a  START button . when a user click START button , Examination starts and sub screen of question number 1 comes , here problem is when a user click on START button second time (during the examination) this again shows question No. 1 , i want when user Click start Button first time it will be Disable / hide.

* some detail of screens are below..

main screen --> START button , when user click on START button this shows sub-screen of question number 1.

sub-screen -->  i gave same name to sub-screen and calling them with screen numbers .

thank you !