on 09-15-2005 3:43 AM
if one of the select options is obligatory with no default value then the radio buttons does not work. Can anybody please let me know why. it is the same if i dont make the field obligatory but write code in at selection-screen on block with a error message.
REPORT ZSELECT1 .
tables : ekko.
data: group_id(3) type c.
SELECTION-SCREEN BEGIN OF BLOCK MAIN WITH FRAME TITLE TEXT-001.
PARAMETERS: p_out RADIOBUTTON GROUP RADI DEFAULT 'X' USER-COMMAND
CHECK,
p_file RADIOBUTTON GROUP RADI.
SELECTION-SCREEN END OF BLOCK MAIN.
SELECTION-SCREEN BEGIN OF BLOCK output WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: so_ekgrp FOR EKKO-EKGRP obligatory MODIF ID OUT,
so_ekorg FOR EKKO-EKORG MODIF ID OUT.
SELECTION-SCREEN END OF BLOCK OUTPUT.
SELECTION-SCREEN BEGIN OF BLOCK UPLOAD WITH FRAME TITLE TEXT-003.
PARAMETERS: p_pcfile LIKE rlgrap-filename MODIF ID UPL,
p_dismod(1) TYPE c DEFAULT 'N' MODIF ID UPL.
SELECTION-SCREEN END OF BLOCK UPLOAD.
AT SELECTION-SCREEN OUTPUT.
CASE 'X'.
WHEN P_OUT. GROUP_ID = 'UPL'.
WHEN P_file. GROUP_ID = 'OUT'.
ENDCASE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = GROUP_ID.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
hi, As Srinivas Adavi said, you'd better check if 'so_ekgrp' is initial or not manually.
But something additional for his sample code, the check should be done in 'AT SELECTION-SCREEN.' not 'START-OF-SELECTION.'.
If E type message occur in 'START-OF-SELECTION.', the application will terminate.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The problem with doing it in AT SELECTION-SCREEN is that it will fire evry time the selection screen events are called. It should only validate when the user executes the report after entering the values in selection screen. You can do it selection screen by checking the SSCRFIELDS-UCOMM value and if it is ONLI, you can validate.
A way to avoid the complete halt of the program in start of selection is to issue a S or I message but stop the rest of the process by means of a falg or something.
Did the answers help you? Can you please close the post if resolved?
Thanks,
Srinivas
You cannot have it as mandatory. Instead, you can write the validations in START-OF-SELECTION. Here is the modified code.
REPORT ZSELECT1 .
tables : ekko.
data: group_id(3) type c.
SELECTION-SCREEN BEGIN OF BLOCK MAIN WITH FRAME TITLE TEXT-001.
PARAMETERS: p_out RADIOBUTTON GROUP RADI DEFAULT 'X' USER-COMMAND CHECK,
p_file RADIOBUTTON GROUP RADI.
SELECTION-SCREEN END OF BLOCK MAIN.
SELECTION-SCREEN BEGIN OF BLOCK output WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS: so_ekgrp FOR EKKO-EKGRP MODIF ID OUT,
so_ekorg FOR EKKO-EKORG MODIF ID OUT.
SELECTION-SCREEN END OF BLOCK OUTPUT.
SELECTION-SCREEN BEGIN OF BLOCK UPLOAD WITH FRAME TITLE TEXT-003.
PARAMETERS: p_pcfile LIKE rlgrap-filename MODIF ID UPL,
p_dismod(1) TYPE c DEFAULT 'N' MODIF ID UPL.
SELECTION-SCREEN END OF BLOCK UPLOAD.
AT SELECTION-SCREEN OUTPUT.
CASE 'X'.
WHEN P_OUT. GROUP_ID = 'UPL'.
WHEN P_file. GROUP_ID = 'OUT'.
ENDCASE.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = GROUP_ID.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION.
IF p_out = 'X' and so_ekgrp[] is initial.
MESSAGE e000 WITH text-e01.
ENDIF.
Regards,
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have tried performing the check in
AT SELECTION-SCREEN on Block output. but its the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if u keep any one obligatory field then u shd enter the value in oblicatory fields then one the rest of the fields work eventhough u click the other radio button it work effectively only if u fill all the oblicatory entry..
that is the sequence for sap standard
For this case, instead of keeping the field as oblicatory u hv to check inside the pgm...
regards
venkat
Message was edited by: Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.