Application Development and Automation 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: 
Read only

Data selection based on select option's value

Former Member
0 Likes
736

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

5 REPLIES 5
Read only

Former Member
0 Likes
673

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..

Read only

0 Likes
673

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?

Read only

0 Likes
673

>

> 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....

Read only

anesh_kumar
Active Participant
0 Likes
673

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

Read only

Former Member
0 Likes
673
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.