Skip to Content
avatar image
Former Member

Using an intermediate variable while mapping

Hi helpers!

I'm still learning and I wonder how can I do the next:

I have one source file that has two types of lines, one header and 'n' normal lines. There is an field in the header with information I need in every normal line of the target file.

I imagine that there is a way to record the value in that field into a variable so I can access to it for every target line.

Hope I've explained myself. Thankyou!.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 03, 2006 at 02:52 PM

    Hi,

    There is a concept of Global Container. You can use this for this reason.

    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm

    http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm

    And you can write small java user defined to achieve this without using Global Container.

    Hope this helps.

    Regards,

    Moorthy

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 03, 2006 at 02:52 PM

    hi,

    you can use global variables if you are on SP14 or above.

    Just save the value in the global variable and then use it in your mapping for other fields.

    Refer this blog on the same,

    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14

    If you are not on SP14, you can use the CONCAT function available in the standard functions-- TEXT functions and concat this value with the value of other fields also,

    Refer top this link for standard functions in XI,

    http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm

    Regards,

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ok, I now how to create a variable now but, how do I initialice it with the value of a field? May I write something about the payload?

      Sorry, I'm not really proud of my Java. Thanks!

  • avatar image
    Former Member
    Apr 03, 2006 at 02:56 PM

    HI,

    If i am getting you correctly , you want to map a value from the header of the source to the target field on the details (normal) lines.

    I think this can be achieved through a normal mapping to .

    just map the value in the source header to the target field.

    so the target field will extract the value from the header source field whenever the line occurs.

    Thanks

    Nikhil

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Sirupa,

      I tried the useOneAsMany node function and it works perfectly for this scenario.

      It worked without the context change also.

      Regards,

      Smitha