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

Mapping from Single Text field under Items to multiple fields in target

Hi Friends

I have a scenario where under Items(0...unbounded) there is a Text field in the source structure , for every text field that comes under item it needs to be mapped to a Address Line field like Line1, Line2, Line3 etc. up to Line10.So under first Item whatever Text comes it is mapped to first Line i.e Line1, next whatever Item comes , its Text value is mapped to Line2 and so on. Could anyone help me on this , can this be done using standard functions or do we need a udf, if we need a UDF , would really appreciate if anyone can provide code.

mapping.png (16.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 06, 2014 at 01:04 PM

    Hi Arjun,

    You can very much do it with standard functions.

    Can I ask you something ? In your source table can you place a counter indicating row ? ( 1,2,3, ??)

    In that case it becomes straight forward. We handled similar situation like this..

    1. Changed the context of counter field in source to one level higher.

    2. Placed a check of counter

    3. Passed line to target based on condition.

    Please check if this works.

    Thanks..

    regards,

    Omkar.

    Add a comment
    10|10000 characters needed characters exceeded

    • Of course you can do with standard functions.... provided UDF for simplification.

      you just need to adjust constant value..

      change constant value to "0" and copyValue[0] and map it to line1

      change constant value to "1" and copyValue[1] and map it to line2

      change constant value to "2" and copyValue[2] and map it to line3 etc...

      standard.JPG (30.4 kB)
  • Posted on May 06, 2014 at 12:53 PM

    Hi Arjun -

    Can you try below mapping.. you just need to change the constant value.. 1..2.. 3..


    mapping.JPG (15.3 kB)
    udf.JPG (36.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 07, 2014 at 11:10 AM

    Hi Arjun,

    Check below mapping.

    Regards,

    Pranil.


    Image2.png (23.9 kB)
    Image1.png (31.2 kB)
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Pranil , I have used your mapping and it is working great I used yours because you had given me screenshots for both the mapping as well as the result and also it is more simpler , I think Harish's solution will also work , so I am grateful to both of you. Thank you guys for such a quick solution.

  • Posted on May 06, 2014 at 12:43 PM

    Hi Arjun,

    Have you tried with the standard function useOneAsMany?. Check this links to understand this function:

    https://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 07, 2014 at 09:21 AM

    I think Hareesh gampa has provided the right answer to it it cant be made any simple since target fields are all different, it is really an extrememly simple mapping.

    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.