Skip to Content
avatar image
Former Member

select-option

hi all.. i want to go thru all values of select-options..

i mean, i want to get all the values of select-options and loop on the range of values..

pls help..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Oct 16, 2007 at 11:07 AM

    hi Sagar,

    I think you have to do a select beforehand:

    SLEECT-OPTIONS : s_bukrs TYPE bukrs.

    SELECT bukrs

    INTO gt_bukrs

    FROM t001

    WHERE bukrs IN s_bukrs.

    Now you can LOOP AT gt_bukrs...

    hope this helps

    ec

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2007 at 11:08 AM

    Hi,

    select-options : s_matnr for mara-matnr.

    loop at s_matnr.

    move : s_matnr-low to field1.

    endloop.

    like this u can use select-options..

    reward if helpful.

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2007 at 11:08 AM

    Hi you can see below code as a asample one for date

    <b>LOOP AT s_date.

    IF s_date-option = 'BT' AND

    s_date-sign = 'I'.

    IF NOT s_date-low IS INITIAL AND

    NOT s_date-high IS INITIAL.

    WHILE s_date-low LE s_date-high.

    itab-date = s_date-low.

    COLLECT itab.

    s_date-low = s_date-low + 1.

    ENDWHILE.

    ENDIF.

    ENDIF.

    IF s_date-option = 'EQ' AND

    s_date-sign = 'I'.

    IF NOT s_date-low IS INITIAL.

    LOOP AT s_date.

    itab-date = s_date-low.

    COLLECT itab.

    ENDLOOP.

    ENDIF.

    ENDIF.

    ENDLOOP.</b>

    Regards

    Gururaj

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2007 at 11:10 AM

    Hi

    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

    *SELECT-OPTIONS : S_OTYPE FOR HRP1001-OTYPE NO INTERVALS .

    SELECT-OPTIONS : S_OBJID FOR HRP1001-OBJID NO INTERVALS .

    SELECT-OPTIONS : DATE FOR SY-DATUM NO-EXTENSION OBLIGATORY.

    SELECTION-SCREEN END OF BLOCK B1.

    **********END OF SELECTION SCREEN DESIGN*****************

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.

    • IF S_OBJID IS NOT INITIAL.

    SELECT OTYPE OBJID FROM HRP1000

    INTO TABLE IT_OBJID_SH

    WHERE OTYPE = 'D'.

    IF SY-SUBRC EQ 0.

    • SEARCH HELP FOR QUALIFICATION.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    RETFIELD = 'OBJID'

    • PVALKEY = ' '

    DYNPPROG = SY-REPID

    DYNPNR = SY-DYNNR

    DYNPROFIELD = 'S_OBJID'

    • STEPL = 0

    • WINDOW_TITLE =

    • VALUE = ' '

    VALUE_ORG = 'S'

    • MULTIPLE_CHOICE = ' '

    • DISPLAY = ' '

    • CALLBACK_PROGRAM = ' '

    • CALLBACK_FORM = ' '

    • MARK_TAB =

    • IMPORTING

    • USER_RESET =

    TABLES

    VALUE_TAB = IT_OBJID_SH

    • FIELD_TAB =

    • RETURN_TAB = RETURN_TAB

    • DYNPFLD_MAPPING =

    • EXCEPTIONS

    • PARAMETER_ERROR = 1

    • NO_VALUES_FOUND = 2

    • OTHERS = 3

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDIF.

    .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2007 at 11:20 AM

    Hi,

    You can try this code :

    tables : bsis.
     
    data : count type i.
     
    data : begin of itab occurs 0,
             buzei like bsis-buzei,
            end of itab.
     
     select-OPTIONS : num for bsis-buzei.
     
     
     start-of-SELECTION.
     count = 1.
     
     do num-high times.
     
     if count = 1.
       count = num-low.
       itab-buzei = count.
       count = count + 1.
       append itab.
       clear itab.
     else.
     
     itab-buzei = count.
       count = count + 1.
     append itab.
       clear itab.
     endif.
     
     if count GT num-high.
      exit.
     ENDIF.
     
     
     enddo.
     
     if num-high is initial.
       ITAB-BUZEI = NUM-LOW.
       APPEND ITAB.
       CLEAR ITAB.
     endif.
     
     loop at itab.
       write : / itab-buzei.
     ENDLOOP.

    Thanks,

    Sriram Ponna.

    Add comment
    10|10000 characters needed characters exceeded