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

Handle text in content conversion or in mapping?

Hi.

I have the following problem.

I'm receiving a flat file with invoice information.

I have identifiers on each line for the type of information on the line.

When I get to texts then I have the identifier H0150 at the start of the line.

The first entry will be the some kind of reference text.

Entry 2-5 can hold invoice reference text.

The rest of the entries holds delivery note text.

Bellow is an example of how it could look without any real data.

Have in mind that delivery note text could be some few lines or many lines.

H0150 (Here we have the reference text)

H0150 (The following row 2-5 can hold information and could be blank.)

H0150 (If the row 2-5 are empty then we are not to forward the rows.)

H0150

H0150

H0150 (From here we have the delivery note text)

H0150

H0150

H0150

H0150

H0150

There will be a mapping in the integration so it I can handle the data in that mapping.

Would it be simple to split the texts in the content conversion or should I do it in the mapping?

Either way how will I do it?

Best Regards

Kalle

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    Posted on Feb 11, 2014 at 03:07 PM

    Hi Kalle,

    Check if this satisfy your requirement,

    1. Create a UDF with following code.

    Execution Type: All Value of a Queue.

    2. Do the mapping with node Text and ContextTextLanguage as shown below.

    Output will be like

    Regards

    Jitender


    code.JPG (31.6 kB)
    code.JPG (88.6 kB)
    code.JPG (67.3 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      It seems you are mapping source lineItems to target item. so it is creating two items for each message.

      the logic you implemented here for TextCollection, it creates one for each <OrderHeader>.

      hence you have two TextCollection

      if you notice you have two text collection in the first message. but this is not what you wanted. correct?

      TextCollection's context has to be handled.

      may be try to share the source and target xsds here. someone can help you.

      Regards,

      Muni.

      message.jpg (99.8 kB)
  • Posted on Feb 05, 2014 at 10:19 AM

    Hi,

    You can go with Mapping .....

    Please send your source and target formats...

    Thanks,

    Sreenivas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 05, 2014 at 10:35 AM

    Hi Kalle,

    Im sorry, i dont understand what you really needs. If you want to replicate the text in each line the easiest way is to do in a mapping, if you want to omit texts the easiest way is not to pick them up in the fcc. Do you want to skip the ESR development?

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 05, 2014 at 02:00 PM

    Hi Kalle - It's easy to handle it in file sender adpater using content conversion.

    Please check the below blog on configuring your sender file adapter.

    http://saptechnical.com/Tutorials/XI/Contentconversion/page1.htm

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 07, 2014 at 10:02 AM

    Hi.

    I have attached files from source and wanted target structure.

    The problem I have is the text fields and to generate the correct structure in the target.

    BR

    Kalle


    target.xml (3.6 kB)
    source.xml (3.4 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 10, 2014 at 08:23 AM

    Please can anybody help me with an UDF to get the resultfrom last post.

    I nned to get text field 1 in first text collection.

    Text field 2-5 conncattenated into text collection 2.

    rest of the text fields conncatenated into text collection 3.

    BR

    Kalle

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 11, 2014 at 09:51 AM

    Hi,

    check if it helps you.

    create three udfs.

    1. execution type : All values of Queue

    String [] Code = {"0001","0002","003"};

    for(int i = 0;i<3;i++)

    result.addValue(Code[i]);

    2. execution type : All values of Queue

    for(int i = 0;i<var1.length;i++)

    {

    result.addValue(var1[i]);

    if(i==0||i==4)

    result.addContextChange();

    }

    3. execution type : All Values of Context


    String str = "";

    String nl = "'nl'";

    for(int i = 0; i<var1.length;i++)

    str = str+var1[i]+nl;

    result.addValue(str);

    change the context for third one.

    Regards,

    Muni


    mapping.jpg (129.3 kB)
    UDF.jpg (218.1 kB)
    result.jpg (205.2 kB)
    4.jpg (41.5 kB)
    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.