cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with Query Returning Incorrect Data from MARM Table

wanrooy
Explorer
0 Kudos
586

Hi everyone,

I'm facing an issue with a query that is supposed to retrieve data from the MARM table, specifically the UMREN field. However, the query consistently returns the value 10, which is incorrect. Below is the code I am using:

DATA: lv_umren_ea TYPE P.
CLEAR lv_umren_ea.
SELECT SINGLE MARM~UMREN
INTO lv_umren_ea
FROM MARM
JOIN MARC ON MARM~MATNR = MARC~MATNR
JOIN CAUFV ON MARC~WERKS = CAUFV~WERKS
  WHERE MARM~MEINH = 'EA'.
Z_EA = lv_umren_ea.

Could anyone help me identify what might be wrong with this code? Any suggestions or insights would be greatly appreciated.

Thank you!

 

Accepted Solutions (0)

Answers (1)

Answers (1)

wanrooy
Explorer
0 Kudos

You are right. I have adjusted the code, but I am still not getting the desired result. The result remains the same.

DATA: lv_umren_ea TYPE P,
      lv_matnr TYPE MARM-MATNR.
CLEAR lv_umren_ea.
CLEAR lv_matnr.
SELECT SINGLE MATNR
INTO lv_matnr
FROM MARM
WHERE MARM~MEINH = 'EA'.
SELECT SINGLE MARM~UMREN
INTO lv_umren_ea
FROM MARM
JOIN MARC ON MARM~MATNR = MARC~MATNR
JOIN CAUFV ON MARC~WERKS = CAUFV~WERKS
WHERE MARM~MEINH = 'EA'
  AND MARM~MATNR = lv_matnr.
Z_EA = lv_umren_ea.
Sandra_Rossi
Active Contributor
0 Kudos
Please don't post an "answer", which means a solution, instead post a comment.