cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping for Sales Order Idoc

Former Member
0 Kudos

Hi Experts,

I am facing problem with mapping for standard SalesOrder Idoc ORDERS.ORDER05.

My Source Structure is: X12 EDI850

<G_SPO1> (occrance 1..100000)

<S_PO1> (occurance is 1..1)

                  <D_234/>

                  <D_234_2/>

                  <D_234_3/>

                  <D_234_4/>

                  <D_234_5/>

                  <D_234_6/>

                  <D_234_7/>

                  <D_234_8/>

                  <D_234_9/>

                  <D_234_10/>

</S_PO1>

</G_SPO1>

Target Structure is:

E1EDP01

    --->E1EDP19

                --->IDTNR

Functionality is passing material numbers of EDI customers to IDTNR field in E1EDP19 filed under segment E1EDP01.

From source i will get set of material numbers, for one set 10 material numbers(In source you can find 10 fields for 10 material numbers)

Requirement: I need to send those material numbers to IDTNR (One to one mapping ).

For getting 10 material numbers i just duplicated segment E1EDP19 in target side and mapped one field of source to IDTNR target in each segment. Totally mapped 10 source fields in 10 segments.

If 20 material numbers I will get two sets <G_SPO1> will repeat two times, each time 10 material numbers. So I mapped G_SPO1 to E1EDP01

S_PO1 to E1EDP19.

My out put is coming as 10 E1EDP19 segments under E1EDP01 if 10 materail numbers.

But problem is ECC team asking to get one E1EDP19 line item value under E1EDP01 line item header. They are not accepting duplicate E1EDP19 segments under header E1EDP01.

How to acheive this with my requirement.

Appreciate your hellp on this.

Thanks & Regards,

A.Neelima.

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Neelima,

One possible option is to duplicate E1EDP01 10 times and map with D_234 to D_234_10. When you get 2 sets of S_PO1 then you get 2 D_234 and E1EDP01 will repeat accordingly.

regards,

Harish

Former Member
0 Kudos

I am trying the same now Harish, Here S_PO1 won't repeat its 1..1, G_SPO1 will repeat thats the confusion. lets see how it works 

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

you can just set the context of D_234 (to D_234_10) to G_SPO1 then it will repeat as many times as G_SPO1. Please let me know if you still have any doubt.

regards,

Harish

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

Are you using the B2B add-on supplied by SAP or some other EDI solution?  If you are using the B2B add-on then they do include some queue functions which will assist in combining the values D_234...D_234_10 into a queue and then you can use something like what Harish has mentioned:

queue of values at G_SP01 -> E1EDP01 and for fields

blank constant -> E1EDP19 since it looks like it will always be created once per E1EDP01

queue of values at G_SP01 -> splitByValue -> IDTNR

Regards,

Ryan Crosby

Former Member
0 Kudos


Thanks for your inputs harish, I will try that.

Lets take scenario, Only 5 materials are coming from source, In that case i need only 5 E1EDP01 segments in target side with 5 material numbers,  How to acheive this?

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

If the occurrence of E1EDP01 is 0 to unbounded then segment will only generate for 5 line item without any error.

regards,

Harish

Former Member
0 Kudos

Correct, But i will get 5 more empty E1EDP01 segments right, Because i have created 10 duplicate segments in target structure.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

The E1EDP01 segments will mapped with D_234_6 to D_234_10. so if the source segment is not present then you will not get empty E1EDP01 segment.

And if you get empty D_234_6 in source then you need to put extra logic in mapping to suppress those.

regards,

Harish

Former Member
0 Kudos

Hi Harish,

I have created 10 E1EDP01 duplicate segments in target structure, Mapped D_234 to D_236_10 to IDTNR field under E1EDP19 in each segment.

Mapped S_PO1 to E1EDP19

Below is the mapping for E1EDP01. If i pass two sets with one material number in each, I should get 2 E1EDP01 segments as result, but i am getting 10.

Thnaks & Regards,

A.Neelima.

Former Member
0 Kudos

I will get XML from third party which will convert EDI 850 to XMl and sent to PI.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

from the above mapping screenshot you should get only 2 segment in target and i am not sure why you are getting 10 segments. Can you provide the input xml?

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Below is the input XML which i have tested.

<G_SPO1>

<S_PO1>

<D_234>1</D_234>

<D_234_2/>

<D_234_3/>

