10-11-2008 8:40 AM
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
10-11-2008 8:48 AM
Hi...
P is CHAR -25
L is CHAR 1
Make them as same techical properties.
Thanks,
Naveen.I
10-11-2008 8:52 AM
Suresh,
try this:
Declare one Var ZZ(25) type C.
and then use this for Parameter PA type ZZ .
Regards..
10-11-2008 8:55 AM
hi try this one
DATA: l(25) type c,
t type c,
done type c.
PARAMETERS p like l DEFAULT ' Vendor Number'.
10-11-2008 9:04 AM
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
10-11-2008 9:13 AM
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.
10-11-2008 11:04 AM
Hi Amit Gupta,
Your answer was helpful, but with some logical errors which i have corrected myself. But that was a helpful answers.