10-11-2010 8:11 AM
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?
10-11-2010 8:23 AM
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
10-11-2010 8:23 AM
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
10-11-2010 8:42 AM
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?
10-11-2010 9:07 AM
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
10-11-2010 10:23 AM
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
10-11-2010 11:01 AM