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

Question on Module Pool

Former Member
0 Likes
1,120

Hi,

Please have a look at the below code. The below code is taken from an example in ABAPDOCU.

1) I have created a program Z_MP1 of type Module Pool in SE38.

2) In SE51, i have defined the layout, attributes and the flow logic.

3) In SE 93, i have created a custom transaction Z_MP1.

Question - When i try to check(Ctrl+F2) the below code in SE38, i get an error as below.

"Program Z_MP1

Statement is not accessible"

What is the problem and how to solve this?

&----


*& Module pool Z_MP1 *

*& *

&----


*& *

*& *

&----


PROGRAM Z_MP1 .

DATA: input TYPE i,

output TYPE i,

radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,

box1(1) TYPE c, box2(1) TYPE c, box3(1) TYPE c, exit(1) TYPE c.

CALL SCREEN 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module STATUS_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

CLEAR input.

radio1 = 'X'.

CLEAR: radio2, radio3.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

output = input.

box1 = radio1.

box2 = radio2.

box3 = radio3.

IF exit NE space.

LEAVE PROGRAM.

ENDIF.

endmodule. " USER_COMMAND_0100 INPUT

Thanks in Advance,

Vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,079

Hi,

These 3 steps will solve your problem.

Select Program type as module pool in program attributes.

Dont call the screen.

Assign the screen number to the transction.

Regards,

Richa

9 REPLIES 9
Read only

Former Member
0 Likes
1,079

Hi,

Instead of CTRL + F2..Do CTRL + F7..

Which will check the syntax in the main program..

Thanks

Naren

Read only

0 Likes
1,079

Hi Naren,

I still get the same error even after using CTRL+F7 in the main program.

Error - Program Z_MP1

Statement is not accessible.

Thanks,

Vijay

Read only

Former Member
0 Likes
1,079

Hi Vijay,

Why not go to SE80, say program, give the program name, double click on the program name and check syntax.

Is that what is required?

Regs,

Sameer

Read only

Former Member
0 Likes
1,079

Hi,

Try to activate the program..By pressing CTRL+ F3..

OR

Go to SE80..choose the program and give the program name..

Now right click and activate the main program..

Also for module pool program you don't have to call the initial screen..

<b>CALL SCREEN 100.</b>

Instead create a transaction code in SE93 with the module pool program and screen number..

Then execute the transaction code..

Thanks

Naren

Read only

Former Member
0 Likes
1,080

Hi,

These 3 steps will solve your problem.

Select Program type as module pool in program attributes.

Dont call the screen.

Assign the screen number to the transction.

Regards,

Richa

Read only

0 Likes
1,079

Hi,

After following your instructions, the error got resolved and also the output is displayed.

Now the problem is:-

When the output is displayed i.e screen 100 -

<b>Radio Button 1 should be enabled and Radio Button 2, Radio Button 3 should be disabled.</b> See the PBO part. <b>However all the 3 Radio Buttons are enabled in the output initially.</b>

After entering the input, when i press the enter key -

input field clears(working properly),

value in the input field appears in the output field(working properly),

<b>Only Check Box 1 should be enabled(I see all the 3 Check boxes enabled).</b>

How do i solve this?

Thanks in Advance,

Vijay

Read only

Former Member
0 Likes
1,079

Hi,

After following some of your instructions, the error got resolved and also the output is displayed.

Now the problem is:-

When the output is displayed i.e screen 100 -

Radio Button 1 should be enabled and Radio Button 2, Radio Button 3 should be disabled. See the PBO part. However all the 3 Radio Buttons are enabled in the output initially.

After entering the input, when i press the enter key -

input field clears(working properly),

value in the input field appears in the output field(working properly),

Only Check Box 1 should be enabled(I see all the 3 Check boxes enabled).

How do i solve this?

Thanks in Advance,

Vijay

Read only

0 Likes
1,079

U have to group the radio buttons by using menu option EDIT->GROUPING-> RADIOBUTTON GROUPING->DEFINE.

give the function code to radio button.

so if u group the radio buttons then by default only one will be selected.

Regards,

amal

Read only

0 Likes
1,079

define radio button 2 and 3 in a group

and then in PBO

add this code

loop at screen.

if screen-group1 = 'GR1'.

screen-active = c_off.

endif.

modify screen.

endloop.