<D_234_4/>

<D_234_5/>

<D_234_6/>

<D_234_7/>

<D_234_8/>

<D_234_9/>

<D_234_10/>

</S_PO1>

</G_SPO1>

<G_SPO1>

<S_PO1>

<D_234/>

<D_234_2>4<D_234_2>

<D_234_3/>

<D_234_4/>

<D_234_5/>

<D_234_6/>

<D_234_7/>

<D_234_8/>

<D_234_9/>

<D_234_10/>

</S_PO1>

</G_SPO1>

Thanks & Regards,

A.Neelima.

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

You will need to use ifWithoutElse to achieve this mapping as Harish stated because in this context your XML elements do exist so the mapping runtime will create those target elements.  That XML corresponds to nodes with an empty string as a value but they do exist.

Regards,

Ryan Crosby

Former Member
0 Kudos

Thank you. Now understood why the segment is creating in target.

Can you help to achieve the mapping. Where i need to use if with out else, on which segment and whats the condition i need to use?

Thanks & Regards,

A.Neelima.

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

It would be something like this potentially:

Regards,

Ryan Crosby

Former Member
0 Kudos

Ryan, Harish,

I am this condition, lets see how it works, Give any alternative ideas for this functionality if it won't works.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelime,

Pls try as Ryan given in the screenshot.

regards,

Harish

Former Member
0 Kudos

Hi Harish, Ryan,

Now i am getting two P01 segements as exected if i give two sets of input data with one material number in each.

Another problem

If i give two sets of data with two material numbers in each, i should get 4 P01 segments rights. Still i am getting only two P01 segments I am troubling you alot... But requirement is demanding me like that

One more thing, I have changed context of D_234 (1 to 10) fields from S_PO1 to G_SPO1, still facing the problem.

Appreciate your help.

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

Small correction, The above mapping suggested by Ryan is working only for one set of set. If i give 5 material numbers in first set iam getting 5 P01 segments, If i give two sets of data, its not working.

It taking only first occurance of G_SPO1. Whats the change we need to do for taking second occurance of G_SPO1.

Mapping:

D_234 to D_234_10 ----> IDTNR

S_PO1 ----> P19

P01 segment maping is below.

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

Can anyone help me on this.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

what is the context of D_234_4 in the above screenshot and can you also past the display screenshot at if without else?

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Context of D_234_4 is G_SPO1.

Below is the display queue of If with out else function.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

the problem is with context, you need the value in one context. Can you change the context to parent level?

regards,

Harish

Former Member
0 Kudos

Hi Harish,

I have changed the context to parent level and tried, but no luck.

If I display the queue for Target segment E1EDP01 is showing two values which i have passed in two sub trees.

But in output only one segment E1EDP01 creating with 9876 (Value in first tree), Its not creating with 1234 (Value in second tree).

What will be the problem, Normally it should create two segments right.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

please use remove context after if without else. this should work.

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Oh my god, Its working... Thank you so much Harish for your prompt responce and especially for your patience .. I can enjoy my week end now

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

Hi Harish,

One more doubt on the same mapping.

Here under E1EDP19 KTEXT field is there, for which value will come from different source field, not from G_SPO1.

Source structure:

S_ST

     S_PID

           D_356

     G_SPO1

           S_PO1

                 D_234(1 to 10)

Target Structure: (These are 10 segments as discussed in above chain)

E1EDP01

    E1EDP19

           IDTNR

           KTEXT

Now mapping is fine for IDTNR, I am getting KTEXT field for only first tree, not getting KTEXT for remaining sub trees.

Mapping for KTEXT i kept one to one.

Thanks & Regards,

A.Neelima.

Former Member
0 Kudos

just to add i need to pass D_356 to KTEXT.

Thanks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

what is the relation between D_234 and D_356? Do you need to pass D_356 for all D_234 in first context?

regards,

Harish

Former Member
0 Kudos


There is no relation between D_234 and D_356.

I want to pass D_356 to KTEXT in all E1EDP01 segments which ever i will get based on the condition we implemented for E1EDP01.

Present its coming only for E1EDP01 first segment (for which i used condition with D_234), its not coming for remaining 9 E1EDP01 segments (for which i used conditions with D_234_2 to D_234_10)

If i pass sample input payload:

<S_ST>

<S_PID>

<D_350>Description</D_350>

</S_PID>

<G_SPO1>

