cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Query Returning Incorrect Data from MARM Table

03-10-2025 3:58 PM
wanrooy Explorer
1133 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

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!

 

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

wanrooy
Explorer
0 Likes

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 Likes
Please don't post an "answer", which means a solution, instead post a comment.