09-28-2006 9:11 AM
hello all,
SELECT B~MATNR
INTO TABLE LT_FINAL
FROM /SAPAPO/MATLOC AS A
INNER JOIN /SAPAPO/MATKEY AS B ON AMATID EQ BMATID
INNER JOIN /SAPAPO/LOC AS C ON ALOCID EQ CLOCID
WHERE C~LOCID EQ LT_ORDKEYS-LOCID.
Error : lt_ordkeys is a table without header line.
My Declaration is.
data : LT_ORDKEYS TYPE /SAPAPO/OM_ORDKEY_TAB,
But i cannot declare like
LT_ORDKEYS TYPE /SAPAPO/OM_ORDKEY_TAB with header line.
Then i cannot pass it to Fm CALL FUNCTION '/SAPAPO/OM_ORDER_GET_DATA'
importing parameter : et_ordkeys.
How to solve this ?
09-28-2006 9:13 AM
You can decalre it as LT_ORDKEYS TYPE <b>TABLE OF</b> /SAPAPO/OM_ORDKEY_TAB.
Best Regards,
Vibha
*Plz mark useful answers
09-28-2006 9:25 AM
Hi John,
the problem is, that the WHERE-Condition
WHERE C~LOCID EQ LT_ORDKEYS-LOCID.
compares a single value with a table.
Can you declare a range (e.g. LR_ORDKEYS), put the values from LT_ORDKEYS into this range and change the condition to
WHERE c~LOCID IN LR_ORDKEY?
?
Regards,
Stefan
09-28-2006 9:29 AM
Hi,
try below code
data LT_ORDKEYS like /SAPAPO/OM_ORDKEY_TAB occurs 0
with header line.
Regards
amole
09-28-2006 9:34 AM
Hi,
Can U paste tHe code from where ur getting the locid passed into the select query.
Regards
Ahasan
09-28-2006 9:48 AM
Hi Johnn,
Since LT_ORDKEYS is a table, try using the statement 'FOR ALL ENTRIES' in the select stmt. That should then equate each record of LT_ORDKEYS with C~LOCID.Also check LT_ORDKEYS is not initial before using a SELECT with <b>'FOR ALL ENTRIES'</b> to avoid performance issues.
SELECT B~MATNR
INTO TABLE LT_FINAL
FROM /SAPAPO/MATLOC AS A
INNER JOIN /SAPAPO/MATKEY AS B ON AMATID EQ BMATID
INNER JOIN /SAPAPO/LOC AS C ON ALOCID EQ CLOCID
<b>FOR ALL ENTRIES IN LT_ORDKEYS</b>
WHERE C~LOCID EQ LT_ORDKEYS-LOCID.
Regards.