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 condition

Former Member
0 Likes
2,748

Hi,

I need to call subscreen 1001 when checkbox is clicked. I tried writing the IF statement in PBO but it returned me error "Statement 'IF' is not defined. Check your spelling..". But if I put it inside a module in PBO, it gave me error "." or "ID ... FIELD ..." expected after "SUBSCREEN". If I am not allowed to write the condition neither on PBO or MODULE, then how do I call a subscreen with a condition?

1 ACCEPTED SOLUTION
Read only

venkat_o
Active Contributor
0 Likes
1,339

Hi, <li>Define one variable to have screen number.

DATA:g_screen TYPE sy-dynnr.
<li>Assign function code to the Checkbox. Goto Layout->double click on checkbox->set FctCode. <li>Define subscreen area on main screen with name SUB1. <li>Flow logic of screen
process before output.
  MODULE status_100.
  CALL subscreen: sub11 including sy-repid g_screen
process after input.

  CALL subscreen: sub1.
  MODULE user_command_100.
<li>user_command_100 module should be like below
*----------------------------------------------------------------------*
*  MODULE user_command_100 INPUT
*----------------------------------------------------------------------*
MODULE user_command_100 INPUT.
  IF g_checkbox = 'X'.
    g_screen = '1001'.
  ELSE.
    g_screen = space.
  ENDIF.
ENDMODULE.
Thanks Venkat.O

Hi,

I need to call subscreen 1001 when checkbox is clicked. I tried writing the IF statement in PBO but it returned me error "Statement 'IF' is not defined. Check your spelling..". But if I put it inside a module in PBO, it gave me error "." or "ID ... FIELD ..." expected after "SUBSCREEN". If I am not allowed to write the condition neither on PBO or MODULE, then how do I call a subscreen with a condition?

5 REPLIES 5
Read only

rainer_hbenthal
Active Contributor
0 Likes
1,339

Call a form routine inside module

Read only

rvinod1982
Contributor
0 Likes
1,339

Hi,

Put the IF condition in the main program. Based on the IF condition call the subscreen dyanmically.

Check program DEMO_DYNPRO_SUBSCREENS.

Regards,

Vinod

Read only

Former Member
0 Likes
1,339

Hi,

Putting the code in FORM still give me error "." or "ID ... FIELD ..." expected after "SUBSCREEN". The demo program does not call subscreen with a condition. I need to know how to call a subscreen with condition.

Read only

0 Likes
1,339

Assign a function code to the check box..

and in PBO of the calling screen..

1) write the code


 CALL SUBSCREEN: <area> INCLUDING sy-repid <dynpronum>.

// <area> is the subarea u define for the subscreen.

in the PAI of calling screen.

1)write the statemnt..


CALL SUBSCREEN <area>.

2) in a user_command module write the functionality

for the func code o check box accordingly..

useful link..

http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbabfe35c111d1829f0000e829fbfe/content.htm

Regards,

Deeba

Read only

venkat_o
Active Contributor
0 Likes
1,340

Hi, <li>Define one variable to have screen number.

DATA:g_screen TYPE sy-dynnr.
<li>Assign function code to the Checkbox. Goto Layout->double click on checkbox->set FctCode. <li>Define subscreen area on main screen with name SUB1. <li>Flow logic of screen
process before output.
  MODULE status_100.
  CALL subscreen: sub11 including sy-repid g_screen
process after input.

  CALL subscreen: sub1.
  MODULE user_command_100.
<li>user_command_100 module should be like below
*----------------------------------------------------------------------*
*  MODULE user_command_100 INPUT
*----------------------------------------------------------------------*
MODULE user_command_100 INPUT.
  IF g_checkbox = 'X'.
    g_screen = '1001'.
  ELSE.
    g_screen = space.
  ENDIF.
ENDMODULE.
Thanks Venkat.O