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

Selection Screen modification

former_member355168
Participant
0 Likes
1,228

Dear Experts,

In following code, i want to modify the screen input according to the radiobutton selected.


SELECTION-SCREEN : BEGIN OF BLOCK super WITH FRAME.

PARAMETERS : r1 TYPE c RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND uc.


SELECTION-SCREEN : BEGIN OF BLOCK renewal WITH FRAME.
  SELECT-OPTIONS : s_date FOR fplt-fkdat OBLIGATORY,      " End date in billing plan
                   s_auart FOR vbak-auart,                " Order Type
                   s_spart FOR vbak-spart,                " Division
                   s_vtweg FOR vbak-vtweg.                " Distributional Channel
SELECTION-SCREEN : END OF BLOCK renewal.

PARAMETERS : r2 TYPE c RADIOBUTTON GROUP g1.

SELECTION-SCREEN : BEGIN OF BLOCK deactivation WITH FRAME TITLE text-002.

  SELECT-OPTIONS : s1_auart FOR vbak-auart,              " Order Type
                   s1_vkbur FOR vbak-vkbur,               " Sales Office
                   s1_spart FOR vbak-spart,              " Division
                   s1_vtweg FOR vbak-vtweg.              " Distributional Channel

SELECTION-SCREEN : END OF BLOCK deactivation.

SELECTION-SCREEN : END OF BLOCK super.

But getting message date has to be entered even if i select radiobutton r2.

can any one provide guidance in this.

Thanks in advance

Regards,

jaspal

10 REPLIES 10
Read only

Former Member
0 Likes
1,176

set s_date parameter as not obligatory

this code looks field as Obligatory but isn´t

at selection-screen output.
loop at screen.
    if screen-name eq 's_date'.
      screen-required = 2.
      modify screen.
    endif.

endloop.

you must check in at selection-screen if s_date field has value.

Enjoy

Read only

0 Likes
1,176

Thanks for your reply.

the parameters s_date has to be obligatory.

Regards,

Jaspal

Read only

0 Likes
1,176

try the code above an check value of the field in at selection-screen event.

other way is set a default value to field

Read only

gjl_arendsen
Explorer
0 Likes
1,176

Dear Jaspalkumar.

You should make s_date not obligatory, but perform the check in an 'AT SELECTION-SCREEN' event.

Something like;

AT SELECTION-SCREEN on s_date.

If r2 is intial and s_date[] is initial.

message e001(00) with 'Date is obligatory'(e01).

endif.

Regards, John

Read only

0 Likes
1,176

Dear All

This is how i m doing.

AT SELECTION-SCREEN.

    LOOP AT SCREEN.
      IF r1 = 'X'.
        IF screen-name = 'S_DATE' OR screen-name = 'S_AUART' OR screen-name = 'S_SPART'  OR screen-name = 'S_VTWEG'.
          SCREEN-INPUT = 1.
          MODIFY SCREEN.
        ENDIF.
      ELSEIF r2 = 'X'.
        IF screen-name = 'S1_VKBUR'  OR screen-name = 'S1_AUART' OR screen-name = 'S1_SPART'  OR screen-name = 'S1_VTWEG'.
          SCREEN-INPUT = 1.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

Read only

0 Likes
1,176

HI,

Remove the S_date obligatory from the selection screen. And add the below code--

AT SELECTION-SCREEN.
if sy-ucom eq 'ONLI' and rd1 eq 'X' and s_date is initial.
" Give error message
endif.

Regards,

Madhukar Shetty

Read only

0 Likes
1,176

Thanks all,

as advised by all, even if i make none parameters obligatory, still prob is same. unable to modyfy the screen.

if i click on r2, the fields in renewal block are still able to get input instead of getting diable.

Regards,

Jaspal kumar

Read only

0 Likes
1,176

Hi,

instead of writing AT SELECTION-SCREEN write AT SELECTION-SCREEN output .

like below

AT SELECTION-SCREEN OUTPUT
 
    LOOP AT SCREEN.
      IF r1 = 'X'.
        IF screen-name = 'S_DATE' OR screen-name = 'S_AUART' OR screen-name = 'S_SPART'  OR screen-name = 'S_VTWEG'.
          SCREEN-INPUT = 1.
          MODIFY SCREEN.
        ENDIF.
      ELSEIF r2 = 'X'.
        IF screen-name = 'S1_VKBUR'  OR screen-name = 'S1_AUART' OR screen-name = 'S1_SPART'  OR screen-name = 'S1_VTWEG'.
          SCREEN-INPUT = 1.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

Read only

Former Member
0 Likes
1,176

Hi,

Just change at Selection screen to At Selection screen Output, If you are doing any action in Selection scereen we have to use At Selection Screen output event.

Read only

former_member355168
Participant
0 Likes
1,176

I wrote my code in At selection screen event.