Skip to Content

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

Reg: Problem in select query..

Hi all,

I want to write a select query for table COEP. Like if you open SE16 and give KSTAR with S5* we will get full data related to S5xxxxx. Same like I am trying to write for select.

TYPES: BEGIN OF T_COEP,

BELNR TYPE CO_BELNR, " PLANT

PERIO TYPE CO_PERIO, " Period

KSTAR TYPE KSTAR, " Cost Element

WERKS TYPE WERKS_D, " PLANT

MATNR TYPE MATNR, " Material Number

END OF T_COEP.

data: I_COEP TYPE STANDARD TABLE OF T_COEP,

W_COEP TYPE T_COEP.

SELECT BELNR " DOCUMENT NO

PERIO " Period

KSTAR " Cost Element

WERKS " PLANT

MATNR " Material Number

FROM COEP

INTO CORRESPONDING FIELDS OF TABLE I_COEP

WHERE KSTAR = C_S5.(HERE want I need give)*

LOOP AT I_COEP INTO W_COEP.

WRITE:/ W_COEP-BELNR, W_COEP-PERIO, W_COEP-KSTAR,

W_COEP-WERKS, W_COEP-MATNR.

ENDLOOP.

Moderator message - Please search before asking - post locked

Edited by: Rob Burbank on May 15, 2009 1:34 PM

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