2020 Dec 23 1:49 PM
DATA : lv_matnr TYPE matnr,
lv_extwg TYPE extwg.
DATA: BEGIN OF TKOMP OCCURS 10.
INCLUDE STRUCTURE KOMP.
DATA: END OF TKOMP.
"DATA: tkomp TYPE komp.
SELECT SINGLE matnr extwg FROM mara INTO (lv_matnr,lv_extwg)
WHERE matnr = lv_matnr.
IF sy-subrc EQ 0.
tkomp-extwg = lv_extwg.
ENDIF.
WRITE 😕 lv_extwg.
My problem is while execute this statement the output is empty. May i know why?
Please guide me to get a value for lv_extwg... by using mara and komp table.
2020 Dec 23 2:23 PM
You're reading MARA with key matnr = lv_matnr and at the same time writing the result for MATNR into lv_matnr.
Somehow I don't think this is what you want... also, what is the value of lv_matnr to begin with?
You can use the same variable in the WHERE as in the INTO. I've done it many times.
My guess is that data isn't there, or the lv_matnr is in external format and needs to go through that ALPHA conversion exit.
2020 Dec 23 2:23 PM
You're reading MARA with key matnr = lv_matnr and at the same time writing the result for MATNR into lv_matnr.
Somehow I don't think this is what you want... also, what is the value of lv_matnr to begin with?
2020 Dec 23 2:33 PM
We will fill TKOMP-EXTWG with the value from MARA?
TKOMP-EXTWG = MARA-EXTWG ?
need to fill the structure tkomp.
2020 Dec 23 2:48 PM
naveena_10 check your code as Andrea suggested: put a break point on the select and check how you read MARA table...
If this is the full code, you are reading with empty LV_MATNR: whatelse do you expect?
2020 Dec 23 3:01 PM
2020 Dec 24 2:41 PM
You can use the same variable in the WHERE as in the INTO. I've done it many times.
My guess is that data isn't there, or the lv_matnr is in external format and needs to go through that ALPHA conversion exit.
2020 Dec 24 2:44 PM
It is a tiny bit more confusing, I know it works.
I agree on your hunch.
2020 Dec 24 7:13 AM
SELECT SINGLE extwg FROM mara INTO lv_extwg
WHERE matnr = lv_matnr.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |