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: 

Why is subscreen is not shown when program is called by transaction

Former Member
0 Kudos

Hi all,

I programmed a screen with a subscreen. On this subscreen a message protocol is kept.

Whenever I start the program in the workbench via F8 functionallity the subscreen's content is shown as it should. However, if I start this process via the program's transaction the subscreen is not displayed at all.

Can anybody help me on that? Why is there a difference between calls by transaction and calls out of the workbench?

Cheers mates,

Thomas

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ralf, hi Jonathan,

thanks for your answers.

The structure of the REPORT (executable program - now I know) is as follows:

REPORT xyz.

TYPES: ...

DATA: ...

PERFORM subroutine. " within this subroutine "call screen 0100" is placed

  • call screen 0100 " this was the position before

INCLUDE abz. "inside this include the subroutine is situated

MODULE user_command_0100 INPUT.

  • PAI

...

CASE ok_code.

...

WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

...

MODULE status_0100 OUTPUT.

  • PBO

--> I put START-OF-SELECTION in front of "PERFORM subroutine" --> No change. Subroutine was not called.

--> I put LOAD-OF-PROGRAM in front of "PERFORM subroutine" --> The subroutine was called, when calling the program via TCODE. However, when pushing the BACK button LEAVE PROGRAM is called in PAI module and I get a short dump "Illegal interruption of the event LOAD-OF-PROGRAM".

To me it seems that load-of-program is the better choice. But when does that block end? Or should something else than LEAVE PROGRAM. be used to exit the program?

Thanks many times.

Regards,

Thomas

10 REPLIES 10

Former Member
0 Kudos

I can't think of why there should be any difference unless you code for one e.g. I've had module pools which support both display and update depending on which Tcode invoked them, but that's obvious in the code. So I'd suggest a breakpoint in the first PBO logic of the dynpro that is invoked from the TCode and step through from there as to why the subscreen contents are not appearing in the main dynpro.

Jonathan

0 Kudos

hi Jonathan,

htanks for your answer.

I put a break-point at the call of screen 100 at I found out that it is not processed, wenn program is called via transaktion. Screen 100 is beeing called in main program where the data declarations is being made. But wouldn't that mean, that the data should not be declared, as well? i am confused...

Does this Information help you to help me?

Thanks,

Thomas

0 Kudos

OK, I'm a bit confused... in a "classic" module program you would normally have a structure of program includes something like this:

SAPMZMYPROG   "main program that has include statements for following
  MZMYPROGTOP "where global data definitions are made
  MZMYPROGO01 "for PBO modules
  MZMYPROGI01 "for PAI module
  MZMYPROGF01 "for forms / subroutines

{clearly they can get a lot more complex!)... and when you view SAPMZMYPROG in SE80 you'd also be able to see the screen definitions and PF status, titlebar etc. You'll also see transactions that you have defined that point to a screen in the module pool.

However you can also define the same overall structure within one report program, as per the code example:

{I wouldn't normally code them as reports, but for SDN it's easier}... in the report style, then SAP comes in through the usual events and so a "call screen" is required in the start of selection... however when you code the "classic" style (as above) then you should come straight into the PBO for the screen defined on the Tcode.

So how have you structured your code?

Jonathan

Former Member
0 Kudos

hi,

is it a modul pool or a report?

then check the program events...when do you call the subscreen ?

LOAD-OF-Program, initialization etc.

0 Kudos

Hi Ralf,

It`s a modul pool - i guess. there are no events appart from PAI and PBO.

Main screen is called in main program and the subscreen is beeing called in the PBO of the main screen.

Cheers,

Thomas

0 Kudos

hi,

goto "GOTO->Attributes" to check the type of your program.

if you can execute the program out of the workbench it is not a modul program!

check also the screen number in die Attributes of the transaction.

LOAD-OF-PROGRAM.

This event keyword defines an event block whose event is triggered by the ABAP-runtime environment when an executable program, a module pool, a function group or a sub-routine pool is loaded in the internal session.

The event LOAD-Of-PROGRAM should mainly be used to initialize global data when calling external procedures or Transactions.

The transaction code of a dialog transaction is linked to a screen of an ABAP program. When the transaction is called, the respective program is loaded and the screen is called after the event LOAD-OF-PROGRAM.

Former Member
0 Kudos

Hi Ralf, hi Jonathan,

thanks for your answers.

The structure of the REPORT (executable program - now I know) is as follows:

REPORT xyz.

TYPES: ...

DATA: ...

PERFORM subroutine. " within this subroutine "call screen 0100" is placed

  • call screen 0100 " this was the position before

INCLUDE abz. "inside this include the subroutine is situated

MODULE user_command_0100 INPUT.

  • PAI

...

CASE ok_code.

...

WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

...

MODULE status_0100 OUTPUT.

  • PBO

--> I put START-OF-SELECTION in front of "PERFORM subroutine" --> No change. Subroutine was not called.

--> I put LOAD-OF-PROGRAM in front of "PERFORM subroutine" --> The subroutine was called, when calling the program via TCODE. However, when pushing the BACK button LEAVE PROGRAM is called in PAI module and I get a short dump "Illegal interruption of the event LOAD-OF-PROGRAM".

To me it seems that load-of-program is the better choice. But when does that block end? Or should something else than LEAVE PROGRAM. be used to exit the program?

Thanks many times.

Regards,

Thomas

0 Kudos

It should not be this tricky... I suspect now that your transaction code isn't set up correctly... try creating a new one (or delete old and re-create) and make sure it is a Report type one that points to your program and the usual value of screen "1000" (not 100 - you'll call that one yourself in the code), and then put the start-of-selection line back so your code is like:

report z_xyz.

data:
...

start-of-selection.
  perform call_screen. "where your call screen '0100' is

the rest...

Jonathan

0 Kudos

Thanks a lot, Jonathan.

That really did solve the prolem. I gotta say, that I did not create that tcode myself, so I wasn't aware what type of program was choosen in the beginning.

So, thanks again - I grew a little smarter today.

Cheers,

Thomas

Former Member
0 Kudos

see in thread