09-17-2008 11:41 AM
hi all,
i m doing upgrade from sap4.7 to ecc6.0, when i m executing a program,
DATA: BEGIN OF WAGETYPES,
LGA LIKE P0008-LGA01,
BET LIKE P0008-BET01,
END OF WAGETYPES.
START-OF-SELECTION.
GET PERNR.
PROVIDE * FROM P0008 BETWEEN PN-BEGDA AND PN-ENDDA.
RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
DO 20 TIMES VARYING WAGETYPES
FROM P0008-LGA01
NEXT P0008-LGA02.
IF WAGETYPES-LGA IS INITIAL.
EXIT.
endif.
its giving an error "P0008-LGA01" and "WAGETYPES" are type-incompatible. can anyone please tell me that what should i do?
regards saurabh.
09-17-2008 12:37 PM
Hi,
By using field sybols u can avoid
FIELD-SYMBOLS <WAGETYPES> LIKE P0008-LGA01.
DATA inc TYPE i.
DO 20 TIMES.
inc = sy-index - 1.
ASSIGN P0008-LGA01 INCREMENT inc TO <WAGETYPES> RANGE P0008.
IF WAGETYPES-LGA IS INITIAL.
EXIT.
endif.
ENDDO.
Also check:
DO - varying SAP help.
Regards
09-17-2008 11:48 AM
HI
do the following
DATA: BEGIN OF WAGETYPES,
LGA TYPE P0008-LGA01,
BET TYPE P0008-BET01,
END OF WAGETYPES.
09-17-2008 11:54 AM
hi KR,
thanx for reply, but type is not working and still i m getting same error. can anyone please help me?
regards saurabh.
09-17-2008 12:17 PM
HI
check the Data types of the fields LGA01, BET01 in the table P0008. Both the fields should be of same type.
or else you can declare field symbols and use them in place of that variables.
09-17-2008 12:24 PM
hi KR,
again thanx for reply, i checked the table PA0008 and the
type is not same. for field LGA01 type is CHAR and length
is 4, while for BET01 type is CURR and length is 13.
can u please modify the above code? or tell me that how can i
define the field symbol for the same?
regards saurabh.
09-17-2008 12:37 PM
Hi,
By using field sybols u can avoid
FIELD-SYMBOLS <WAGETYPES> LIKE P0008-LGA01.
DATA inc TYPE i.
DO 20 TIMES.
inc = sy-index - 1.
ASSIGN P0008-LGA01 INCREMENT inc TO <WAGETYPES> RANGE P0008.
IF WAGETYPES-LGA IS INITIAL.
EXIT.
endif.
ENDDO.
Also check:
DO - varying SAP help.
Regards