cancel
Showing results for 
Search instead for 
Did you mean: 

How to access complete queue to create a map in target structure in PI 7.31

Former Member
0 Kudos

Hi everybody,

I've got a not so complex task but still I can't get the mapping done. The Incoming file is a xml document with a very flat hierarchy. Also it is just one context, so no context change within the mapping. What needs to be done is, that the target strcuture needs to be a map with the key and vale entries of the source file. I've tried to make it a liitle bit more visual:

The source field are optional and therefore I can not just create a target datatype with all the possibilities, as the source file can have 1 up to 30 entries.

I've tried to access the incoming message in a udf and the build the regarding map. But I had no luck there. Can anyone of you provide some help?

regards

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've solved this problem by myself. As solution I simply cloned the output structure via a mapping as often as needed via a UDF that checks if the orginal field value, on which the target nodes should be created exists.

Former Member
0 Kudos

hi,

can you please share your udf code which fixed this issue.

facing similar issue and trying to sort this out.

Thanks much in advance.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hey,

Are the key/value combinations not pulling through the values at all?

How I would do it is:

Create add a variable [keyValData] with the example mapping

<a>-<1> -> *keyValData

Then for the key/value pair

*keyValData -> Key

*keyValData -> Value

This logic is based your picture showing that the key and value are sharing a source field.

Note: In this case you would not need a UDF.

Former Member
0 Kudos

Unfortenuatley not. They are just insert in the source structure. But in the target structure I need a entry in the map based on every entry.

Treasure Mathala wrote:

Hey,

This logic is based your picture showing that the key and value are sharing a source field.

Note: In this case you would not need a UDF.

The name of the node needs to be the key-entry an it's value needs to be within the value:

<a>sample_1</a>

<b>sample_2</b> 

needs to become

<map>

     <key>a</key>

     <value>sample_1</value>

     <key>b</key>

     <value>sample_2</sample>

</map>

regards

Chris

praveen_sutra
Active Contributor
0 Kudos

Hi Chris,

please use all values of the queue in Execution type of the UDF as shown in the image below.

thanks and regards,

Praveen T

0 Kudos

hi chris,

follow this link same as 7.31 also http://scn.sap.com/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-l...

it use full to u

Thanks

srikanth