cancel
Showing results for 
Search instead for 
Did you mean: 

check for entries on the selection screen

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

i have tried performing the check in

AT SELECTION-SCREEN on Block output. but its the same.

Former Member
0 Kudos

Can u tell us wat is ur requirements ?

Remove that obligatory & do that check manually..

regards

gv

Message was edited by: Venkat

Former Member
0 Kudos

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