Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sap upgrade problem

Former Member
0 Likes
774

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
723

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

5 REPLIES 5
Read only

Former Member
0 Likes
723

HI

do the following

DATA: BEGIN OF WAGETYPES,

LGA TYPE P0008-LGA01,

BET TYPE P0008-BET01,

END OF WAGETYPES.

Read only

0 Likes
723

hi KR,

thanx for reply, but type is not working and still i m getting same error. can anyone please help me?

regards saurabh.

Read only

0 Likes
723

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.

Read only

0 Likes
723

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.

Read only

Former Member
0 Likes
724

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