Skip to Content

call subscreen

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 11, 2010 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2010 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.