SAP workflow and IDOC processing (incoming invoices)

Torsten Schnorpfeil faq at saportal.net
Wed May 30 12:41:26 EDT 2007


Sergey, great input! EDID4 was the piece I missed! Thanks a lot for all your
input!

 

Cheers,

Torsten

 

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
Breslavets Sergey
Sent: Wednesday, May 30, 2007 2:14 AM
To: SAP Workflow Users' Group
Subject: RE: SAP workflow and IDOC processing (incoming invoices)

 

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
i've actually just thought of a better way to handle it:

 

You can do the following: Develop a 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). 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=>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
it means that your check FM was kicked out from the posting being processed
inside the IDOC posting workflow - i.e. you can be 100% certain that the
document that is being posted comes from the IDOC workflow... - You got a
match! 

Next, store 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  - 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. 

 

... instead of the Check FM you can also use a user-exit or BADI exit if
available.

 

As for the segments - look in EDI* tables, particularly EDIDC (Control
record) and EDID4(Data): every record has a segment name - you can use it to
map the SDATA field content.

 

here daddy... :)

 


 

  _____  

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
Torsten Schnorpfeil
Sent: Tuesday, May 29, 2007 9:44 PM
To: 'SAP Workflow Users' Group'
Subject: RE: SAP workflow and IDOC processing (incoming invoices)

Hi Sergey,

 

I'm doing alright, even though we have to get together sometime for a drink!

 

Actually you describes exactly what I'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  you are referring below? In what
table does SAP store the segment name and the segment value linked together?

 

OK, son. here are the questions, so show me that you are worth the big
bucks;)

 

Hope u are doing good and I hear from you soon ;)

 

Cheers,

Torsten

 

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
Breslavets Sergey
Sent: Tuesday, May 29, 2007 8:11 PM
To: SAP Workflow Users' Group
Subject: RE: SAP workflow and IDOC processing (incoming invoices)

 

Hi Torsten,  how you've been?

 

- 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)

 

- if you know the IDOC number then you can retrieve it and any associated
data from the IDOC tables where it's stored

 

- finally, if it does not work then you can pay me to do it for you...  :)

 

cheers! Serge~

 

  _____  

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
Torsten Schnorpfeil
Sent: Tuesday, May 29, 2007 4:44 PM
To: sap-wug at mit.edu
Subject: SAP workflow and IDOC processing (incoming invoices)
Importance: High

Hello WUGers,

 

We are currently implementing a IDOC scenario with SAP workflow and I have a
question, I'm seeking enlightenment:

 

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

 

-          The document number, company code and fiscal year of the
accounting document (after successful posting)?

-          How can I get the values of the IDOC segments, which were
imported previously (i.e. the data we received from the suppliers)?

 

I was looking around, but I couldn't find any promising concept. Any help
would be highly appreciated!

 

Thanks a lot,

Torsten Schnorpfeil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20070530/08856350/attachment.htm


More information about the SAP-WUG mailing list