‎2009 Feb 10 9:38 AM
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 .
‎2009 Feb 10 10:47 AM
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.
‎2009 Feb 10 10:01 AM
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
‎2009 Feb 10 10:10 AM
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
‎2009 Feb 10 11:14 AM
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
‎2009 Feb 10 10:03 AM
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
‎2009 Feb 10 10:14 AM
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.
‎2009 Feb 10 10:47 AM
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.