cancel
Showing results for 
Search instead for 
Did you mean: 

XI Mapping - understanding contexts

Former Member
0 Kudos

Hello,

I have a PO idoc that I am trying to map from R/3 to a proxy in SUS (Supplier Self Services). I need to allow each line item to have a "ship from location" address.

The Idoc structure looks like this: ZORDERS1.IDOC.E1EDP01.Z1EDPA1.PARVW = "ZS",

E1EDP01 is repeated for each line item. If PARVW within Z1EDPA1 = "ZS" then there is a "ship from location" assigned.

My test PO has 3 line items and line items 1 and 3 have "Ship From locations" assigned. When I map the ship from locations the first line item has the ship from location data, the second shows "Ship From Location" but it shows no data, the third line item doesn't even show the text "Ship From Location".

I believe this has to be a context issue but I don't understand how it should be set up.

Any ideas?

Thanks,

Matt

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've read the blog and changed the context settings with no success.

Guarav - what do you mean by: "If you share the source and target its easy to resolve this."

What function is missing that will allow my map to show the ShipFromLocation when it appears at the item level?

Thanks,

Matt

Former Member
0 Kudos

Hi Matt

I was asking for source and target structure. As my assumption was out of many fields some fields are not bringing value and may need to have UDF or so.

Anyhow structure is simple we dont need any UDF as such to do this.

I think if you do have ZS coming for all the nodes where ship from location is present then solution given by Pooja can work for you.

Else you can even try with

PARVW - -> exists -> createif --> ShipFromLocation

Thanks

Gaurav

Answers (8)

Answers (8)

Former Member
0 Kudos

Thanks, everyone! I used the following as suggested and it worked:

PARVW - -> exists -> createif --> ShipFromLocation

I had to use this at the top level of each node within ShipFromLocation. (nodes: Address and PhysicalAddress) Also, I had to set the context of PARVW to the E1EDP01.

This works and the problem is solved.

Thanks,

Matt

Former Member
0 Kudos

With the above test sample and the mapping I just described I am getting a ShipFromLocation on the first line item, a blank node for ShipFromLocation on the second line item, and no ShipFromLocation node on the third line item.

Thanks,

Matt

Former Member
0 Kudos

Hi Matt,

In the given input data, you have two E1EDP01; then why are you generating 3 line items on the target end ?

Former Member
0 Kudos

This does not seem complex but for some reason I am getting odd results.

I have:

equalsS - String Compare PARVW and ZS = ShipFromLocation

PARVW context = Z1EDPA1

and all the address fields contexts are also = Z1EDPA1

Thanks,

Matt

Former Member
0 Kudos

IDOC structure (simplified):

<ZORDERS1>
   <MANDT>050</MANDT> 
   <DOCNUM>0000000057208371</DOCNUM> 
   <E1EDK01>
        <CURCY>USD</CURCY> 
        <WKURS>1.00000</WKURS>
   </E1EDK01>
   <E1EDP01>
        <POSEX>00001</POSEX> 
        <ACTION>001</ACTION> 
        <PSTYP>0</PSTYP> 
        <MENGE>50.000</MENGE> 
        <MENEE>PC</MENEE> 
        <Z1EDPA1>
              <PARVW>ZS</PARVW>
              <LIFNR>0004000073</LIFNR> 
              <NAME1>ZEICHMAN MANUFACTURING INC.</NAME1> 
              <STRAS>5985 CLAY AVENUE SW</STRAS> 
              <ORT01>Grand Rapids</ORT01> 
              <PSTLZ>49548</PSTLZ> 
              <LAND1>US</LAND1> 
              <REGIO>MI</REGIO> 
        </Z1EDPA1>
   </E1EDP01>
   <E1EDP01>
        <POSEX>00002</POSEX> 
        <ACTION>001</ACTION> 
        <PSTYP>0</PSTYP> 
        <MENGE>40.000</MENGE> 
        <MENEE>PC</MENEE> 
        <Z1EDPA1></Z1EDPA1>
   </E1EDP01>
   <E1EDP01>
        <POSEX>00003</POSEX> 
        <ACTION>001</ACTION> 
        <PSTYP>0</PSTYP> 
        <MENGE>90.000</MENGE> 
        <MENEE>PC</MENEE> 
        <Z1EDPA1>
              <PARVW>ZS</PARVW>
              <LIFNR>0004000073</LIFNR> 
              <NAME1>ZEICHMAN MANUFACTURING INC.</NAME1> 
              <STRAS>5985 CLAY AVENUE SW</STRAS> 
              <ORT01>Grand Rapids</ORT01> 
              <PSTLZ>49548</PSTLZ> 
              <LAND1>US</LAND1> 
              <REGIO>MI</REGIO> 
        </Z1EDPA1>
   </E1EDP01>
</ZORDERS1>

XML Structure for SUS (simplified):

<PurchaseOrderRequest>
   <PurchaseOrder>
      <documentnumber></documentnumber>
      <item>
          <ShipFromLocation>
               <name></name>
               <street></street>
               <city></city>
               <state></state>
               <zip></zip>
           </ShipfromLocation>
        </item>
    </PurchaseOrder>
</PurchaseOrderRequest>

Does that help?

Thanks,

Matt

Former Member
0 Kudos

Hi Matt ,

With the given input data by you, what output are your expecting ?

You have provided the target structure, but it will be easy for us to understand if you can fill the target with the data too ?

Your case doesnt look very complex, but before I comment anything, I just wanted to make sure that I understood the requirement perfectly.

Thanks,

Pooja

Former Member
0 Kudos

HI Matt,

if PARVW equals ZS---createif----ShipFromLocation

Do you have above logic for your shipfromlocation ?

Thanks,

Pooja

Former Member
0 Kudos

Hi Matt,

The problem you are facing is because item 2 have empty <Z1EDPA1></Z1EDPA1> segment. This could be solved without touching the context as per my understanding.

You can solve it by two ways...

1. Check the existance of PARVW before you check the value ZS and then map other segments.

2. Use MapWithDefault function with some arbitrary value like XY and then check if PARVW equals ZS map the other fields to ShipFromLocation.

eg. PARVW --> MapWithDefault(XY) ---> EqualS (ZS) ---> Map other segments --> ShipFromLocation

I hope it helps to solve your problem.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Matt

I believe you not only require a context setting but even tweak mapping with UDF or standard functions may work.

As you said you want each item should have "Ship from location" but only 1 and 3 are having values. If you share the source and target its easy to resolve this.

Thanks

Gaurav

Former Member
0 Kudos

HI Matt,

Sreenivas has already provided you the great blog on context switch.

If you can provide your input or output structures, then it will be more easy to fix your mapping context issue.

Thanks,

Pooja

Former Member
0 Kudos

Hello,

Change the context from line item to its root node...from context menu

Refer this blog,

/people/riyaz.sayyad/blog/2006/04/23/introduction-to-context-handling-in-message-mapping

for more details search SDN with context handling.

Regards,

Sreenivas

former_member181962
Active Contributor
0 Kudos

Hi Matt,

Have you tried chosing the context of PARVW and PARTN as E1EDP01?

Regards,

Ravi