Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Look Up Logic in Select

Hi Guys,

I am trying to do a look up from a master data table.

My situation is that i have to compare a coloum for multivalues in where clause. But this does not work.

May be i am using a wrong way of implementing the logic. I tried using IN , Like in where caluse but in was giving a short dump. Then i tried below. It executes but not showing result.

When i try with only one value condition it works. Data exists in system.

select /BIC/R0CAGID CMS_GRRT CMS_CASVAL

     into table it_cag

     from /BIC/MR0CAGID

     where CMS_CAGTYP = '030600' AND

                 OBJVERS = 'A'.

select /BIC/R0CAGID CMS_GRRT CMS_CASVAL

     into table it_cag

     from /BIC/MR0CAGID

     where CMS_CAGTYP = '030200' AND

                 OBJVERS = 'A'.

select /BIC/R0CAGID CMS_GRRT CMS_CASVAL

     into table it_cag

     from /BIC/MR0CAGID

     where CMS_CAGTYP = '030601' AND

                 OBJVERS = 'A'.

   LOOP AT it_source INTO ls_source.

     IF ls_source-CMS_CAGTYP = '030600' OR

        ls_source-CMS_CAGTYP = '030200'  OR

        ls_source-CMS_CAGTYP = '030601'.

       READ TABLE it_cag into lv_cag

       WITH KEY lv_cagid = ls_source-/BIC/R0CAGID.

Please assist.

Regards

Zabi

replied

Hi,

    Also Check Your Internal table name  TT_CAG or IT_CAG???

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question