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

select option

Hello All,

I have 4 select options in program.If user will not enter one secect option on screen.

Then in program it should select the data for that select option which is not entered by user.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:23 AM

    check if the select-option is initial .. as

    if s_s1[] is initial.

    *--write select using this select option

    elseif s_s2[] is initial.

    *--write select using this select option

    elseif s_s3[] is initial.

    *--write select using this select option

    elseif s_s4[] is initial.

    *--write select using this select option

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:23 AM

    Hi,

    Check this code...

    TABLES:
    spfli.
    
    DATA:
      t_spfli LIKE STANDARD TABLE OF spfli.
    PARAMETERS:
         p_carrid  TYPE spfli-carrid,
         p_connid TYPE spfli-connid.
    
    *Check the condition if the parameter is initial and proceed depending on logic
    
    IF P_CONNID IS INITIAL
        SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid NE  p_carrid.
    
    ELSE IF P_carrid IS  INITIAL
        SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid NE p_connid.
    
    ELSE.
       SELECT * FROM spfli INTO TABLE t_spfli .
    
    ENDIF.
    

    Loop the table and display entries if needed.

    Hope this would help you.

    Regards

    Narin Nandivada.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:31 AM

    hi you need to write the combinations like this for the 4 select options

    if s_s1[] is initial or s_s2[] is initial or s_s3[] is initial.

    elseif ...

    elseif..

    endif.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:44 AM

    hi,

    Each select-option is a Internal table in itself. So you can check of their blank value and write the code there.

    If s_one is initial.

    select query.

    elseif s_two is initial.

    ....

    endif.

    Regards

    Sumit Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 11:49 AM

    Hii!

    Check out this sample code.

    REPORT z_sdn.
    
    TABLES:
      sflight.
    SELECT-OPTIONS:
      s_carrid FOR sflight-carrid,
      s_connid FOR sflight-connid.
    
    
    
    IF s_connid IS INITIAL.
      SELECT connid
        FROM sflight
        INTO s_connid-low
       WHERE carrid IN s_carrid.
      ENDSELECT.
      APPEND s_connid.
    ENDIF.
    
    
    
    START-OF-SELECTION.
      IF s_connid IS INITIAL.
        SELECT connid
          FROM sflight
          INTO s_connid-low
         WHERE carrid IN s_carrid.
        ENDSELECT.
        APPEND s_connid.
      ENDIF.
    
      WRITE:
        s_carrid-low,
        s_connid-low.
    

    Regards

    Abhijeet

    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.