Skip to Content
author's profile photo Former Member
Former Member

doubt on select-options

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:49 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:44 AM

    Hi,

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

    there use LOOP AT SCREEN.

    Regards,

    Atish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:45 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:46 AM

    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>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:55 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 06:56 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.