Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem in selection screen validation.

Former Member
0 Likes
656

Hi All,

I am having the following in the selection screen:

PARAMETERS : p_r1 RADIOBUTTON GROUP grp DEFAULT 'X' USER-COMMAND dlvy,

p_r2 RADIOBUTTON GROUP grp .

SELECTION-SCREEN BEGIN OF BLOCK b1 with frame title text-001.

SELECT-OPTIONS: s_vbeln FOR lips-vbeln MODIF ID dly.

SELECT-OPTIONS: s_lfart FOR likp-lfart OBLIGATORY MODIF ID dly.

SELECT-OPTIONS: s_vstel FOR likp-vstel MODIF ID dly.

SELECT-OPTIONS: s_matnr FOR lips-matnr MODIF ID dly.

SELECT-OPTIONS: s_wadat FOR likp-wadat OBLIGATORY MODIF ID dly.

SELECT-OPTIONS: s_wbsta FOR vbup-wbsta MODIF ID dly.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 with frame title text-002.

SELECT-OPTIONS: s1_matnr FOR lips-matnr MODIF ID mat.

SELECT-OPTIONS: s_extwg FOR mara-extwg MODIF ID mat.

SELECT-OPTIONS: s_werks FOR marc-werks MODIF ID mat.

SELECTION-SCREEN END OF BLOCK b2.

If I choose Radio Button 1, only option 1 should be triggered,

If I choose Radio Button 2, only option 2 should be triggered,

For this I have:

AT SELECTION-SCREEN OUTPUT.

*

IF p_r1 = 'X'.

blk_hide = 'MAT'.

blk_show = 'DLY'.

ELSE.

blk_hide = 'DLY'.

blk_show = 'MAT'.

ENDIF.

LOOP AT SCREEN.

IF screen-group1 = blk_hide.

screen-active = 0.

ELSE.

IF screen-group1 = blk_show.

screen-active = 1.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Now I need to validate the selection Screen, I am facing issue in doing selection screen validation:

Can any one help me in how to go about this?

Thanks,

Debrup.

5 REPLIES 5
Read only

tarangini_katta
Active Contributor
0 Likes
630

Hi,

How you want to validate u r selection screen field .

Can you explain clearly.

Thanks

Read only

0 Likes
630

Hi,

In case I am giving incorrect delivery number or incorrect date it should flash out an arror message.

Thanks,

Debrup.

Read only

0 Likes
630

Hi,

For example u have to give system date iin the field u r giving wrong date then u want to display error message.

At selection screen on VAlue-Request for p_field---whcih field u want to validate..

If P_field NE SY-datum.

message e000.

endif.

Thanks,

Read only

0 Likes
630

sorry, I though you have problems with the radiobutton switches...

delivery number: you have to do a select count, if the sy-subrc is not null you can issue an error message:

SELECT COUNT( * )

FROM ...

WHERE ... "comparison with selection screen field

IF sy-subrc NE 0.

==> issue error message

ENDIF.

date: if the date is correct (from calendar point of view), that will be checked automatically by the system. if you want something more you have to code on your own.

Read only

JozsefSzikszai
Active Contributor
0 Likes
630

pls. replace the AT SELECTION-SCREEN OUTPUT event with this one:

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    CASE 'X'.
      WHEN p_r1.
        CASE screen-group1.
          WHEN 'DLY'.
            screen-active = '1'.
          WHEN 'MAT'.
            screen-active = '0'.
        ENDCASE.
      WHEN p_r2.
        CASE screen-group1.
          WHEN 'DLY'.
            screen-active = '0'.
          WHEN 'MAT'.
            screen-active = '1'.
        ENDCASE.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.