Application Development 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: 

Type incompatible while activating in ECC 6.0 after updating from ECC 4.6

former_member396896
Participant
0 Kudos

<b>Error : VGARTI-DB and VGARTP are type-incompatible in DO...Varying..loop</b>

DATA: BEGIN OF VGARTP, " Vorgangsparameter

VGART LIKE TM07I-VGART, " char 2

XHINZ LIKE TM07I-XHINZ, " char 1

XZAEL LIKE TM07I-XZAEL, " char 1

XDIFF LIKE TM07I-XDIFF, " char 1

XNACH LIKE TM07I-XNACH, " char 1

END OF VGARTP.

DATA: BEGIN OF VGARTI, " Aktionen zur Vorgangsart " Changed for unicode compatibility

DB(6) TYPE C VALUE 'DB X ',

IB(6) TYPE C VALUE 'IBX ',

ID(6) TYPE C VALUE 'IDXXX ',

IN(6) TYPE C VALUE 'INX X',

IZ(6) TYPE C VALUE 'IZXX ',

ZB(6) TYPE C VALUE 'ZB XX ',

ZE(6) TYPE C VALUE 'ZE X ',

ZL(6) TYPE C VALUE 'ZL X ',

Z$(6) TYPE C VALUE '$$$$$$',

END OF VGARTI.

DO ANZ-SEGM TIMES VARYING VGARTP FROM VGARTI-DB NEXT VGARTI-IB.

IF VGARTP(2) = T158I-VGART.

EXIT.

ENDIF.

IF VGARTP = VGARTI-Z$.

MESSAGE E001 WITH SPACE SPACE SPACE 'VGARTI'.

ENDIF.

ENDDO.

3 REPLIES 3

Former Member
0 Kudos

Shouldn't the variable you are "varying" be the same length / type as the "from" and "to" i.e. more like (from SAP help):

DATA: BEGIN OF TEXT,
        WORD1(4) VALUE 'This',
        WORD2(4) VALUE 'is',
        WORD3(4) VALUE 'a',
        WORD4(4) VALUE 'loop',
      END OF TEXT.

DATA: STRING1(4), STRING2(4).

DO 4 TIMES VARYING STRING1 FROM TEXT-WORD1 NEXT TEXT-WORD2.
  WRITE STRING1.
  IF STRING1 = 'is'.
    STRING1 = 'was'.
  ENDIF.
ENDDO.

Former Member
0 Kudos

In unicode / ECC6 you cannot move a structured data object into a flat field.

Your VGARTP is structured - it is defined with multiple fields.

You VGARTI fields ar flat - CHAR(6).

Define VGARTP as VGARTP(6) type C, or use a different variable of CHAR(6) as the varying field in the loop.

Andrew

former_member396896
Participant
0 Kudos

Thank u guys for replying so sooon...........

I have declared a string variable above the do.......varying........ statement..

and then used it in do statement and again assign the content of the string

back to the varying element........ that solved the problemm............

Once again thanx a lot