03-21-2013 7:03 AM
Dear All,
After moving the request from Quality to Production i'm facing this error " Unable to interpret "USING". Possible causes: Incorrect spelling or comma error " . Its working fine in Quality Server but it is appearing .
I checked is there any statement without statement ending or what.(Period symbol, its not there).
Is there any undeclared statements or what , this one also not appear.
the error in the statement " DELETE IT_MG2 USING KEY SY-TABIX. "
Pls give some Suggestions.
Thanks & Regards,
Krishna
03-21-2013 7:30 AM
with implicit delete or modify, the reserved name LOOP_KEY must be specified after USING KEY and the statement must be statically visible within a loop.
03-21-2013 7:30 AM
with implicit delete or modify, the reserved name LOOP_KEY must be specified after USING KEY and the statement must be statically visible within a loop.
03-21-2013 7:40 AM
Dear Gaurab,
i kept that statement in Loop only.
LOOP AT IT_MG2 INTO WA_MG2 WHERE AUFNR = WA_ZLAYITEM-AUFNR
AND MATNR = WA_ZLAYITEM-MATNR.
* AND BWTAR = WA_ZLAYITEM-FABSKU. "Kri 12.03.13
IF SY-SUBRC EQ 0.
WA_FINAL-MENGE = WA_FINAL-MENGE + WA_MG2-MENGE.
WA_FINAL-DMBTR = WA_FINAL-DMBTR + WA_MG2-DMBTR.
DELETE IT_MG2 USING KEY SY-TABIX.
ENDIF.
ENDLOOP .
Rgds,
Krishna
03-21-2013 8:46 AM
you should just use
Delete it_mg2 index sy-tabix.
Suggestion: Do not use index directly. Please use another variable with sy.tabix value for dletion.
LOOP AT IT_MG2 INTO WA_MG2 WHERE AUFNR = WA_ZLAYITEM-AUFNR
AND MATNR = WA_ZLAYITEM-MATNR.
* AND BWTAR = WA_ZLAYITEM-FABSKU. "Kri 12.03.13
l_f_index = sy-tabix.
** no need of sy-subrc check.
wa:_....
delete it_mg2 index l_f_index.
clear: l_f_index.
endloop.
03-21-2013 9:04 AM
Hi Madhu ,
then it should not work in Quality na , how it is working in Quality server & why it is coming dump while opening the t.code itself.
Rgds,
Krishna
03-21-2013 9:11 AM
Quality? It will work in any system...using sy-tabix directly is dangerous. Always assign it just after the loop before any statement.
Do not worry abt sy-subrc in a loop as it is always 0 if it enters the loop.