아래와 같이 SELECT SINGLE에서 변수로 처리해서 입력하면
DATABASE TABLE이 정의되지 않았다는 SYNTAX ERROR가 나옵니다.
어떻게 해결해야 하나요?
답변 좀 부탁 드릴께요.
IF SY-SYSID = 'BWD'.
L_TABNAME1 = '/1FB/MD___2S00B5'.
ELSE.
L_TABNAME1 = '/1FB/MD___2S00CZ'.
ENDIF.
* 거래구분
SELECT SINGLE *
FROM (l_tabname1) "/1FB/MD___2S00B5
WHERE /1FB/CS_CHART = PS_PARAMETER-CS_CHART
AND /1FB/CS_ITEM = GT_DATA-CS_ITEM.
FIELD-SYMBOLS: <FS>.
IF SY-SYSID = 'BWD'.
L_TABNAME1 = '/1FB/MD___2S00B5'.
ELSE.
L_TABNAME1 = '/1FB/MD___2S00CZ'.
ENDIF.
ASSIGN (L_TABNAME1) TO <FS>.
SELECT SINGLE *
INTO CORRESPONDING FIELDS OF <FS>
FROM (L_TABNAME1) "/1FB/MD___2S00B5
WHERE /1FB/CS_CHART = PS_PARAMETER-CS_CHART
AND /1FB/CS_ITEM = GT_DATA-CS_ITEM.
IF SY-SUBRC EQ 0.
IF SY-SYSID = 'BWD'.
MOVE-CORRESPONDING <FS> TO /1FB/MD___2S00B5.
ELSE.
MOVE-CORRESPONDING <FS> TO /1FB/MD___2S00CZ.
ENDIF.
ENDIF.
필드 심볼 사용해서 하면 되겠네요 ㅎ