Application Development 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: 

doubt on select-options

Former Member
0 Kudos

Hi all,

I have a doubt in giving input parameter.

In my report i want the selection-screen(input fields) to be based on date,month,yearly basis.

if the user selects date-wise then the corresponding select-option should b activated & corresponding values has to displayed.like that i want for monthly,yearly.

anyone help me on this.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use radiobuttons for Year, Day and Month.

In the event AT SLECTION-SCREEN OUTPUT,

LOOP AT SCREEN 
  if r1 = 'X'              "For Year
    if screen-name = 'abc'.
       screen-active = 0.
    endif.
  elseif r2 = 'X'.
    if screen-name = 'abcd'.
       screen-active = 0.
    endif.
  else
    if screen-name = 'abcde'.
       screen-active = 0.
    endif.
  endif.
modify screen.
ENDLOOP.

Hope this helps.

Regards,

Richa

7 REPLIES 7

Former Member
0 Kudos

Hi,

Put your logic of activating the screen fields under AT SELECTION SCREEN OUTPUT.

there use LOOP AT SCREEN.

Regards,

Atish

Former Member
0 Kudos

Hi,

You can have 3 radiobuttons - Year, Day and Month and 3 select-options.

In the event AT SLECTION-SCREEN OUTPUT,

LOOP AT SCREEN and based on the radiobutton selected, enable and disable the select-option (using the name).

Hope this helps.

0 Kudos

could u just explain a little bit clear

Former Member
0 Kudos

You need to modify the selection-screen.

Selection Screen Events - <u>demo_selection_screen_events</u>

PBO of selection Screen - <u>demo_at_selection_screen_pbo</u>

check the below programs.

<u>demo_dynpro_modify_simple

demo_dynpro_modify_screen</u>

Former Member
0 Kudos

Hi,

Use radiobuttons for Year, Day and Month.

In the event AT SLECTION-SCREEN OUTPUT,

LOOP AT SCREEN 
  if r1 = 'X'              "For Year
    if screen-name = 'abc'.
       screen-active = 0.
    endif.
  elseif r2 = 'X'.
    if screen-name = 'abcd'.
       screen-active = 0.
    endif.
  else
    if screen-name = 'abcde'.
       screen-active = 0.
    endif.
  endif.
modify screen.
ENDLOOP.

Hope this helps.

Regards,

Richa

Former Member
0 Kudos

Hi RS

use three radio buttons and the select option.

use modifid for select-options.

put the condion over radio button1 if 'x'.

then put the condion in at selection-screen output.

loop at screen.

if screen-group1 = '001'

what u want do that.

like screen-active = '1'

endif .

modify screen.

endloop.

similarly do for other radio button.

for more information about screen element.

go to structure screen.

regards

vijay dwivedi

Former Member
0 Kudos

Hi RS,

Use below snippet in ur code it is exactly set for ur reqirement

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-031.

PARAMETERS: date1 RADIOBUTTON GROUP rad1 DEFAULT 'X', "SAP date format YYYYDDMM

date2 RADIOBUTTON GROUP rad1, "Date format like aprial31, 2006

date3 RADIOBUTTON GROUP rad1, "Date format like 31 apr,2006

date4 RADIOBUTTON GROUP rad1, "Date format like DD/MM/YYYY

date5 RADIOBUTTON GROUP rad1. "Date format like DD.MM.YYYY

SELECTION-SCREEN END OF BLOCK b2

FORM getmonth .

SELECT mnr

ktx

ltx

INTO TABLE T_month

FROM t247

WHERE spras = 'EN'.

IF sy-subrc NE '0'.

MESSAGE I "Message - Not able to get month values from the table T247

ENDIF.

ENDFORM.

DATA : temp_date(16) TYPE c,

temp1_date(60) TYPE c,

year(4) TYPE c,

daymonth(11) TYPE c,

daymonth1(11) TYPE c,

month(9) TYPE c,

day(2) TYPE c,

mon LIKE t247-ktx,

len TYPE i .

MOVE date TO temp1_date .

CONDENSE temp1_date NO-GAPS.

MOVE temp1_date TO temp_date .

IF date2 EQ 'X'. "The date format is like Aprial 31, 2007

CONDENSE temp_date NO-GAPS.

SPLIT date AT ',' INTO daymonth year.

IF STRLEN( year ) NE '4'.

error = 'X'.

WRITE : 'Invalid date format.'.

ELSE.

daymonth1 = daymonth.

CONDENSE daymonth1 NO-GAPS.

_len = STRLEN( _daymonth1 ).

l_len = 13 - len.

SHIFT daymonth1 RIGHT BY len PLACES.

CONDENSE daymonth1 NO-GAPS.

month = daymonth1.

CONDENSE month NO-GAPS.

SORT t_month BY monthltx.

READ TABLE t_month WITH KEY monthltx = month.

IF sy-subrc <> 0.

error = 'X'.

WRITE : 'Invalid date format.' .

ELSE.

len = STRLEN( month ).

CONDENSE daymonth NO-GAPS.

SHIFT daymonth LEFT BY len PLACES.

day = daymonth.

CONDENSE day NO-GAPS.

CONCATENATE year t_month-monthnumber day INTO o_date.

ENDIF.

ENDIF.

ELSEIF p_date3 EQ 'X'. "The date format is like 31 apr, 2007

CONDENSE temp_date NO-GAPS.

SPLIT i_date AT ',' INTO daymonth year.

IF STRLEN( year ) NE '4'.

error = 'X'.

WRITE : 'Invalid date format.'.

ELSE.

daymonth1 = daymonth.

CONDENSE daymonth1 NO-GAPS.

SHIFT daymonth1 LEFT BY 2 PLACES.

CONDENSE daymonth1 NO-GAPS.

month = daymonth1.

CONDENSE month NO-GAPS.

TRANSLATE month TO UPPER CASE.

SORT t_month BY monthstx.

MOVE month to mon.

READ TABLE t_month WITH KEY monthstx = mon.

IF sy-subrc <> 0.

error = 'X'.

WRITE : 'Invalid date format.' .

ELSE.

CONDENSE daymonth NO-GAPS.

day = daymonth+0(2).

CONDENSE day NO-GAPS.

CONCATENATE year t_month-monthnumber day INTO o_date.

ENDIF.

ENDIF.

ELSEIF p_date4 EQ 'X' OR p_date5 EQ 'X'. "Date format is like DD.MM.YYYY or DD/MM/YYYY

CONDENSE temp_date NO-GAPS.

IF STRLEN( temp_date ) EQ 10.

o_date0(4) = temp_date6(4).

o_date4(2) = temp_date3(2).

o_date6(2) = temp_date0(2).

ELSE.

error = 'X'.

WRITE : 'Invalid date format.' .

ENDIF.

ENDIF.

IF STRLEN( o_date ) NE '8'.

error = 'X'.

WRITE : 'Invalid date format.'.

ENDIf.

ENDFORM. " f0100_conv_date

*Reward points if is useful

Regards