cancel
Showing results for 
Search instead for 
Did you mean: 

Handle text in content conversion or in mapping?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member187010
Participant
0 Kudos

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

Former Member
0 Kudos

Almost.

If we add next dimension to the problem.

I will make a multimapping of this message so many messages are coming in as one file and will create multiple messages as target.

Second message has no texts in it if I test your mapping.

Is that possible to solve?

BR

Kalle

former_member187010
Participant
0 Kudos

Hi Kalle,

Didn't get your query properly.

Are you having any trouble with the UDF.

->Second message has no texts in it if I test your mapping.

I think you are facing some issue regarding context change.

If possible can you please all possible input and output.

Regards

Jitender

Former Member
0 Kudos

Hi.

Se attached files with 2 messages in each.

Will use the mapping to make a multi mapping for splitting  the source message into one salesorder for each OrderHeader.

BR

Kalle

Muniyappan
Active Contributor
0 Kudos

Hi,

can you share your <TextCollection> mapping screen shot?

can you do the mapping like below and let us know results?


OrderHeader-->splitbyvalue(each value)-->TextCollection.

Regards,

Muni.

Former Member
0 Kudos

Hi.

Get the same result with your split function mapping.

This is how I mapped TextCollection befor I tested your split function and got the same result..


BR

Kalle

Muniyappan
Active Contributor
0 Kudos

Hi,

could  you please try below and share display queue for below one?

OrderHeader-->RemoveContext-->splitbyvalue(each value)-->TextCollection.


Regards,

Muniyappan.

Former Member
0 Kudos

Same result.


BR

Kalle

Muniyappan
Active Contributor
0 Kudos

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.

Answers (6)

Answers (6)

Muniyappan
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi.

See answer Jitenders post.

BR

Kalle

Former Member
0 Kudos

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

former_member191435
Contributor
0 Kudos

Hi Kalle,

You can do like this..

for point 1: 

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




point 2:


Text field 2-5 concatenated into text collection 2.



Point 3:


rest of the text fields concatenated into text collection 3.





UDF for last one:





Thanks,

Sreenivas








Former Member
0 Kudos

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

former_member184720
Active Contributor
0 Kudos

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

iaki_vila
Active Contributor
0 Kudos

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.

former_member191435
Contributor
0 Kudos

Hi,

You can go with Mapping .....

Please send your source and target formats...

Thanks,

Sreenivas