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: 

call subscreen

former_member581430
Participant
0 Kudos

Hi everybody

Ive created 2 subscreens on a screen and based on a condition im calling the subsreen

but sometimes a subscreen is appearing twice on the screen

PROCESS BEFORE OUTPUT.

MODULE get_ebeln .

MODULE get_ebeln OUTPUT.

IF ww_ekorg = wk_ekorg.

w_dynr = wk_9100.

ELSE.

w_dynr = wk_9399.

ENDIF.

endmodule.

then on the PBO

CALL SUBSCREEN subscreen_9399 INCLUDING sy-repid W_DYNR.

CALL SUBSCREEN SUBSCREEN_9100 INCLUDING sy-repid w_dynr.

and on the PAI

CALL SUBSCREEN subscreen_9399.

CALL SUBSCREEN SUBSCREEN_9100.

i was wondering if i wrote the proper code

can anybody help me on that?

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

It is simply because you have two subscreen areas where you embed the same subscreen. So you have it displayed twice on screen. Remove one subscreen area and that's it.


PROCESS BEFORE OUTPUT.
MODULE get_ebeln .
CALL SUBSCREEN subscreen_area INCLUDING sy-repid W_DYNR.

and on the PAI
CALL SUBSCREEN subscreen_area.

Based on value of W_DYNR the respective subscreen will be placed in subscreen area. No need to have two subscreen areas for two subscreens.

Regards

Marcin

5 REPLIES 5

MarcinPciak
Active Contributor
0 Kudos

It is simply because you have two subscreen areas where you embed the same subscreen. So you have it displayed twice on screen. Remove one subscreen area and that's it.


PROCESS BEFORE OUTPUT.
MODULE get_ebeln .
CALL SUBSCREEN subscreen_area INCLUDING sy-repid W_DYNR.

and on the PAI
CALL SUBSCREEN subscreen_area.

Based on value of W_DYNR the respective subscreen will be placed in subscreen area. No need to have two subscreen areas for two subscreens.

Regards

Marcin

0 Kudos

hi marcin

i understand what u mean

but since i have 2 subscreen areas, i should display them based on the condition, right?

if in the PAI, i write only, CALL SUBSCREEN SUBSCREEN_9100., it will call only that screen and if the other condition is true, it wont call the other subscreen,

am I right?

0 Kudos

but since i have 2 subscreen areas, i should display them based on the condition, right?

No, it is subscreen which you called based on the condition, not the subscreen area . Subs. area have to be statically known both in PBO and PAI. So you mention it only once. Then based on the condition you determine which subscreen you want to display in this subscreen area.

CALL SUBSCREEN SUBSCREEN_9100

This doesn't mean tha subscreen 9100 is called. Alll that means is that screen has subscreen area called subscreen_9100 . The parameter which determines which subscreen is placed there is W_DYNR


CALL SUBSCREEN SUBSCREEN_AREA INCLUDING sy-repid W_DYNR.

Note! I changed the name of subscreen area subscreen_9100 to subscreen_area intentionally so you would see that it is not dispalyed based on condition, but once it displays W_DYNR = 9100 and second time it shows W_DYNR = 9399.

Hope you ge the difference

Marcin

Former Member
0 Kudos

Hi Prerna

As you have mentioned, there are 2 subscreen areas in main screen (normal screen).

you have designed 2 subscreen say scrn1(1000) and scrn2(1001).

You need to create 1 blank subscreen for not displaying if condition does not match.

say 1002 is a blank screen.

now on your main screen you want to call both the subscreens in appropriate subscreen area based on some conditions.

define variable as below:

data: v_dynnr type sy-dynnr value '1000',

v_dynnr1 type sy-dynnr value '1001',

v_dynnr2 type sy-dynnr value '1002'.

PBO

call subscreen sub1 (subscreen area1 on main screen) including sy-repid v_dynnr.

call subscreen sub2 (subscreen area2 on main screen) including sy-repid v_dynnr1.

PAI

call subscreen sub1.

call subscreen sub2.

In Main program.

if condition one (true)

dynnr = 1000. (screen with data).

else if condition two (second true condition).

dynnr1 = 1001.

else (any non-true condition).

dynnr = 1002.

dynnr1 = 1002.

endif.

Here in above conditions

if your condition is true then display firs subscreen with data in first subscreen area of normal screen and if secodn condition is also true display second subscreen with data in second subscreen area of normal screen. Otherwise display balnk screen.

Hence both the subscreens 1000 and 1001 with data will be shown at appropriate subscreen area on normal screen.

I hope you get the idea by this.

Thanks

Lalit Gupta

0 Kudos

thanks marcin

it really helped