띵호아빠님 답변 감사합니다^^ 멍하니 손가만히 있다가 답변해 주신걸로 해보았습니다.
그런데..값이 안나와요-. ㅠ제가 코딩을 잘못 한거 같은데 봐주실수 있을까하여
코딩한거 올리겠습니다^^; 다시 제질문을 하여 죄송합니다.
DATA : LV_INDEX(3) TYPE N,
LV_KOSTL TYPE KOSTL,
GV_FIELD(30),
LV_GJAHR TYPE GJAHR,
LT_COSP LIKE COSP OCCURS 0 WITH HEADER LINE.
FIELD-SYMBOLS <fs> TYPE ANY.
DATA : LV_SUM LIKE COSP-WKG001.
SELECT * INTO TABLE LT_COSP
FROM COSP
WHERE LEDNR = '00'
AND OBJNR IN R_OBJNR
AND GJAHR = P_GJAHR
AND GEBER IN R_GEBER
AND WRTTP IN (60)
AND GEBER LIKE '005%' OR GEBER LIKE '006%' OR GEBER LIKE '007%'.
*WKG001 WKG007 INDEX 이용
* LT_COSP-WKG001 ~ LT_COSP-WKG007. "기간값.
"GT_TAB-ACTUAL3= LT_COSP-WKG001 ~ LT_COSP-WKG007 .
LOOP AT LT_COSP.
PERFORM GET_OBJECT USING LT_COSP-OBJNR CHANGING LV_KOSTL.
READ TABLE GT_KSGRU WITH KEY KOSTL = LV_KOSTL.
CHECK SY-SUBRC = 0.
READ TABLE GT_GBGRU WITH KEY GEBER = LT_COSP-GEBER.
CHECK SY-SUBRC = 0.
* LV_INDEX = P_PERBV.
CLEAR LV_SUM.
DO 7 TIMES.
LV_INDEX = SY-INDEX.
CONCATENATE 'LT_COSP-WKG' LV_INDEX INTO GV_FIELD.
ASSIGN (GV_FIELD) TO <FS>.
LV_SUM = LV_SUM + <FS>.
ENDDO.
* LV_INDEX = LV_INDEX + 1.
IF LV_INDEX > P_PERBB.
EXIT.
ENDIF.
MOVE-CORRESPONDING GT_KSGRU TO GT_TAB.
MOVE-CORRESPONDING GT_KSGRU TO GT_TAB.
*
COLLECT GT_TAB. CLEAR GT_TAB.
ENDLOOP.
잘못되있거나 수정부분있으시면 답변부탁드려요^^