‎2007 Apr 05 10:45 AM
Hi all
i need to declare a field as a mandatory one in screen painter. The problem is that unless it is filled with some value the Back or cancel button could not function upon clicking. how to solve this?
‎2007 Apr 05 10:53 AM
standard transactions also works in the similay way, If you dont want that remove the mandatory option and use this
in PAI
loop at screen.
if screen-name = 'FIELD_NAME'.
screen-required = '1'.
modify screen.
endif.
endloop.
‎2007 Apr 05 10:49 AM
Hi..,
<b>Ya u can solve this by using AT EXIT-COMMAND..</b>
When u are defining the Status in Menu painter .. For BACK or EXIT or CANCEL u need to give the <b>function type</b> as 'E' ( by default it is space ).
Now in the AT EXIT_COMMAND event write...
In the Dynpro in<b> PAI event</b> .. u need to call the module as <b>MODULE CANCEL AT EXIT-COMMAND.</b>
in THE Module pool program ...
<b>MODULE CANCEL.
case sy-ucomm.
when 'BACK' OR 'CANCEL'.
leave program.
endcase.
ENDMODULE.</b>
reward if it helps u...
sai ramesh
‎2007 Apr 05 11:09 AM
hi sai,
It is messaging that the at exit_command should be in some loop.
‎2007 Apr 05 10:51 AM
Hi
To solve this, you can either use AT EXIT COMMAND or declare the selection screen field without making it obligatory and in the code you can check if the field is not initial before processing it.
‎2007 Apr 05 10:53 AM
standard transactions also works in the similay way, If you dont want that remove the mandatory option and use this
in PAI
loop at screen.
if screen-name = 'FIELD_NAME'.
screen-required = '1'.
modify screen.
endif.
endloop.
‎2007 Apr 05 11:12 AM
hi chandrasekar,
now the cancel and back buttons are working properly but after clicking execute button without giving any value in that field it is not giving the message .
‎2007 Apr 05 11:31 AM
Hi Prshant,
Check out the SY-UCOMM for Execute button , guess EXEC in screen and ONLI while used in selection screens,
write this in user command module
WHEN 'EXEC'.
loop at ..
.......
endloop.
‎2007 Apr 05 10:57 AM
Prasanth,
For mandatory , Double click on that field goto attribute select the check box input required.
Type E Function Codes
You can assign the function type E to the function codes of both pushbuttons on the screen and of elements in the GUI status. To do this for a pushbutton, set the Function type attribute in the Screen Painter to E. To do it in the GUI status, choose Goto ® Object lists ® Function list in the Menu Painter, select the required function codes, and enter E for the function type.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
MODULE BACK AT EXIT-COMMAND.
-
-
MODULE CANCEL INPUT.
MESSAGE I888(BCTRAIN) WITH TEXT-001 OK_CODE INPUT1 INPUT2.
IF OK_CODE = 'CANCEL'.
CLEAR OK_CODE.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
MODULE BACK INPUT.
MESSAGE I888(BCTRAIN) WITH TEXT-002 OK_CODE INPUT1 INPUT2.
IF OK_CODE = 'BACK'.
CLEAR: OK_CODE .
LEAVE TO SCREEN 100.
ENDIF.
ENDMODULE.
Don't forget to reward if useful...
‎2007 Apr 05 11:03 AM
Hi,
if u are using function module use this.
DATA: IT_EXTAB TYPE SLIS_T_EXTAB.
DATA: WA_EXTAB LIKE LINE OF IT_EXTAB.
WA_EXTAB-FCODE = 'APEN'.
APPEND WA_EXTAB TO IT_EXTAB.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
XXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXX
IT_EXCLUDING = IT_EXTAB
XXXXXXXXXXXXXXXXXXX.
if u r using OO alv
data: it_exclude TYPE ui_functions.
Exclude toolbar buttons which are not required
CLEAR : it_exclude, it_exclude[].
PERFORM exclude_tb_functions CHANGING it_exclude.
CLEAR : it_exclude, it_exclude[].
&----
*& Form EXCLUDE_TB_FUNCTIONS
&----
text
----
<--P_IT_EXCLUDE text
----
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_check.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_refresh.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_print.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_info.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
APPEND ls_exclude TO pt_exclude.
ENDFORM. " EXCLUDE_TB_FUNCTIONS
rgds,
bharat.