‎2010 May 26 12:28 PM
Hi,
Could anybody please let me know how i will be able to call a subscreen conditionally in a module pool program?
Example: I have to call a subscreen XXXX if a FLAG = X. How will I achieve this?
I tried to write the below code in PAI
if flag = 'X'.
call subscreen XXXX.
endif.This produced an error.
Regards,
Smithesh
‎2010 May 26 1:13 PM
Hi
In TOP Include
data repid type sy-repid,
dynnr type sy-dynnr.
In PBO of main screen
module status_100. " First Call This Module to provide the SubScreen Number to below Code
call subscreen sub including repid dynnr. " This serves the purpose of calling subscreen based on condition
in Program.
module status_100.
repid = sy-repid.
if your_condition = 'X'. " This also can be implemented in any PAI logi as its purpose is just to pass a value to DYNNR
dynnr = '200'. " The SUB Screen Number you want to pass
else.
dynnr = '300'. " Dummy Sub Screen Screen or any other (Make Sure these are of SUB SCREEN type )
endif.
endmoduleCheerz
Ram
‎2010 May 26 12:35 PM
Hi,
Just define 2 subscreens - one is your actual subscreen, the other is an empty screen.
In the flow logic of the main screen do:
module determine_subscreen. " determines global variable 'subscreen_number' number depending on condition
call subscreen <subscreen_area> including sy-repid subscreen_number.
Regards, Gerd Rother
‎2010 May 26 12:37 PM
Hi,
You can do conditionally but in other way , u will have to disable the elemnts of the subscreen based on the flag in the PBO of the screen
‎2010 May 26 12:42 PM
Hi,
In PAI Module you cannot write IF and ENDIF statements.
You cannot call Subscreen area based on conditions.
Because the statement, Call Subscreen <area> must be in PAI event
otherwise it gives syntax error.
Regards,
Raghava Channooru
‎2010 May 26 12:48 PM
Hi,
when ur condition satisfies call an empty screen on the subscreen
i.e if r_but eq 'X'.
call screen 100. (empty screen)
endif.
cheers,
Bhavana
‎2010 May 26 1:13 PM
Hi
In TOP Include
data repid type sy-repid,
dynnr type sy-dynnr.
In PBO of main screen
module status_100. " First Call This Module to provide the SubScreen Number to below Code
call subscreen sub including repid dynnr. " This serves the purpose of calling subscreen based on condition
in Program.
module status_100.
repid = sy-repid.
if your_condition = 'X'. " This also can be implemented in any PAI logi as its purpose is just to pass a value to DYNNR
dynnr = '200'. " The SUB Screen Number you want to pass
else.
dynnr = '300'. " Dummy Sub Screen Screen or any other (Make Sure these are of SUB SCREEN type )
endif.
endmoduleCheerz
Ram
‎2010 May 26 1:14 PM
You can do it for user commands.
like :
Case ok_cdoe
When 'ABCD'.
Call subscreen ....
Endcase.