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

call subscreen with a condition

Former Member
0 Likes
2,671

hi masters,

i am having a problem with call subscren

i have a main screen. in main screen i have an input screen called LOCATION.

in location if the user gives 'SIDING' then i need to call the subscreen '0111'.

so i have created a subscreen area in my main screen called SUB_AREA.

I have created a subscreen with '0111' type SUBSCREEN.

In PBO of main screen i have declared like this

CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' '0111'..

PAI

CALL SUBSCREEN SUB_AREA .

when the user gives SIDING for LOCATION and clicks on ENTER i need to display my SUBSCREEN '0111'.

where and how i have to write a conditioanl logic?

can i have some info pls?

much appriciated and thanks to everyone for your support.

thank you,

pasala.

1 ACCEPTED SOLUTION
Read only

bbalci
Contributor
0 Likes
1,677

Hello

You can use a variable for screen number,

and change this screen number depend on your logic :

* --1-- describe a screen number variable in _global data of your program_
DATA: gv_screen_number LIKE sy-dynnr.

* --2-- call a module from PBO 
*         this modul will decide which number to be called :

PROCESS BEFORE OUTPUT.
  MODULE decide_screen_number.

* --3-- use variable gv_screen_number for screen to be called :
CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' gv_screen_number.

and     MODULE decide_screen_number should look like that :

  MODULE decide_screen_number.
if <...logic  >.
  gv_screen_number = '0111'.
else.
  gv_screen_number = ...
endif.

ENDMODULE.

Edited by: Bulent Balci on Aug 18, 2010 9:47 AM

hi masters,

i am having a problem with call subscren

i have a main screen. in main screen i have an input screen called LOCATION.

in location if the user gives 'SIDING' then i need to call the subscreen '0111'.

so i have created a subscreen area in my main screen called SUB_AREA.

I have created a subscreen with '0111' type SUBSCREEN.

In PBO of main screen i have declared like this

CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' '0111'..

PAI

CALL SUBSCREEN SUB_AREA .

when the user gives SIDING for LOCATION and clicks on ENTER i need to display my SUBSCREEN '0111'.

where and how i have to write a conditioanl logic?

can i have some info pls?

much appriciated and thanks to everyone for your support.

thank you,

pasala.

5 REPLIES 5
Read only

bbalci
Contributor
0 Likes
1,678

Hello

You can use a variable for screen number,

and change this screen number depend on your logic :

* --1-- describe a screen number variable in _global data of your program_
DATA: gv_screen_number LIKE sy-dynnr.

* --2-- call a module from PBO 
*         this modul will decide which number to be called :

PROCESS BEFORE OUTPUT.
  MODULE decide_screen_number.

* --3-- use variable gv_screen_number for screen to be called :
CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' gv_screen_number.

and     MODULE decide_screen_number should look like that :

  MODULE decide_screen_number.
if <...logic  >.
  gv_screen_number = '0111'.
else.
  gv_screen_number = ...
endif.

ENDMODULE.

Edited by: Bulent Balci on Aug 18, 2010 9:47 AM

Read only

Former Member
0 Likes
1,677

thank you so much it was a great reply.

small issue.

data : dynnr type sy-dynnr.

in PBO

module fill_dynamic_screen.

CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' dynnr.

when i give condition such as

-


module FILL_DYNAMIC_SCREEN output-----.

if not location is initial.

if location = 'Depot'.

dynnr = '0111'.

endif.

endif.

endmodule-----.

and after module call i have a statement like this.

CALL SUBSCREEN SUB_AREA INCLUDING 'ZDYNAMIX_SCREE_TOMS' dynnr.

now at this stage in my DYNNR is eaither initial or '0100'(which is main screen) so it gives me runtime error saying dynpor does not exist.

can you please tell me as to how can i avoid this problem?

Read only

faisalatsap
Active Contributor
0 Likes
1,677

Hi,

You need one more Subscreen having no Screen element on it say this screen as 0112 in else case you can call this Screen like below.

if <logic>.
  dynnr = '0111'.
else.
  dynnr = '0112'.
endif.

Hope this will solve our your problem, Please reply in case of any Confusion,

Thanks and Regards,

Faisal

Read only

0 Likes
1,677

Hi,

It's not possible to use logic in PBO directly,

so you can not use an if condition in PBO like that :

if <logic>.

call subscreen ....

endif.

I'm with Faisal , you have to use an empty screen.

Read only

Former Member
0 Likes
1,677

thank you guys.... u both made my day a rocking day... thank you.