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

Data selection based on select option's value

Hi Experts,

I have a requirement for data selections from 2 different Item table based on select option's value. Its based on the value of Select option LEDGER which may have multiple value. If it contains '0L' then data will be selected from BSEG table, else if it contains 'Z1' then from BSEG_ADD table and if contains both value then from both table. Please tell me how can I approach.

Edited by: Amit Biswas on Sep 14, 2010 12:06 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2010 at 06:39 PM

    You can design radio-buttons instead of select-options....

    when user selects 0L -> FETCH FROM BSEG.

    when user selects Z1 -> FETH FROM BSEG_ADD.

    when user select both -> FETCH FROM BSEG /BSEG_ADD..

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      >

      > But the requirement is fixed, cant use radio buttons. And 2 radio button cannot be selected at a time. Is there any solution about using the field of the select option's field (the low-high field) as it is a structure itself?

      You' ll actually have 3 radio buttons, 0L, Z1 and Both....

  • Posted on Sep 13, 2010 at 07:02 PM

    Hi

    Create 3 diff itab's; Read the select options table based on the entries execute that particular select statement

    As stated above you might use the check box instead of radio buttons

    Regards

    Edited by: Anesht on Sep 13, 2010 9:02 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2010 at 07:16 PM
    data: R_LEDGER type range of VBAK-LEDGER,
          R_TYPE like line of R_LEDGER,
          L_LINES type I.
    
    selection-screen begin of block BLK1 with frame title TEXT-S01.
    select-options S_LEDGER for TABLE-LEDGER no intervals.
    selection-screen end of block BLK1.
    
    start-of-selection.
    
      describe table S_LEDGER lines L_LINES.
    
      if L_LINES gt 1.
        read table S_LEDGER into R_TYPE with key S_LEDGER-LOW = '0L'.
        if SY-SUBRC eq 0.
          read table S_LEDGER into R_TYPE with key S_LEDGER-LOW = 'Z1'.
          if SY-SUBRC eq 0.
            perform READ_BOTH.
          else.
            perform READ_BSEG.
          endif.
        else.
          read table S_LEDGER into R_TYPE with key S_LEDGER-LOW = 'Z1'.
          if SY-SUBRC eq 0.
            perform READ_BSEG_ADD.
          endif.
        endif.
      else.
        read table S_LEDGER into R_TYPE with key S_LEDGER-LOW = '0L'.
        if SY-SUBRC eq 0.
          perform READ_BSEG.
        else.
          read table S_LEDGER into R_TYPE with key S_LEDGER-LOW = 'Z1'.
          if SY-SUBRC eq 0.
            perform READ_BSEG_ADD.
          endif.
        endif.
      endif.
    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.