Skip to Content

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

problem with the select query

Hi All,

i need to retrive the data from a table. intially i am retriving the data select query with the following selection screen feilds.

Select  KEKO~KLVAR
          KEKO~MATNR
          KEKO~WERKS
          KEKO~TVERS
          KEKO~KADAT
          KEKO~STLAN
          MARA~MTART
 from KEKO inner join MARA on 
 KEKO-MATNR eq MARA-MATNR
 INTO CORRESPONDING FIELDS OF TABLE IT_DATA 
 where  KEKO~KLVAR eq P_KLVAR
           KEKO~MATNR in S_MATNR
           KEKO~WERKS in S_WERKS
           KEKO~TVERS eq P_TVERS
           KEKO~KADAT in S_KADAT
           KEKO~STLAN eq P_STLAN
           MARA~MTART in S_MTART.

Now i need to write the forall entries with another custom table ZABC.

the ZABC table structure is:

         PLANT
         PERIO
         GJAHR
         MATNR
         TYPPS
         KOSTL
         LSTAR
         MENGE
         KSTAR
         LPREIS
         LPEINH

in this the key feild are plant(werks), Material (Matnr) and fiscal year (GJAHR). But i am unable to write the select query.

if not IT_DATA[] is initial.
        select PLANT
                  PERIO
                  GJAHR
                  MATNR
                  TYPPS
                  KOSTL
                  LSTAR
                  MENGE
                  KSTAR
                  LPREIS
                  LPEINH from table ZABC for all entries in table IT_DATA
                  where matnr eq IT_DATA-matnr and
                  werks eq IT_DATA-werks and

<b> gjahr eq ?????.</b>

endif.

so finally i have problem with fiscal year.. so please help me in this to go ahead..

      • i will reward you if i got a clue from you people.

regards

raghu

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question