2005 Jul 23 5:19 AM
In my program there are two subscreens. The second subscreen to be displayed only if check box of first subscreen is ticked. How to do pass check box variable in flow logic.
Flow logic coding is given below.
3500 :Main screen
3600 :Subscreen1
3700 :Subscreen2
c2 is the variable for check box
if c2 = c_cross then only second screen should be called.
PROCESS BEFORE OUTPUT.
MODULE STATUS_3500.
MODULE TEST.
CALL SUBSCREEN: SUB1 INCLUDING 'Ztest' '3600',
SUB2 INCLUDING 'Ztest' '3700'.
PROCESS AFTER INPUT.
MODULE EXIT_MOD AT EXIT-COMMAND.
MODULE USER_COMMAND_3500.
CALL SUBSCREEN SUB1.
please help.
anu
2005 Jul 23 5:12 PM
Hi Anupama,
You can do like this.
Create a dummy subscreen called 3800 with out any fields.
Instead of hardcoding the subscreen 3700 use a variable called w_subscreen. So your code will be;
PROCESS BEFORE OUTPUT.
MODULE STATUS_3500.
MODULE TEST.
CALL SUBSCREEN: SUB1 INCLUDING 'Ztest' '3600',
SUB2 INCLUDING 'Ztest' w_subscreen.
PROCESS AFTER INPUT.
MODULE EXIT_MOD AT EXIT-COMMAND.
CALL SUBSCREEN SUB1.
CALL SUBSCREEN SUB2.
MODULE USER_COMMAND_3500.
The variable w_subscreen can be declared as
data: w_subscreen like sy-dynnr value '3800'.
The value of w_subscreen is set by default as '3800', the dummy screen.
Now inside the USER_COMMAND_3500 you can check the value of the field c2 like.
if c2 = c_cross.
w_subscreen = '3700'.
else.
w_subscreen = '3800'.
endif.
Should you require more clarification please let me know.
Thanks
Vinod
2005 Jul 25 4:36 AM
Hi,
DATA: BEGIN OF i_main_tab,
subscreen LIKE sy-dynnr,
prog LIKE sy-repid VALUE
'ZZZ_TEST',
pressed_tab LIKE sy-ucomm,
END OF i_main_tab.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9001.
<b>MODULE main_tab_active_tab_set.</b>
CALL SUBSCREEN main_tab_sca
INCLUDING i_main_tab-prog i_main_tab-subscreen.
In PBO,
MODULE status_9001 OUTPUT.
IF o_dockingcontainer IS INITIAL.
IF custom_container1 IS INITIAL.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'ZTITLE'.
Creating Object
PERFORM f9000_objects_create.
....... modify ,... do other things.
<b>MODULE main_tab_active_tab_set OUTPUT.</b>
if c2 = c_cross.
i_main_tab-subscreen = '3600'.
CALL METHOD o_alvgrid1->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = i_output[]
it_fieldcatalog = i_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
...................
else.
i_main_tab-subscreen = '3700'.
CALL METHOD o_alvgrid2->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_a
is_layout = w_layout
CHANGING
it_outtab = i_details[]
it_fieldcatalog = i_fieldcat2[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
..............
endif.
In PAI,
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9001.
Hope this helps.
Thanks & Regards,
Judith.
2005 Jul 25 4:48 AM
Hi,
Declare a variable of type character as global variable.After the checkboxed is checked,assign that variable to 'X'.This way you can pass the variable.