<S_PO1>

<D_234>1</D_234>

<D_234_2/>2</D_234_2>

<D_234_3/>

<D_234_4/>

<D_234_5/>

<D_234_6/>

<D_234_7/>

<D_234_8/>

<D_234_9/>

<D_234_10/>

</S_PO1>

</G_SPO1>

<G_SPO1>

<S_PO1>

<D_234>3</D_234>

<D_234_2>4<D_234_2>

<D_234_3/>

<D_234_4/>

<D_234_5/>

<D_234_6/>

<D_234_7/>

<D_234_8/>

<D_234_9/>

<D_234_10/>

</S_PO1>

</G_SPO1>

</S_ST>

Coming Output Now: (KTEXT field is missing in last two segments)

<E1EDP01>

<E1EDP19>

<IDTNR>1</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>3</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>2</IDTNR>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>4</IDTNR>

</E1EDP19>

</E1EDP01>

Expected Output:

<E1EDP01>

<E1EDP19>

<IDTNR>1</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>3</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>2</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>4</IDTNR>

<KTEXT>Decription</KTEXT>

</E1EDP19>

</E1EDP01>

Thnaks & Regards,

A.Neelima.

Harish
Active Contributor
0 Kudos

Hi Neelima,

this one is bit complicated. you need to pass the text to all D_234 segments. If you have same text in all context then use copy value.

Else write a small udf and repeat each text (in each context) 10 times.

regards,

Harish

Former Member
0 Kudos

Hi Harish,

Thanks for your reply.

I have same text, and that same text i need to pass to all D_234 segments from D_234 to D_234_10 in al P01 segments. I have used copy value but its not working.

Its working only for D_234 if i give two sets of material numbers with two D_234 numbers i am getting KTEXT field in both two P01 segments. It not working for remaining fields D_234_2 to D_234_10.

Thanks & Regards,

A.Neelima.

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

You could create a target variable from the D_352 data.  Then you can execute any logic for assignment of that text data based on your requirements.  If you are simply copying that data from the ST level to every PO1 segment then useOneAsMany should also be an option.

Regards,

Ryan Crosby

Answers (1)

Answers (1)

Ryan-Crosby
Active Contributor
0 Kudos

Hi,

Can you share an a sample of your source XML related to PO1 segments with multiple groups and then the expected target XML for the IDoc structure?

Regards,

Ryan Crosby

Former Member
0 Kudos

Hi Ryan,

Here you go.

Sample Input XML:

<G_SPO1>
<S_PO1>
<D_234>1</D_234>
<D_234_2>2</D_234_2>
<D_234_3>3</D_234_3>
<D_234_4>4</D_234_4>
<D_234_5>5</D_234_5>
<D_234_6>6</D_234_6>
<D_234_7>7</D_234_8>
<D_234_8>8</D_234_8>
<D_234_9>9</D_234_9>
<D_234_10>9</D_234_10>
</S_PO1>
</G_SPO1>
<G_SPO1>
<S_PO1>
<D_234>11</D_234>
<D_234_2>12</D_234_2>
<D_234_3>13</D_234_3>
<D_234_4>14</D_234_4>
<D_234_5>15</D_234_5>
<D_234_6>16</D_234_6>
<D_234_7>17</D_234_8>
<D_234_8>18</D_234_8>
<D_234_9>19</D_234_9>
<D_234_10>20</D_234_10>
</S_PO1>
</G_SPO1>

Expected Output XML: (I Just kept dots in between, it means same structure should continue from number 5 to 19, IDTNR value should come from 1 to 20 in each E1EDP01 segment).

<IDOC>
<E1EDP01>
<E1EDP19>
<IDTNR>1</IDTNR>
</E1EDP19>
</E1EDP01>
<E1EDP01>
<E1EDP19>
<IDTNR>2</IDTNR>
</E1EDP19>
</E1EDP01>
<E1EDP01>
<E1EDP19>
<IDTNR>3</IDTNR>
</E1EDP19>
</E1EDP01>

<E1EDP01>

<E1EDP19>

<IDTNR>4</IDTNR>

</E1EDP19>

</E1EDP01>


:
:
:
:
:
<E1EDP01>
<E1EDP19>
<IDTNR>20</IDTNR>
</E1EDP19>
</E1EDP01>
</IDOC>

Let me know if you need more details.

Thanks & Regards,

A.Neelima.