<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = 
"urn:schemas-microsoft-com:vml" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word" xmlns:m = 
"http://schemas.microsoft.com/office/2004/12/omml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3059" name=GENERATOR><!--[if !mso]>
<STYLE>v\:* {
        BEHAVIOR: url(#default#VML)
}
o\:* {
        BEHAVIOR: url(#default#VML)
}
w\:* {
        BEHAVIOR: url(#default#VML)
}
.shape {
        BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
        font-family: Calibri;
}
@font-face {
        font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.0in 1.0in 1.0in; }
P.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
LI.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
DIV.MsoNormal {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Calibri","sans-serif"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline; mso-style-priority: 99
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline; mso-style-priority: 99
}
P.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
LI.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
DIV.MsoListParagraph {
        FONT-SIZE: 11pt; MARGIN: 0in 0in 0pt 0.5in; FONT-FAMILY: "Calibri","sans-serif"; mso-style-priority: 34
}
SPAN.EmailStyle18 {
        COLOR: windowtext; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal
}
SPAN.EmailStyle19 {
        COLOR: #1f497d; FONT-FAMILY: "Calibri","sans-serif"; mso-style-type: personal-reply
}
.MsoChpDefault {
        FONT-SIZE: 10pt; mso-style-type: export-only
}
DIV.Section1 {
        page: Section1
}
</STYLE>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]--></HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2>Torsten, you could use a "duplicate documents" logic to 
match them - i.e. invoice amount, currency, document date, vendor id, 
material/service number, etc (Invoice amount, date and vendor are usually enough 
to match 99%), but&nbsp;i've actually just thought of a better way to handle 
it:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2>You can do the following:&nbsp;Develop a&nbsp;FM to match 
the posted invoices and set it as the Check FM for the BKPF-POSTED event (you 
may need to setup FICO business event to generate it).&nbsp;Set it as "Check FM" 
so it'll kick out in the same session as the posting transaction itself(!!). 
Inside your check FM you can use  cl_swf_evt_requester=&gt;get_workitem to 
retrieve the active workitem id and check the associated task and worklfow to 
make sure it's your IDOC posting WF and not something else. If you got the right 
workitem&nbsp;it means that&nbsp;your check&nbsp;FM was kicked out from the 
posting being processed inside the IDOC posting workflow</FONT></SPAN><SPAN 
class=671452605-30052007><FONT face=Arial color=#0000ff size=2>&nbsp;- i.e. you 
can be 100% certain that the document that is being posted comes from the IDOC 
workflow... - You got a match! </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2>Next, store&nbsp;the posted document number and the IDOC 
number (from the workitem container) somewhere (in cluster or whatever) and 
complete your check FM without raising an event. Then, back in you IDOC 
processing workflow&nbsp; - after completion of the posting step retrieve the 
posted document number from the location where you have stored it previously 
from your check FM. Last step - you can match IDOC numbers to make sure you got 
the right one. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2>... instead of the Check FM you can also use a user-exit or 
BADI exit if available.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=671452605-30052007><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=671452605-30052007></SPAN><FONT face=Arial color=#0000ff 
size=2>As&nbsp;for&nbsp;the&nbsp;segments&nbsp;-&nbsp;look&nbsp;in&nbsp;EDI*&nbsp;tables,&nbsp;particularly&nbsp;<SPAN 
class=671452605-30052007>EDIDC (Control record) and </SPAN>EDID4<SPAN 
class=671452605-30052007>(Data)</SPAN>:&nbsp;every&nbsp;record&nbsp;has&nbsp;a&nbsp;segment&nbsp;name&nbsp;-&nbsp;<SPAN 
class=671452605-30052007>you can 
</SPAN>use&nbsp;it&nbsp;to&nbsp;map&nbsp;the&nbsp;SDATA&nbsp;field&nbsp;content.</FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=671452605-30052007><FONT face=Arial color=#0000ff size=2>here 
daddy... :)</FONT></SPAN></DIV>
<DIV><SPAN class=671452605-30052007><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff 
size=2></FONT><BR>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu 
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Torsten 
Schnorpfeil<BR><B>Sent:</B> Tuesday, May 29, 2007 9:44 PM<BR><B>To:</B> 'SAP 
Workflow Users' Group'<BR><B>Subject:</B> RE: SAP workflow and IDOC processing 
(incoming invoices)<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Hi Sergey,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">I&#8217;m doing alright, even though 
we have to get together sometime for a drink!<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Actually you describes exactly 
what I&#8217;m trying to do! So, I guess my 64,000 dollar questions would be: how do 
you link the data from a posted document to a IDOC document? The IDOC does not 
contain the info of the posted document (other than a number in the message, 
which is ugly and not really good to use). What is the IDOC table names&nbsp; 
you are referring below? In what table does SAP store the segment name and the 
segment value linked together?<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">OK, son&#8230; here are the questions, 
so show me that you are worth the big bucks;)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Hope u are doing good and I hear 
from you soon ;)<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Cheers,<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d">Torsten<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: #1f497d"><o:p>&nbsp;</o:p></SPAN></P>
<DIV>
<DIV 
style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<P class=MsoNormal><B><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> 
sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of 
</B>Breslavets Sergey<BR><B>Sent:</B> Tuesday, May 29, 2007 8:11 
PM<BR><B>To:</B> SAP Workflow Users' Group<BR><B>Subject:</B> RE: SAP workflow 
and IDOC processing (incoming invoices)<o:p></o:p></SPAN></P></DIV></DIV>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">Hi 
Torsten,&nbsp; how you've been?</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">- you 
can use an event handler on posting and match attributes of a posted document to 
the processed idoc - if you got a match then you got your document (and a 
number)</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">- if you 
know&nbsp;the IDOC number then you can retrieve it and any associated data from 
the IDOC tables where it's stored</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">- 
finally, if it does not work then you can pay me to do it for you... 
&nbsp;:)</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;<o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Arial','sans-serif'">cheers! 
Serge~</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p>&nbsp;</o:p></SPAN></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'">
<HR align=center width="100%" SIZE=2>
</SPAN></DIV>
<P class=MsoNormal style="MARGIN-BOTTOM: 12pt"><B><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'">From:</SPAN></B><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'"> 
sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of 
</B>Torsten Schnorpfeil<BR><B>Sent:</B> Tuesday, May 29, 2007 4:44 
PM<BR><B>To:</B> sap-wug@mit.edu<BR><B>Subject:</B> SAP workflow and IDOC 
processing (incoming invoices)<BR><B>Importance:</B> High</SPAN><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'"><o:p></o:p></SPAN></P>
<P class=MsoNormal>Hello WUGers,<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>We are currently implementing a IDOC scenario with SAP 
workflow and I have a question, I&#8217;m seeking enlightenment:<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>When I trigger a customer workflow and I have the IDOC object 
as the main object in the workflow (i.e. IDOCINVOIC), what is the best way to 
retrieve<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoListParagraph 
style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.25in">-<SPAN 
style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>The document number, company code and fiscal year of the accounting 
document (after successful posting)?<o:p></o:p></P>
<P class=MsoListParagraph 
style="MARGIN-LEFT: 0.75in; TEXT-INDENT: -0.25in">-<SPAN 
style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>How can I get the values of the IDOC segments, which were imported 
previously (i.e. the data we received from the suppliers)?<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>I was looking around, but I couldn&#8217;t find any promising 
concept. Any help would be highly appreciated!<o:p></o:p></P>
<P class=MsoNormal><o:p>&nbsp;</o:p></P>
<P class=MsoNormal>Thanks a lot,<o:p></o:p></P>
<P class=MsoNormal>Torsten Schnorpfeil<o:p></o:p></P></DIV></BODY></HTML>