cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping - Position Field to Header Field

Former Member
0 Kudos


hello,

i need to map one Position field into one Header field.

with n-records on the left site it always maps the position field of record 1 into all n-idoc Header fields.

<record1>

    <headerfield1>1</headerfield1>

    <position>

          <positionsfield1>1</positionsfield1>

    </position>

    <position>

          <positionsfield1>1</positionsfield1>

    </position>

    <position>

          <positionsfield1>1</positionsfield1>

    </position>

</record1>

<record2>

    <headerfield1>2</headerfield1>

    <position>

          <positionsfield1>2</positionsfield1>

    </position>

    <position>

          <positionsfield1>2</positionsfield1>

    </position>

    <position>

          <positionsfield1>2</positionsfield1>

    </position>

</record1>

Problem exists with positionfield1. we Need to map that field into a Header idoc field. so a simple n...to 1 mapping.

every record builds one idoc. actually the second idoc is filled with positionfield1 out of record1.

<idoc1>

<headerfield1>1</headerfield1>

<headerfield2>1</headerfield1>

</idoc1>

<idoc1>

<headerfield1>2</headerfield1>

<headerfield2>1</headerfield2>

</idoc2>

any idea?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Simon,

I think if you want to populate one value depending of the context you can use the function useOneAsMany.

Check these links:

Explain node functions - Process Integration - SCN Wiki

http://saprainbow.com/sap-pi-mapping/useoneasmany-explained-in-easy-example/

Regards.

Former Member
0 Kudos

Hi Vila,

useOneAsMany is for mapping 1-header to n-positions correct?

i Need to map on field of n... into one field.

i just mapped one to one. but everytime it maps the positionfield of record1 into all idocs.

regards!

iaki_vila
Active Contributor
0 Kudos

Hi Simon,

Can the field from the source be different?

Have you tried use a graphical variable (available from PI 7.1):

Regards.

Answers (0)