‎2008 Apr 02 8:49 AM
hi
i've already read some posts about back buttons and calling screens but my problem is, that i have only one screen but 3 subscreens...
the first subscreen shows a table, subscreen 2 is there to make new entrys for that table and subscreen 3 is there to mutate or delete entrys.
if im in subscreen 2 and push "back" it should call subscreen 1. same to subscreen 3. if i push "back" in subscreen 1 it should leave the programm...
code:
MODULE user_command_100 INPUT.
CASE ok_code.
WHEN 'BACK'.
CALL SCREEN '0110'. "Error "0110 is a subscreen, unable to call subscreens"
CALL SCREEN 0. "That doesnt do anything
CALL SUBSCREEN AREA1 INCLUDING SY-REPID '0110'. "Debugger says something bout ID and Field and i dont know what he wants. F1 doesnt help me there...
WHEN 'EXIT'.
LEAVE TO TRANSACTION 'SESSION_MANAGER'.
ENDCASE.
ENDMODULE. "user_command_100 INPUT
thx in advance
‎2008 Apr 02 4:39 PM
HI, TRY this
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
CLEAR: ok_code.
SET SCREEN 0.
LEAVE SCREEN.
WHEN ..........
ENDCASE.
ENDMODULE.
IN THE SCREEN U HAVE SOMEONE LIKE THIS..
PROCESS BEFORE OUTPUT.
MODULE ficha_nota_active_tab_set.
CALL SUBSCREEN ficha_nota_sca
INCLUDING g_ficha_nota-prog g_ficha_nota-subscreen.
MODULE status_0100.
PROCESS AFTER INPUT.
CALL SUBSCREEN ficha_nota_sca.
MODULE ficha_nota_active_tab_get.
FIELD but000-partner .
FIELD ls_dyn0100-code .
FIELD ls_dyn0100-status .
MODULE user_command_0100.
‎2008 Apr 02 4:39 PM
HI, TRY this
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
CLEAR: ok_code.
SET SCREEN 0.
LEAVE SCREEN.
WHEN ..........
ENDCASE.
ENDMODULE.
IN THE SCREEN U HAVE SOMEONE LIKE THIS..
PROCESS BEFORE OUTPUT.
MODULE ficha_nota_active_tab_set.
CALL SUBSCREEN ficha_nota_sca
INCLUDING g_ficha_nota-prog g_ficha_nota-subscreen.
MODULE status_0100.
PROCESS AFTER INPUT.
CALL SUBSCREEN ficha_nota_sca.
MODULE ficha_nota_active_tab_get.
FIELD but000-partner .
FIELD ls_dyn0100-code .
FIELD ls_dyn0100-status .
MODULE user_command_0100.
‎2008 Apr 02 10:05 PM
When you trap the "BACK" button in the user-command in PAI, just look at which subscreen is currently active and react appropriately from there, e.g. if subscreen = 4300, then set subscreen to 4200 and allow to flow back to PBO, if it's 4200 set to 4100 and flow back to PBO, and if it's 4100 then actually exit the screen (leave to screen 0).
Jonathan
‎2008 Apr 03 4:19 AM
rafe,
See the below code and based on that change your screen.
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 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.
When you run the program, a screen appears on which subscreens 110 and 130 are displayed. The pushbuttons on the main screen allow you to choose between two subscreen screens for each screen area. The pushbuttons on the subscreens allow you to transfer the data from subscreens 110 and 130 to subscreens 120 and 140.
Since the same field name FIELD is used on all subscreens, the identically-named ABAP field is transferred more than once in each PBO and PAI event of the main screen. For this reason, the values have to be stored in the auxiliary fields FIELD1 and FIELD2 in the ABAP program.
The pushbuttons on the subscreen screens have different function codes, and they are handled normally in an ABAP field. If the function codes had had the same names, it would again have been necessary to use auxiliary fields.
Pls. reward if useful....
‎2008 Apr 03 9:36 AM
Hi thr,
i feel ur making the code complex.. which is not something required . i suggest you to use a single subscreen and a tab control. this will help u great deal. If ur using the tab control, simply code the loading of a subscreen on the click of the tab button. U can also use tab control wizard which does the entire work for you. i think this should help.
Do reward if helpful and get bak if any other help reqd.