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

Communication between subscreens

Former Member
0 Likes
842

Hi there,

I got a question concerning the communication between subscreens.

Let's say I got a dynpro 9000 which contains 3 subscreens 9001, 9002 and 9003.

Those three are loaded at the PBO of 9000 with

CALL SUBSCREEN sub1 INCLUDING sy-repid '9001'
....

and so on.

When PAI is triggered in 9001 for example, is it possible that only the PBO of 9002 is triggered and not that of 9003? The problem is, that the PBO of dynpro 9000 is triggered again which triggers all subscreen PBO's of course.

How can i solve this?

Thanks in advance!

Regards,

Tobi

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
719

Hi Tobias,

I guess you want to suppress one of the subscreens if certain condition is met, right? For doing so you, do the following:

Create empty screen 9030 which you would switch with 9003 if some condition is fulfilled


"in program 
data: dynnr(4) type n value '9003'. "by default 9003 is displayed

"in program, PAI module
module PAI_9000 input.
if condition = true.
  dynnr = '9030'. "switch your subscreen so it will not be shown (empty will be placed instead)
endif.
endmodule.

"in screen flow logic
PROCESS BEFORE OUTPUT.
   ...
   CALL SUBSCREEN sub1 INCLUDING sy-repid dynnr. "depending on DYNNR content either screen 9003 will be shown or empty 9030
   ...

If, on the other hand, you want to suppress PBO module (only operational statements like setting default values in screen fields) but still show entire 9003 screen, just place your condition in PBO module (in program) of screen 9003.


PROCESS BEFORE OUTPUT.
   CALL SUBSCREEN sub1 INCLUDING sy-repid '9003'  "call PBO of screen 9003

"in program, PBO module
module PBO_9003 output.
check condition = true.
   ...."statements if condition is true, i.e. setting default values on screen
endmodule.

Generally, you can't put any conditional statements in screen flow logic, put you can control its behaviuor using dynamic subscreen assignment as in 1 case.

Regards

Marcin

Hi Tobias,

I guess you want to suppress one of the subscreens if certain condition is met, right? For doing so you, do the following:

Create empty screen 9030 which you would switch with 9003 if some condition is fulfilled


"in program 
data: dynnr(4) type n value '9003'. "by default 9003 is displayed

"in program, PAI module
module PAI_9000 input.
if condition = true.
  dynnr = '9030'. "switch your subscreen so it will not be shown (empty will be placed instead)
endif.
endmodule.

"in screen flow logic
PROCESS BEFORE OUTPUT.
   ...
   CALL SUBSCREEN sub1 INCLUDING sy-repid dynnr. "depending on DYNNR content either screen 9003 will be shown or empty 9030
   ...

If, on the other hand, you want to suppress PBO module (only operational statements like setting default values in screen fields) but still show entire 9003 screen, just place your condition in PBO module (in program) of screen 9003.


PROCESS BEFORE OUTPUT.
   CALL SUBSCREEN sub1 INCLUDING sy-repid '9003'  "call PBO of screen 9003

"in program, PBO module
module PBO_9003 output.
check condition = true.
   ...."statements if condition is true, i.e. setting default values on screen
endmodule.

Generally, you can't put any conditional statements in screen flow logic, put you can control its behaviuor using dynamic subscreen assignment as in 1 case.

Regards

Marcin

4 REPLIES 4
Read only

MarcinPciak
Active Contributor
0 Likes
720

Hi Tobias,

I guess you want to suppress one of the subscreens if certain condition is met, right? For doing so you, do the following:

Create empty screen 9030 which you would switch with 9003 if some condition is fulfilled


"in program 
data: dynnr(4) type n value '9003'. "by default 9003 is displayed

"in program, PAI module
module PAI_9000 input.
if condition = true.
  dynnr = '9030'. "switch your subscreen so it will not be shown (empty will be placed instead)
endif.
endmodule.

"in screen flow logic
PROCESS BEFORE OUTPUT.
   ...
   CALL SUBSCREEN sub1 INCLUDING sy-repid dynnr. "depending on DYNNR content either screen 9003 will be shown or empty 9030
   ...

If, on the other hand, you want to suppress PBO module (only operational statements like setting default values in screen fields) but still show entire 9003 screen, just place your condition in PBO module (in program) of screen 9003.


PROCESS BEFORE OUTPUT.
   CALL SUBSCREEN sub1 INCLUDING sy-repid '9003'  "call PBO of screen 9003

"in program, PBO module
module PBO_9003 output.
check condition = true.
   ...."statements if condition is true, i.e. setting default values on screen
endmodule.

Generally, you can't put any conditional statements in screen flow logic, put you can control its behaviuor using dynamic subscreen assignment as in 1 case.

Regards

Marcin

Read only

Former Member
0 Likes
719

Hi Marcin,

thanks a lot for your answer!

I hoped there would be a possibility to avoid any "refresh flags".

Regards,

Tobi

Read only

Former Member
0 Likes
719

As stated, all PBO occurs in a linear flow - the main screen executes the subscreen PBOs, in turn, for all subscreens in the main PBIO. There may be subscreens of subscreens, etc.

You cannot decide that the PAI of 1st subscreen will affect the PBO of the next subscreens because the process chain isn't PBO->PAI->PBO->PAI, etc.

In practice this doesn't matter, you can still modify the subscreen displays as they are only affected by a) the initial state of the application when the main screen first opens and b) subsequent changes to subscreen1 or whatever your driving event is. Once you trigger a PAI the display will alter if affected by what you did/entered.

Dynpros have runtime compression on by default so if you have a subscreen that is inactive it won't leave a space, e.g. if you had a vertical stack of subscreens 1,2,3 and deactivated no 2, no 3 will move up right underneath no 1.

You could therefore deactivate the subscreen when a certain condition is reached.

In a PBO module of subscreen requiring deactivation, code this:.

IF (condition = true).

LOOP AT SCREEN.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDLOOP

ENDIF.

That deactivates all content of the subscreen and it won't display.

Otherwise rethink the implementation...?

Read only

Former Member
0 Likes
719

Hi,

See DEMO_DYNPRO_TABSTRIP_SERVER this program may hlep u.