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

Replacing Special Chars with Space in BI 7.0 Transformation

Hi Experts:

I am getting data from External Source (DBConnect MSSQL) where the DataSource field name is WORK and in BI the filed is mapped to InfoObject Z_WORK which is 40 in Length. These fields has Specials charas like ' # - etc. I want to replace the Speicals chars with Space = ' '

In Transformation for InfoObject Z_WORK, I wrote this Routine but getting error:

<b>E:The data object "SOURCE_FIELDS" does not have a component called

"/BIC/Z_WORK".</b>

*******************************************************

DATA: l_d_offset LIKE sy-index.
CONSTANTS: c_allowed(40) type c
 value 'ABCDEFGHJKLMNOPQRSTUVWXYZ1234567890_'.
 RESULT = SOURCE_FIELDS-/BIC/Z_WORK.

*Only Capitals are permited, hence convert to Capitals.

TRANSLATE RESULT TO UPPER CASE.
DO 60 TIMES.
l_d_offset = sy-index - 1.
  IF RESULT+l_d_offset(1) CO c_allowed.

*  Character allowed, don't do anything
  ELSE.
* Character not allowed, replace with blank space
RESULT+l_d_offset(1) = ' '.
  ENDIF.
 ENDDO

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 06:31 PM

    Double click on SOURCE_FIELDS and find the fieldname for Z_WORK ..it shd be different from /BIC/Z_WORK. have the correct fieldname in code.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 06:30 PM

    Sonali,

    It would be

    <b>SOURCE_FIELDS-Z_WORK</b> instead of SOURCE_FIELDS-/BIC/Z_WORK

    simple 😊

    VJ

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 06:52 PM

    Vijayasarathy/Manga:

    thanks to both of you. That solved the problem!!!!

    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.