06-27-2023 4:06 PM
Hi need help in how to use select statement from multiple tables.
I'm having this error "Field "TS_BWART-BWART" is unkwown. It is neither one of the specified tables nor defined by a "DATA" statement. "DATA" statement."
SELECT SUB2
FROM ZVXXPARAM_GLOBAL
INTO TABLE TS_BWART
WHERE MAIN EQ 'QR'.
SELECT MATNR
CHARG
FROM MSEG
INTO TABLE TS_RETRIEVE
WHERE BWART EQ TS_BWART-BWART
AND MATNR EQ TS_QMAT-MATNR
AND WERKS EQ P_SPLANT
How to fix this error?
06-27-2023 5:05 PM
I can only suppose that TS_BWART is an itab without header.
(Did you forget some FOR ALL ENTRIES option in second select statement?)
06-28-2023 10:38 AM
If you want to select for all previously read value in a single select statement, use SELECT, FOR ALL ENTRIES
Else, assign each record (or copy it to a work aread) of the table to a field symbol in a LOOP AT or READ TABLE statement
06-27-2023 5:08 PM
06-28-2023 4:20 AM
The definition of the structure TS_BWART does not include the BWART field, please check.
BTW, the sql not provide the BWART field in the column list, so the table TS_BWART BWART all are empty values
SELECT SUB2
FROM ZVXXPARAM_GLOBAL
INTO TABLE TS_BWART
WHERE MAIN EQ 'QR'.
06-28-2023 8:54 AM
IF TS_BWART is defined as a TABLE with a single field, then this select will copy SUB2 (of a customer table) into the single field
07-07-2023 8:48 PM
07-08-2023 7:10 AM
Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!