<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic EDI - IDoc - User Exit - Code - Problem - Help - Wanted in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/edi-idoc-user-exit-code-problem-help-wanted/m-p/4180587#M999285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi EDI Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have extended ORDERS05 IDOC twice. &lt;/P&gt;&lt;P&gt;ZVKSEG1 is the the segment under extended idoc ZVKORDRS05. This is for one partner. &lt;/P&gt;&lt;P&gt;Z1DATESH01 is the segment under extended idoc Z1ORDER05. This is for another partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have completed the configuration thing in WE82 for both the extensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the requirement is, whenever a PO is created for the first partner - 100290, the IDoc generated should contain the extra segment ZVKSEG1 and whenever PO is created for the second partner - 10099,the Idoc generated should contain the extrasegment Z1DATESH01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using WE20, i have added the extended IDoc type in both the partner profiles under ORDERS message type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i've written the user exit for this using EXIT_SAPLEINM_002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; tables: edidc.

data: z_edidd like edidd occurs 0 with header line.
data: y1dath01 like z1datesh01.
data: yvkseg1 like zvkseg1.

if edidc-rcvprn = '10099'.
z_edidd[] = int_edidd[].

loop at z_edidd.

if z_edidd-segnam  = 'E1EDK01'.
read table z_edidd  with key segnam  = 'Z1DATESH01'.
if sy-subrc &amp;lt;&amp;gt; 0.

y1dath01-DELDATE = sy-datum.
clear z_edidd.

z_Edidd-sdata = y1dath01.
z_Edidd-segnam = 'Z1DATESH01'.

append z_edidd.

endif.
endif.

endloop.

 int_edidd[] = z_edidd[].

elseif edidc-rcvprn = '100290'.
z_edidd[] = int_edidd[].

loop at z_edidd.

if z_edidd-segnam  = 'E1EDK01'.
read table z_edidd  with key segnam  = 'ZVKSEG1'.
if sy-subrc &amp;lt;&amp;gt; 0.

yvkseg1-name1 = 'ZVK Chemicals'.
clear z_edidd.

z_Edidd-sdata = yvkseg1.
z_Edidd-segnam = 'ZVKSEG1'.

append z_edidd.

endif.
endif.

endloop.

 int_edidd[] = z_edidd[].
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please go through the code and tell me where did i go wrong. The extra segments are not being created for both the partners. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created PO using ME21n once for each vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2008 22:58:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-07-23T22:58:19Z</dc:date>
    <item>
      <title>EDI - IDoc - User Exit - Code - Problem - Help - Wanted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edi-idoc-user-exit-code-problem-help-wanted/m-p/4180587#M999285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi EDI Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have extended ORDERS05 IDOC twice. &lt;/P&gt;&lt;P&gt;ZVKSEG1 is the the segment under extended idoc ZVKORDRS05. This is for one partner. &lt;/P&gt;&lt;P&gt;Z1DATESH01 is the segment under extended idoc Z1ORDER05. This is for another partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have completed the configuration thing in WE82 for both the extensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the requirement is, whenever a PO is created for the first partner - 100290, the IDoc generated should contain the extra segment ZVKSEG1 and whenever PO is created for the second partner - 10099,the Idoc generated should contain the extrasegment Z1DATESH01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using WE20, i have added the extended IDoc type in both the partner profiles under ORDERS message type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i've written the user exit for this using EXIT_SAPLEINM_002.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; tables: edidc.

data: z_edidd like edidd occurs 0 with header line.
data: y1dath01 like z1datesh01.
data: yvkseg1 like zvkseg1.

if edidc-rcvprn = '10099'.
z_edidd[] = int_edidd[].

loop at z_edidd.

if z_edidd-segnam  = 'E1EDK01'.
read table z_edidd  with key segnam  = 'Z1DATESH01'.
if sy-subrc &amp;lt;&amp;gt; 0.

y1dath01-DELDATE = sy-datum.
clear z_edidd.

z_Edidd-sdata = y1dath01.
z_Edidd-segnam = 'Z1DATESH01'.

append z_edidd.

endif.
endif.

endloop.

 int_edidd[] = z_edidd[].

elseif edidc-rcvprn = '100290'.
z_edidd[] = int_edidd[].

loop at z_edidd.

if z_edidd-segnam  = 'E1EDK01'.
read table z_edidd  with key segnam  = 'ZVKSEG1'.
if sy-subrc &amp;lt;&amp;gt; 0.

yvkseg1-name1 = 'ZVK Chemicals'.
clear z_edidd.

z_Edidd-sdata = yvkseg1.
z_Edidd-segnam = 'ZVKSEG1'.

append z_edidd.

endif.
endif.

endloop.

 int_edidd[] = z_edidd[].
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please go through the code and tell me where did i go wrong. The extra segments are not being created for both the partners. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created PO using ME21n once for each vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me out guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2008 22:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edi-idoc-user-exit-code-problem-help-wanted/m-p/4180587#M999285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-23T22:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: EDI - IDoc - User Exit - Code - Problem - Help - Wanted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/edi-idoc-user-exit-code-problem-help-wanted/m-p/4180588#M999286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I myself fixed this problem. I made use of XLFA1-LIFNR to manipulate the partner numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 02:49:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/edi-idoc-user-exit-code-problem-help-wanted/m-p/4180588#M999286</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-24T02:49:15Z</dc:date>
    </item>
  </channel>
</rss>

