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

Calling Screen in nested Module Pool Program

jibin_joy
Contributor
0 Likes
2,583

Hi ,

  Suppose i have two Module Pool Program

   

    Program1

       Screen 100  - Normal Screen

   Program2

      Screen 100  - Subscreen screen

      Screen 101  - Model Dialog Box

      Screen 102  - Normal Screen

  Using  T-Code ZTCODE  , Program1 screen 100 is executed . Screen 100 Contain Tab strip functionality where i am calling  Program2 subscreen 100. Now Program2 subscreen 100 contain a button by which i like to call "Dialog box Program2 screen 101" or "Normal Screen

Program2 screen 102" . But here it throws an error

                         "   The system attempted to use dynpro 0101 in program "Program1".

                              This dynpro does not exist."

  It is working fine if i am calling Program2 Directly .

Regards,

Jibin Joy       

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,945

You can create a separate transaction of program2 and call the transaction in program1.

If you need shared data you can create that using function group and call the function for sending and receiveing data.

10 REPLIES 10
Read only

Former Member
0 Likes
1,947

You can create a separate transaction of program2 and call the transaction in program1.

If you need shared data you can create that using function group and call the function for sending and receiveing data.

Read only

0 Likes
1,945

Hi Mohammed ,

  Thanks For reply

      1.  Program1 Contain Tab strip so within one tab i like to call Program2 using subscreen .

But if i have separate transaction of program2 and call the transaction in program1 it will replace the whole screen .

     2.  This Functionality work well in function group but i cannt change the program2 to function group right now this is our last choice  .

Can i know y this error is raised .

Thanks in Advance

Regards,

Jibin Joy 

Read only

0 Likes
1,945

Hi,

Here is the explaination to the error with reference from SAP HELP

The statement CALL SCREEN accesses the dynpros of the relevantmain program of the currentprogram group and these use the global data and dialog modules of the main program. Except when calling a dynpro in an externally called subroutine, the main program usually is the current program. If the specified dynpro does not exist in the main program of the program group, an untreatable exception occurs.

For more details

http://help.sap.com/abapdocu_702/en/abapcall_screen.htm

Read only

0 Likes
1,945

Hi Mohammed ,

  Thanks For Putting Effort on this ....

   "If the specified subscreen dynpro is not defined in the current ABAP program, the specified program is loaded into internal mode, whereby LOAD-OF-PROGRAM is triggerred. If this is a function group, a new additional program group is formed. In the case of executable programs and module pools, the program is loaded into the program group of the current program.

"

http://help.sap.com/abapdocu_702/en/dynpcall.htm

    So based on my observation it should find the dynpro in current Program Group since Program2 will also be added once subscreen is called for that the program .

And Ref

http://help.sap.com/abapdocu_70/en/ABENINTERNAL_SESSION.htm

Thanks in Advance

Regards,

Jibin Joy

Read only

0 Likes
1,945

Hi Jibin,

The answer to your question is in the link provided by you....

Only the dynpros of the main program of a program group can be called using CALL SCREEN. After an internal session is loaded, these are the dynpros of the main program of the main program group. The main programs (function groups) of additional program groups can also call their own dynpros.

The SUB-Screen call though the program will be loaded... but all call screen statements will correspond only to your main loaded program.

I hope this helps.....

Read only

0 Likes
1,945

Hi,

  Thanks ...

I got confused previously.....

Regards,

Jibin Joy

Read only

Former Member
0 Likes
1,945

try using this in the PBO and PAI of the main program.

  

PROCESS BEFORE OUTPUT.
  ...
  CALL SUBSCREEN: <area1> INCLUDING [<prog 1>] <dynp 1>,
                  <area2> INCLUDING [<prog 2>] <dynp 2>,
                  <area3> INCLUDING [<prog 3>] <dynp 3>,
                  ...
  ...

PROCESS AFTER INPUT.
  ...
  CALL SUBSCREEN: <area1>,
                  <area2>,
                  <area3>,
                  ...
  ...

Read only

0 Likes
1,945

Hi Susmitha ,

Thanks For response

        I am able to call Program2 From Program1 using call subscreen statement . The problem comes when i am trying to call any other screen within Program2 .

Thanks in advance,

Regards

Jibin Joy

Read only

0 Likes
1,945

Two options.

Option 1.

You can create a function module, and write the call screen in that function module.

Then call this function module to display the other screens.

Option 2.

Copy the entire program2 into an include pgm. Eg INC_PGM2.

Then insert the include statement include INC_PGM2 in both the programs. (You may need to give unique screen numbers though)

Read only

0 Likes
1,945

Hi Susmitha ,

   For Option 1 :

                  i cannt change the program2 to function group right now this is our last choice  .

   For Option 2 :

                 I dont think so it is possible in my scenario. It is going to be used in  lot of place . 

Can i know y this error is raised .

Thanks in Advance

Regards,

Jibin Joy