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

Error : Data type incompatible

Former Member
0 Likes
1,090

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
Read only

naveen_inuganti2
Active Contributor
0 Likes
941

Hi...

P is CHAR -25

L is CHAR 1

Make them as same techical properties.

Thanks,

Naveen.I

Read only

Former Member
0 Likes
941

Suresh,

try this:

Declare one Var ZZ(25) type C.

and then use this for Parameter PA type ZZ .

Regards..

Read only

Former Member
0 Likes
941

hi try this one

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

PARAMETERS p like l DEFAULT ' Vendor Number'.

Read only

Former Member
0 Likes
941

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

Read only

Former Member
0 Likes
941

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.

Read only

Former Member
0 Likes
941

Hi Amit Gupta,

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