‎2009 May 30 11:31 AM
hi
i have written below code
wn i execute im getting error as 'You cannot use an internal table as a work area.'
how to solve this?
SELECT a~aufnr
a~plnbez
a~gstrp
a~gltrp
a~gstri
a~gltri
a~gstrs
a~gltrs
* a~getri
a~FTRMI
b~ktext
b~objnr
c~charg
c~dwerk
INTO TABLE it_final
FROM afko AS a
INNER JOIN aufk AS b ON a~aufnr = b~aufnr
INNER JOIN afpo AS c ON a~aufnr = c~aufnr
WHERE (cond_syntax)
AND c~dwerk = p_werk
AND a~fevor IN s_fevor
AND a~dispo IN s_dispo .
*get actual Finish Date
IF NOT IT_FINAL[] IS INITIAL.
SELECT MAX( BUDAT ) aufnr
FROM AFRU
INTO IT_AFRU
* FOR ALL ENTRIES IN IT_FINAL
WHERE AUFNR = IT_FINAL-AUFNR
AND WERKS = P_WERKS.
ENDSELECT.
ENDIF.Regard
Smitha
‎2009 May 30 11:45 AM
HI,
SELECT a~aufnr
a~plnbez
a~gstrp
a~gltrp
a~gstri
a~gltri
a~gstrs
a~gltrs
* a~getri
a~FTRMI
b~ktext
b~objnr
c~charg
c~dwerk
INTO TABLE it_final
FROM afko AS a
INNER JOIN aufk AS b ON a~aufnr = b~aufnr
INNER JOIN afpo AS c ON a~aufnr = c~aufnr
WHERE (cond_syntax)
AND c~dwerk = p_werk
AND a~fevor IN s_fevor
AND a~dispo IN s_dispo .
*get actual Finish Date
IF NOT IT_FINAL[] IS INITIAL.
SELECT MAX( BUDAT ) aufnr
FROM AFRU
INTO TABLE IT_AFRU " Add Table declaration
* FOR ALL ENTRIES IN IT_FINAL
WHERE AUFNR = IT_FINAL-AUFNR
AND WERKS = P_WERKS.
* ENDSELECT. " Comment Endselect
ENDIF.
‎2009 May 30 1:48 PM
Hi Smitha,
For all the tables with header line a simple TABLE prefix should be added thats the solution to your problem,
add TABLE infront of internal table in the select query.
For further details
http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb36a1358411d1829f0000e829fbfe/content.htm
Thanks
Ram