‎2007 Mar 26 9:19 AM
Hi
Can anyone help me with call a subscreen after we press a button on a particular screen.
I have two buttons on a screen and want to display two subscreens depending on what button the user clicks.
‎2007 Mar 26 9:21 AM
hi u can call a subscreen:
first u define a screen as a subscreen during creation
place a subscreen area where it should b called.
and write the corresponding code in PAI
depending on sy-ucomm of the button
when ' scr1'.
call subscreen 100.
....
‎2007 Mar 26 9:21 AM
Hi Manish,
Your query can be resolved by using TABSTRIP Control in modulepool programming while designing a screen with two subscreens in it for two fields.
Hope this resolves your query.
Reward all the helpful answers.
Regards
‎2007 Mar 26 9:21 AM
hi u can call a subscreen:
first u define a screen as a subscreen during creation
place a subscreen area where it should b called.
and write the corresponding code in PAI
depending on sy-ucomm of the button
when ' scr1'.
call subscreen 100.
....
‎2007 Mar 26 9:27 AM
manish ,
see the code and change your report accordingly.
REPORT demo_dynpro_subscreens.
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: number1(4) TYPE n VALUE '0110',
number2(4) TYPE n VALUE '0130',
field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.
CALL SCREEN 100.
MODULE status_100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE fill_0110 OUTPUT.
field = 'Eingabe 1'(001).
ENDMODULE.
MODULE fill_0120 OUTPUT.
field = field1.
ENDMODULE.
MODULE fill_0130 OUTPUT.
field = 'Eingabe 2'(002).
ENDMODULE.
MODULE fill_0140 OUTPUT.
field = field2.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE save_ok INPUT.
save_ok = ok_code.
CLEAR ok_code.
ENDMODULE.
MODULE user_command_0110 INPUT.
IF save_ok = 'OK1'.
number1 = '0120'.
field1 = field.
CLEAR field.
ENDIF.
ENDMODULE.
MODULE user_command_0130 INPUT.
IF save_ok = 'OK2'.
number2 = '0140'.
field2 = field.
CLEAR field.
ENDIF.
ENDMODULE.
MODULE user_command_100 INPUT.
CASE save_ok.
WHEN 'SUB1'.
number1 = '0110'.
WHEN 'SUB2'.
number1 = '0120'.
CLEAR field1.
WHEN 'SUB3'.
number2 = '0130'.
WHEN 'SUB4'.
number2 = '0140'.
CLEAR field2.
ENDCASE.
ENDMODULE.
The next screen number of screen 100 is 100 (statically-defined). Its layout is as follows:
There are four pushbuttons with the function codes SUB1 to SUB4, and two subscreen areas AREA1 and AREA2.
In the same ABAP program, there are four subscreen screens 110 to 140. Each of these fits the subscreen area exactly. The layout is:
The input/output field of all four subscreen screens has the name FIELD. The function codes of the pushbuttons on the subscreen screens 110 and 130 are OK1 and OK2.
The screen flow logic for screen 100 is as follows:
PROCESS BEFORE OUTPUT.
MODULE status_100.
CALL SUBSCREEN: area1 INCLUDING sy-repid number1,
area2 INCLUDING sy-repid number2.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE save_ok.
CALL SUBSCREEN: area1,
area2.
MODULE user_command_100.
The screen flow logic of subscreen screens 110 and 130 is:
PROCESS BEFORE OUTPUT.
MODULE fill_0110|0130.
PROCESS AFTER INPUT.
MODULE user_command_0110|0130.
The screen flow logic of subscreen screens 120 and 140 is:
PROCESS BEFORE OUTPUT.
MODULE fill_0120|0150.
PROCESS AFTER INPUT.
Don't forget to reward if useful....
‎2007 Mar 26 9:27 AM
hi,
You can use call screen statement to call subscreen.
This code will give you a idea regarding subscreen .
DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.
DATA: number1(4) TYPE n VALUE '0110',
number2(4) TYPE n VALUE '0130',
field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.
CALL SCREEN 100.
MODULE status_100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE fill_0110 OUTPUT.
field = 'Eingabe 1'(001).
ENDMODULE.
MODULE fill_0120 OUTPUT.
field = field1.
ENDMODULE.
MODULE fill_0130 OUTPUT.
field = 'Eingabe 2'(002).
ENDMODULE.
MODULE fill_0140 OUTPUT.
field = field2.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE save_ok INPUT.
save_ok = ok_code.
CLEAR ok_code.
ENDMODULE.
MODULE user_command_0110 INPUT.
IF save_ok = 'OK1'.
number1 = '0120'.
field1 = field.
CLEAR field.
ENDIF.
ENDMODULE.
MODULE user_command_0130 INPUT.
IF save_ok = 'OK2'.
number2 = '0140'.
field2 = field.
CLEAR field.
ENDIF.
ENDMODULE.
MODULE user_command_100 INPUT.
CASE save_ok.
WHEN 'SUB1'.
number1 = '0110'.
WHEN 'SUB2'.
number1 = '0120'.
CLEAR field1.
WHEN 'SUB3'.
number2 = '0130'.
WHEN 'SUB4'.
number2 = '0140'.
CLEAR field2.
ENDCASE.
ENDMODULE.
The screen flow logic for screen 100 is as follows:
PROCESS BEFORE OUTPUT.
MODULE status_100.
CALL SUBSCREEN: area1 INCLUDING sy-repid number1,
area2 INCLUDING sy-repid number2.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE save_ok.
CALL SUBSCREEN: area1,
area2.
MODULE user_command_100.
The screen flow logic of subscreen screens 110 and 130 is:
PROCESS BEFORE OUTPUT.
MODULE fill_0110|0130.
PROCESS AFTER INPUT.
MODULE user_command_0110|0130.
The screen flow logic of subscreen screens 120 and 140 is:
PROCESS BEFORE OUTPUT.
MODULE fill_0120|0150.
PROCESS AFTER INPUT.
Message was edited by:
veereshbabu ponnada