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

Am I missing any syntax ?

Former Member
0 Likes
869

Hi,

I am new to Dialog Prog, can you please let me know what is the prob in the below code.I have to call a Subscreen 5000 up on one condition.



 *&      Module  STATUS_4000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_4000 OUTPUT.
  SET PF-STATUS 'PF4000'.
  CALL SUBSCREEN: 'REF1' INCLUDING 'ZPROG'  '5000'.


*  SET TITLEBAR 'xxx'.

ENDMODULE.                 " STATUS_4000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_4000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_4000 INPUT.
CASE SY-UCOMM.
WHEN 'GETP'.
CALL SUBSCREEN '5000'.

.

Here Ref1 is my sub screen name in screen 4000 ( in tab strip). It is throwing me this error .

 "," OR "ID... FIELD..." EXPECTED AFTER SUBSCREEN  

.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
843

Hi,

Try calling the subscreen in PBO as follows

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0500.
 call subscreen SCR1 including sy-repid screen_val.
*
PROCESS AFTER INPUT.

 MODULE CANCEL AT EXIT-COMMAND.
 call subscreen SCR1.
 MODULE USER_COMMAND_0500.

Mention screen no in screen_val. Avoid giving it directly.

Hope this helps.

Regards,

Deepthi.

6 REPLIES 6
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
843

Hi,

Create a screen of type sub-screen and take a sub screen area SUB_AREA on it.

Since you want to call this sub screen on a condition, use this code, its working:-

At screen logic:-


PROCESS AFTER INPUT.
   MODULE INIT_SUBSCREEN.
   CALL SUBSCREEN SUB_AREA INCLUDING V_PROG V_DYNNR.

In PAI,


MODULE INIT_SUBSCREEN.
  IF <condition>. "if condition is true then call sub-screen
    V_PROG = sy-repid.
    V_DYNNR = '800'.
  ENDIF.
ENDMODULE.

Hope this helps you.

Thanks & Regards,

Tarun

Read only

Former Member
0 Likes
843

Hi Tarun,

Thanks for the reply, when I saw sap help there it was written that

 CALL SUBSCREEN SUB_AREA INCLUDING V_PROG V_DYNNR.
 

in PBO and

 Call Subscreen sub_area 

in PAI. Did I get it wrong ?

In the above code I have given 5000 instead of ref1 but still it is not working.

Thanks.

V

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
843

Hi,

First of all, you always use statement CALL SUBSCREEN in flow logic not in module definition.

Use:-

At screen logic:-


PROCESS BEFORE OUTPUT.
   CALL SUBSCREEN REF1 INCLUDING V_PROG V_DYNNR.

PROCESS AFTER INPUT.
   MODULE INIT_SUBSCREEN.
   CALL SUBSCREEN REF1.

In PAI,


MODULE INIT_SUBSCREEN.
  IF <condition>. "if condition is true then call sub-screen
    V_PROG = sy-repid.
    V_DYNNR = '5000'.
  ENDIF.
ENDMODULE.

Hope this solves your problem.

Thanks & Regards,

Tarun

Read only

Former Member
0 Likes
843

Hi,

Remove the colon after the statemet subscreen.


CALL SUBSCREEN: 'REF1' INCLUDING 'ZPROG'  '5000'.

to


CALL SUBSCREEN: 'REF1' INCLUDING 'ZPROG'  '5000'.

Also make sure that REF1 is a subscreen area defined in the screen 4000.

regards,

Advait

Read only

0 Likes
843

Hi Advait,

Yes, I also tried removing that but it did not work.Also I made sure that the Subscreen area name in 4000 is REF1.

Thanks,

V.

Read only

Former Member
0 Likes
844

Hi,

Try calling the subscreen in PBO as follows

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0500.
 call subscreen SCR1 including sy-repid screen_val.
*
PROCESS AFTER INPUT.

 MODULE CANCEL AT EXIT-COMMAND.
 call subscreen SCR1.
 MODULE USER_COMMAND_0500.

Mention screen no in screen_val. Avoid giving it directly.

Hope this helps.

Regards,

Deepthi.