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: 

Error : Data type incompatible

Former Member
0 Kudos

Hi gurus,

The following is my code:

REPORT zssppgmm1.

DATA: l type c,

t type c,

done type c.

PARAMETERS p(25) DEFAULT ' Vendor Number'.

WHILE done = ' '

VARY l FROM p0 NEXT p1

VARY t FROM p24 NEXT p23.

IF l = ' ' AND t = ' '.

l = t = '-'.

ELSE.

done = 'X'.

ENDIF.

ENDWHILE.

WRITE: / p.

if i execute it, i get the following error msg. how to resolve it

Error: "P" and "L' are type-incompatible.

Thanks and regards,

Suresh

Edited by: Suresh S on Oct 11, 2008 9:41 AM

Edited by: Suresh S on Oct 11, 2008 9:41 AM

6 REPLIES 6

naveen_inuganti2
Active Contributor
0 Kudos

Hi...

P is CHAR -25

L is CHAR 1

Make them as same techical properties.

Thanks,

Naveen.I

former_member188005
Contributor
0 Kudos

Suresh,

try this:

Declare one Var ZZ(25) type C.

and then use this for Parameter PA type ZZ .

Regards..

Former Member
0 Kudos

hi try this one

DATA: l(25) type c,
t type c,
done type c.

PARAMETERS p like l DEFAULT ' Vendor Number'.

Former Member
0 Kudos

try THIS:

DATA: L TYPE C,

T TYPE C,

DONE TYPE C.

PARAMETERS: P(25) TYPE C DEFAULT 'Vendor Number'.

WHILE DONE IS INITIAL

VARY L FROM P1(1) NEXT P2(1) RANGE P

VARY T FROM P24(1) NEXT P23(1) RANGE P.

IF L = ' ' AND T = ' '.

L = T = '-'.

ELSE.

DONE = 'X'.

ENDIF.

ENDWHILE.

WRITE: / P.

ERROR WAS DUE TO SIZE INCOMPATIBILITY BETWEEN P AND L

Former Member
0 Kudos

From what i understand, u might be trying to do this

DATA: L TYPE C,

T TYPE C,

Z(2) TYPE N.

PARAMETERS: P(25) TYPE C DEFAULT 'Vendor Number'.

Z = STRLEN( P ).

WHILE Z > 0

VARY L FROM P0(1) NEXT P1(1) RANGE P.

IF L = ' '.

L = '-'.

ENDIF.

Z = Z - 1.

ENDWHILE.

WRITE: / P.

Former Member
0 Kudos

Hi Amit Gupta,

Your answer was helpful, but with some logical errors which i have corrected myself. But that was a helpful answers.