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

Error in the code

Hi all

This code is giving me error as wa_it_file-brgew must be a charater-type data object.

can anybody give me solution.

CONCATENATE wa_it_file-matnr wa_it_file-maktx wa_it_file-msehi wa_it_file-brgew wa_it_file-volum wa_it_file-volum wa_it_file-wheel_width wa_it_file-wheel_diam

INTO v_data SEPARATED BY ','.

CONDENSE v_data NO-GAPS.

TRANSFER v_data TO v_filename.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 21, 2008 at 11:55 AM

    can anybody give me solution.

    will reward points.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2008 at 11:47 AM

    Hi,

    with concatenate all fields must be of type char.

    Cheers.

    ...Reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2008 at 12:49 PM

    Hello all

    thanx so much for ur wonderful replies

    m getting this error only for fields

    wa_it_file-brgew wa_it_file-volum. I tried to give there length but they are type domain i cannot assign length to them

    can anybody give me other solution

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2008 at 01:48 PM

    Hi all

    When I go AL11 and try to open the file. a error is coming as

    "unable to display file." what can be the error.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2008 at 02:40 PM

    In this code data is not comming in the work area and ultimately file is not getting open.

    plz help anybody.

    TYPES : BEGIN OF x_mtfile,

    matnr TYPE matnr, "Material Number

    maktx TYPE maktx, "Material description

    prodesc(30) TYPE c, "Material description

    salegrp(3) TYPE c, "

    msehi TYPE msehi, "Text description of the UOM

    brgew TYPE c, "

    volum TYPE c, "

    length(5) TYPE c, "

    wheel_width TYPE zwid, "Wheel Width

    wheel_diam TYPE zdiam, "Use diameter to get height

    serial(1) TYPE c, "

    palqty(10) TYPE c,

    unipcar(5) TYPE c, "

    unno(4) TYPE c, "

    END OF x_mtfile.

    *work area declaration for tables.

    DATA : wa_mara TYPE MARA.

    DATA : wa_makt TYPE MAKT.

    DATA : wa_t006a TYPE T006A.

    DATA : wa_zmmkaganplant TYPE zmmkaganplant.

    *Table declaration for storing data.

    DATA : it_file TYPE TABLE OF x_mtfile WITH HEADER LINE.

    DATA : wa_it_file TYPE x_mtfile.

    DATA : v_data type string.

    DATA : v_filename type string.

    *variable declaration.

    DATA : v_werks type werks_d.

    *Default filename.

    DATA: v_filename1 LIKE rlgrap-filename VALUE '/interface/SYSID/OUTBOUND/KAGAN/'.

    *File path.

    CONCATENATE v_filename1 wmara-matnr '_' SY-DATUM '_' SY-UZEIT '.txt' INTO v_filename.

    • Get the default file name

    REPLACE 'SYSID' WITH sy-sysid INTO v_filename.

    CONDENSE v_filename NO-GAPS.

    • Open the file to read the material.

    OPEN DATASET v_filename FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    LOOP AT it_file INTO wa_it_file.

    IF wmarc-werks IS NOT INITIAL AND wmarc-werks = wa_zmmkaganplant-werks.

    IF SY-TCODE = 'MM01'.

    IF STRLEN(wmara-matnr) > 15.

    MESSAGE e000(zt) WITH 'Invalid material no.'

    else.

    wa_it_file-matnr = wmara-matnr.

    wa_it_file-maktx = stext-maktx.

    wa_it_file-msehi = wmara-meins.

    wa_it_file-brgew = wmara-brgew.

    wa_it_file-volum = wmara-volum.

    wa_it_file-wheel_width = wmara-wheel_width.

    wa_it_file-wheel_diam = wmara-wheel_diam.

    APPEND wa_it_file TO it_file.

    IF SY-TCODE = 'MM02'.

    SELECT SINGLE

    matnr

    brgew

    volum

    wheel_width

    wheel_diam

    FROM MARA

    INTO wa_mara

    WHERE matnr = wmara-matnr.

    SELECT SINGLE msehi FROM T006A INTO wa_t006a

    WHERE msehi = wmara-meins

    AND spras = sy-langu.

    SELECT SINGLE maktx FROM MAKT INTO wa_makt

    WHERE matnr = wmara-matnr.

    IF wmara-matnr <> wa_mara-matnr

    AND stext-maktx <> wa_makt-maktx

    AND wmara-meins <> wa_t006a-msehi

    AND wmara-brgew <> wa_mara-brgew

    AND wmara-volum <> wa_mara-volum

    AND wmara-wheel_width <> wa_mara-wheel_width

    AND wmara-wheel_diam <> wa_mara-wheel_diam.

    CONCATENATE wa_it_file-matnr wa_it_file-maktx wa_it_file-msehi wa_it_file-brgew wa_it_file-volum wa_it_file-wheel_width wa_it_file-wheel_diam

    INTO v_data SEPARATED BY ','.

    CONDENSE v_data NO-GAPS.

    TRANSFER v_data TO v_filename.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDLOOP.

    CLOSE DATASET v_filename.

    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.