10-04-2019 12:06 PM
I have written this select statement below,
SELECT a~matnr
INTO CORRESPONDING FIELDS OF TABLE lt_matnr
FROM marc AS a
INNER JOIN t001w AS b ON b~werks = a~werks
INNER JOIN t001k AS c ON c~bwkey = b~bwkey
FOR ALL ENTRIES IN lt_low2
WHERE c~bukrs = lt_low2-low.
But it is giving me this warning and it's fetching blank value and it's showing total number of value fetched. 489 value fetched.
I cross checked the table according the satement and that table table showing 489 value with exact value.
The warning is:
The work area does not contain any corresponding errors.
10-04-2019 12:54 PM
Hello,
Your code must be as below, the issue is you have named the Field name in structure declaration as MATERIAL ( in lt_matnr declaration) but the in the query you have given MATNR as field selected and given CORRESPONDING FIELDS, for this statement the target structure should have MATNR field in it. Since you have MATERIAL as the field name system could not find the field.
By changing the field name to MATNR from MATERIAL you will get successful output. below pasted the correct code along with correct declarations.
TABLES: marc, t001k.
TYPES: BEGIN OF tt_bukrs,
bukrs TYPE t001k-bukrs,
END OF tt_bukrs,
BEGIN OF tt_mat1,
sign TYPE c LENGTH 1,
option TYPE c LENGTH 2,
low TYPE matnr,
high TYPE matnr,
END OF tt_mat1,
BEGIN OF tt_low,
low TYPE matnr,
END OF tt_low,
BEGIN OF tt_low2,
low TYPE bukrs,
END OF tt_low2.
DATA: BEGIN OF lt_matnr OCCURS 0,
matnr LIKE marc-matnr,
END OF lt_matnr.
DATA: lt_burks TYPE STANDARD TABLE OF tt_bukrs,
lwa_burks TYPE tt_bukrs,
lwa_mat1 TYPE tt_mat1,
lwa_low TYPE tt_low,
lv_low TYPE matnr,
lt_low TYPE STANDARD TABLE OF tt_low,
lt_low2 TYPE STANDARD TABLE OF tt_low2.
SELECT a~matnr
INTO CORRESPONDING FIELDS OF TABLE lt_matnr
FROM marc AS a
INNER JOIN t001w AS b ON a~werks = b~werks
INNER JOIN t001k AS c ON b~bwkey = c~bwkey
FOR ALL ENTRIES IN lt_low2
WHERE c~bukrs = lt_low2-low.
Hope it Helps!
Regards
10-04-2019 12:08 PM
Hello Mehabub Mondal,
Can you be more specific with the details, Like
What is the structure of lt_matnr and what is the structure of lt_low2
Regards
10-04-2019 12:31 PM
Hi Satish,
These are the declaration:
TABLES: marc, t001k.
TYPES: BEGIN OF tt_bukrs,
bukrs TYPE t001k-bukrs,
END OF tt_bukrs,
BEGIN OF tt_mat1,
sign TYPE c LENGTH 1,
option TYPE c LENGTH 2,
low TYPE matnr,
high TYPE matnr,
END OF tt_mat1,
BEGIN OF tt_low,
low TYPE matnr,
END OF tt_low,
BEGIN OF tt_low2,
low TYPE bukrs,
END OF tt_low2.
DATA: BEGIN OF lt_matnr OCCURS 0,
material LIKE marc-matnr,
END OF lt_matnr.
DATA: lt_burks TYPE STANDARD TABLE OF tt_bukrs,
lwa_burks TYPE tt_bukrs,
lwa_mat1 TYPE tt_mat1,
lwa_low TYPE tt_low,
lv_low TYPE matnr,
lt_low TYPE STANDARD TABLE OF tt_low,
lt_low2 TYPE STANDARD TABLE OF tt_low2.
I hope this will help you!!
10-04-2019 12:54 PM
Hello,
Your code must be as below, the issue is you have named the Field name in structure declaration as MATERIAL ( in lt_matnr declaration) but the in the query you have given MATNR as field selected and given CORRESPONDING FIELDS, for this statement the target structure should have MATNR field in it. Since you have MATERIAL as the field name system could not find the field.
By changing the field name to MATNR from MATERIAL you will get successful output. below pasted the correct code along with correct declarations.
TABLES: marc, t001k.
TYPES: BEGIN OF tt_bukrs,
bukrs TYPE t001k-bukrs,
END OF tt_bukrs,
BEGIN OF tt_mat1,
sign TYPE c LENGTH 1,
option TYPE c LENGTH 2,
low TYPE matnr,
high TYPE matnr,
END OF tt_mat1,
BEGIN OF tt_low,
low TYPE matnr,
END OF tt_low,
BEGIN OF tt_low2,
low TYPE bukrs,
END OF tt_low2.
DATA: BEGIN OF lt_matnr OCCURS 0,
matnr LIKE marc-matnr,
END OF lt_matnr.
DATA: lt_burks TYPE STANDARD TABLE OF tt_bukrs,
lwa_burks TYPE tt_bukrs,
lwa_mat1 TYPE tt_mat1,
lwa_low TYPE tt_low,
lv_low TYPE matnr,
lt_low TYPE STANDARD TABLE OF tt_low,
lt_low2 TYPE STANDARD TABLE OF tt_low2.
SELECT a~matnr
INTO CORRESPONDING FIELDS OF TABLE lt_matnr
FROM marc AS a
INNER JOIN t001w AS b ON a~werks = b~werks
INNER JOIN t001k AS c ON b~bwkey = c~bwkey
FOR ALL ENTRIES IN lt_low2
WHERE c~bukrs = lt_low2-low.
Hope it Helps!
Regards
10-04-2019 1:06 PM
10-04-2019 1:04 PM
SELECT a~matnr as material
should work.
By the way: OCCURS 0 is depreciated since many years...
10-04-2019 1:09 PM