Skip to Content
author's profile photo Former Member
Former Member

Error : Data type incompatible

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Oct 11, 2008 at 07:48 AM

    Hi...

    P is CHAR -25

    L is CHAR 1

    Make them as same techical properties.

    Thanks,

    Naveen.I

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 11, 2008 at 07:52 AM

    Suresh,

    try this:

    Declare one Var ZZ(25) type C.

    and then use this for Parameter PA type ZZ .

    Regards..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2008 at 07:55 AM

    hi try this one

    DATA: l(25) type c,
    t type c,
    done type c.
    
    PARAMETERS p like l DEFAULT ' Vendor Number'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2008 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2008 at 08: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2008 at 10: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.