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: 

Dialog Prgmming

Former Member
0 Kudos

HiAll,

I need to call a screen from an Include program and call that screens PBO and PAI modules which are in two other different includes.How do I do that ?

This is because if I include the other two includes(one having the PBO and the other having the PAI modules) within the first include and try to compile the program , it gives the following error message -

" Incorrect nesting: Before the statement "MODULE", the structure introduced by "FUNCTION" must be concluded by "ENDFUNCTION" "

Plz help... Thx..

Pradipta

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Are you working on user exits? Your explanation is not clear. Of course, you cannot include the INCLUDE statements in your include because of incorrect nesting. This is what is happening.

FUNCTION XYZ.

INCLUDE MYINCLUDE.

ENDFUNCTION.

Now assume I put two more include statements in MYINCLUDE as follows.

INCLUDE PAIINCLUDE. (containing several MODULE... ENDMODULE statements and may be FORM .... ENDFORM also)

INCLUDE PBOINCLUDE.(containing several MODULE... ENDMODULE statements and may be FORM .... ENDFORM also)

So my function module code when expaneded all the way down, looks like this

FUNCTION XYZ.

MODULE FIRSTPBOMODULE.

ENDMODULE.

MODULE SECONDPBOMODULE.

ENDMODULE.

....

,...

FORM SOMEFORM.

ENFORM.

....

...

MODULE SOMEPAIMODULE.

ENDMODULE.

..

..

ENDFUNCTION.

This nesting is not allowed.

What do you want to do? What is this screen that you want to call? Is there a transaction associated with it? Is it a screen attached to the main program of your function module?

Srinivas

11 REPLIES 11

naimesh_patel
Active Contributor
0 Kudos

Hello Pradipta,

Put your Include statements in the program from which you are calling the screen or in the main program.

Regards,

Naimesh

Former Member
0 Kudos

"I need to call a screen from an Include program " ... is the screen mentioned here part of a custom program?

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The includes should be included in the main program of the function group or places after the ENDFUNCTION statement of the function module. Really the PAI and PBO modules should have been placed in an INCLUDE of the function group, using the function groups naming convention.

REgards,

Rich Heilman

Former Member
0 Kudos

Are you working on user exits? Your explanation is not clear. Of course, you cannot include the INCLUDE statements in your include because of incorrect nesting. This is what is happening.

FUNCTION XYZ.

INCLUDE MYINCLUDE.

ENDFUNCTION.

Now assume I put two more include statements in MYINCLUDE as follows.

INCLUDE PAIINCLUDE. (containing several MODULE... ENDMODULE statements and may be FORM .... ENDFORM also)

INCLUDE PBOINCLUDE.(containing several MODULE... ENDMODULE statements and may be FORM .... ENDFORM also)

So my function module code when expaneded all the way down, looks like this

FUNCTION XYZ.

MODULE FIRSTPBOMODULE.

ENDMODULE.

MODULE SECONDPBOMODULE.

ENDMODULE.

....

,...

FORM SOMEFORM.

ENFORM.

....

...

MODULE SOMEPAIMODULE.

ENDMODULE.

..

..

ENDFUNCTION.

This nesting is not allowed.

What do you want to do? What is this screen that you want to call? Is there a transaction associated with it? Is it a screen attached to the main program of your function module?

Srinivas

0 Kudos

Yes I am working on an User Exit(Screen Exit).The name of the exit is 'IWO10018'. Over there I have created a screen 900(as there in the exit) and I have to write the PBO and the PAI in two includes and link them up with the the include(ZXWOCU15) in FM EXIT_SAPLCOIH_018. I have called the screen from the Include ZXWOCU15.

What do I do next , Kindly guide me ??

Thx..

0 Kudos

Go into the main program of the user exit EXIT_SAPLCOIH_018 which is SAPLXWOC. In there, you will see an include ZXWOCZZZ. This is meant for your PAI and PBO modules. Since you already created two includes, all you need to do is, double click on this ZXWOCZZZ include. It will ask if you want to create it. Say yes and create it. Once created, add your two includes in this one. You should be good to go.

0 Kudos

Hello Pradipta,

You can also create one FM, and in that FM you can call your screen. In FM, you can put your all code in different includes.

Regards,

Naimesh

0 Kudos

Hi Srinivas,

Thanks for the inputs ... The concept stated above is working.I am being able to go to the enhancement screen of the extra tab on the t-code iw32.When I am clicking on the tab named 'Enhancemnt',it is displaying the screen which I have created .This is fine .

But once I press the back button(the ones configured in PF-Status),it comes back to the screen of the t-code iw32.It shows the 'Enhancemnt' tab along with the other tabs(HeaderData,Operations,Components,etc).But the enhancement tab(sub-screen) is showing empty in this case and an error mssg is also displayed -> " Screen SAPLXWOC 0900 must be an Include Screen(screen error) " .

Plz help ...

Thx...........

0 Kudos

Hi Pradipta,

Do you still have a problem? If so, can you please let me know your requirement(what you want to achieve using this enhancement)?

As far as I can see, you should not need any separate pf-status. How did you create the screen 0900? Looks like you created it as a normal screen. It needs to be a subscreen. Go to SE51 and change the attributes of the screen to a subscreen and see if that solves. Comment out the pf-status code.

Former Member
0 Kudos

Hi Pradipta,

Correct me if I am wrong: - The enhancement is done for a tab. In a tab why do we need a PF-STATUS?

If it is a pop-up or standalone screen in that case we may need the PF-STATUS. But since this is the enhancement to a standard transaction, you can safely remove the PF-STATUS if not required.

If you need PF-STATUS then you can create a function module and from within the function module you can call the screen. In that PBO you can write the PF-STATUS.

Regards,

Sameena

0 Kudos

Hi Sameena,

Thnx for the answer ... but it is not working ... if I remoce the PF- Status , then the back buttons / or the other buttons will not work ... this is because I have created a new screen , and I need to define the pf-status for it ....

plz help ..