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 problem....

Former Member
0 Likes
720

hello all...

in a perticular report i have three selection criteria based on date ..

1)order date

2)delivery date

3) invoice date

and therequirment is if one date range is given by the user, the other two date range should be disabled...

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
700

Disabled or ignored? If you are following a certain sequence, meaning, if user enters values in range1 and range2, that you need to ignore the latter, then you can do something like this.



report  zrich_0001.



select-options: s_datum1 for sy-datum.
select-options: s_datum2 for sy-datum.
select-options: s_datum3 for sy-datum.

start-of-selection.

  if not s_datum1 is initial.
    clear s_datum2. refresh s_datum2.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum2 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum3 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum2. refresh s_datum2.
  endif.


  write:/ 'Datum1', s_datum1.
  write:/ 'Datum2', s_datum2.
  write:/ 'Datum3', s_datum3.

REgards,

Rich Heilman

6 REPLIES 6
Read only

Former Member
0 Likes
700

HI

you have to do this with MODIF ID for the select-options

for ex.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: s_opt for <field> modif id bk1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: s_opt1 for <field> modif id bk2.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.

PARAMETERS: s_opt2 for <field> modif id bk3.

SELECTION-SCREEN END OF BLOCK b3.

At Selection-screen on s_opt.

if s_opt is not initial.

loop at screen.

if screen-group1 = 'bk2' or screen-group1 = 'bk3'.

screen-input = '0'.

endif.

endloop.

modify screen.

endif.

At Selection-screen on s_opt1.

if s_opt1 is not initial.

loop at screen.

if screen-group1 = 'bk1' or screen-group1 = 'bk3'.

screen-input = '0'.

endif.

endloop.

modify screen.

endif.

At Selection-screen on s_opt2.

if s_opt2 is not initial.

loop at screen.

if screen-group1 = 'bk2' or screen-group1 = 'bk1'.

screen-input = '0'.

endif.

endloop.

modify screen.

endif.

regards

kishore

Message was edited by: Harikishore Sreenivasulu

Read only

Former Member
0 Likes
700

hi Kishan,

You can use..

select-options : s_dat1 for... MODIF ID B1,

s_dat2 for... MODIF ID B2,

s_dat3 for .... MODIF ID B3.

At Selection-screen on S_dat1.
   if s_dat1 is not initial.
     loop at screen.
       if screen-group1 = 'B2' or screen-group1 = 'B3'.
       screen-input = '0'.
        endif.
      endloop.
     modify screen.
    endif.

where B2 and B3 are MODIF ID of select-options for second and third dates..

change this according to your requirement..

regards

satesh

Read only

Former Member
0 Likes
700

hi kishan,

Then declare the date variable with parameter data type. Hope this serves your purpose

Regards,

Santosh P

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
701

Disabled or ignored? If you are following a certain sequence, meaning, if user enters values in range1 and range2, that you need to ignore the latter, then you can do something like this.



report  zrich_0001.



select-options: s_datum1 for sy-datum.
select-options: s_datum2 for sy-datum.
select-options: s_datum3 for sy-datum.

start-of-selection.

  if not s_datum1 is initial.
    clear s_datum2. refresh s_datum2.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum2 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum3 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum2. refresh s_datum2.
  endif.


  write:/ 'Datum1', s_datum1.
  write:/ 'Datum2', s_datum2.
  write:/ 'Datum3', s_datum3.

REgards,

Rich Heilman

Read only

0 Likes
700

If you wish to disable the fields on the screen. Then you can do something like this.



report  zrich_0001.



select-options: s_datum1 for sy-datum modif id sd1.
select-options: s_datum2 for sy-datum modif id sd2.
select-options: s_datum3 for sy-datum modif id sd3.

at selection-screen output.

  loop at screen.
    if not s_datum1 is initial
        and ( screen-group1 = 'SD2'
          or  screen-group1 = 'SD3' ).
      screen-input = '0'.
      modify screen.
    endif.

    if not s_datum2 is initial
        and ( screen-group1 = 'SD1'
          or  screen-group1 = 'SD3' ).
      screen-input = '0'.
      modify screen.
    endif.

    if not s_datum3 is initial
    and ( screen-group1 = 'SD1'
      or  screen-group1 = 'SD2' ).
      screen-input = '0'.
      modify screen.
    endif.

  endloop.

start-of-selection.

  if not s_datum1 is initial.
    clear s_datum2. refresh s_datum2.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum2 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum3. refresh s_datum3.
  endif.

  if not s_datum3 is initial.
    clear s_datum1. refresh s_datum1.
    clear s_datum2. refresh s_datum2.
  endif.


  write:/ 'Datum1', s_datum1.
  write:/ 'Datum2', s_datum2.
  write:/ 'Datum3', s_datum3.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
700

HI

this is code is working perfectly

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

PARAMETERS: s_opt type d modif id bk1.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: s_opt1 type d modif id bk2.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME.

PARAMETERS: s_opt2 type d modif id bk3.

SELECTION-SCREEN END OF BLOCK b3.

At selection-screen output.

if s_opt is not initial.

loop at screen.

if screen-group1 = 'BK2' or screen-group1 = 'BK3'.

screen-input = '0'.

endif.

modify screen.

endloop.

endif.

if s_opt1 is not initial.

loop at screen.

if screen-group1 = 'BK1' or screen-group1 = 'BK3'.

screen-input = '0'.

endif.

modify screen.

endloop.

endif.

if s_opt2 is not initial.

loop at screen.

if screen-group1 = 'BK2' or screen-group1 = 'BK1'.

screen-input = '0'.

endif.

modify screen.

endloop.

regards

kishore