Skip to Content

Syntax for Replace All Occurance in unicode environment

Hi All,

Need some help here. As below is my syntax. However after i tried to activate it, it will give an error message: "In CHAR MODE a character-type, or in BYTE MODE a byte-type field is expected as the row type for the table "GT_FG" ". Please advice.

Syntax:

REPLACE ALL OCCURRENCES OF '--'
IN TABLE gt_fg WITH `? ` IN CHARACTER MODE.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2012 at 04:56 AM

    Hi Shawn,

    The table gt_fg nust be character type for this to work.

    Replace the declaration of gt_fg with this.

    DATA gt_fg type standard table of string.

    Thanks,

    Shambu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2012 at 05:00 AM

    IF your table cannot be converted to TYPE TABLE OFstring, then you need to loop at the field and use REPLACE like below.

    DATA: str type string.

    Loop at gt_fg INTO wa_fg.

    str = wa_fg-field. " Field to be replaced

    REPLACE ALL OCCURRENCES OF '--'
    IN str WITH `? ` IN CHARACTER MODE.

    wa_fg-field = str.

    MODIFY gt_fg FROM wa.

    ENDLOOP.

    Thanks,

    Shambu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 13, 2012 at 05:02 AM

    Hi,

    First loop at the itab into a work area and use Replace all for the work area.Otherwise try TRANSLATE

    Karthik.R

    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.