cancel
Showing results for 
Search instead for 
Did you mean: 

Archivelink

Former Member
0 Kudos

I am currently trying to use Archivelink to connect an external imaging system to R3. I've been through all the config steps, set up all the document types in the wizard and using certain BO types, everything works fine. The trouble arises with purchase orders, BUS2012 and standard task TS30001128 IMAGEASSIGNEARLY. BUS2012 doesn't have a create method so I created a zBUS2012 and added create to it as well as IFARCH21 for the archivelink. I basically modeled BKPF which works fine for either early or late archiving.

When I run OAWD my work item is created with no problem...which is really the only code I added to BUS2012. The problem is that after execution of the work item, TOA01 is never updated and the work item stays in the inbox. Late storage scenarios (using TS30001117) update the table fine as well as early storage with BO types that already have the create method such as BKPF.

I can't seem to figure out what I'm missing. The task fires and the container seems to have the correct information. But the update to TOA01 just never happens. Any help would be greatly appreciated.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi ,

We are trying to setup archive link for (BKPF) invoice documents using the sap note# 595563

We did all configuration steps but how to test this process on FB03/FB02 If you have further steps can you please let us know.

If you have some time please call me

Regards

Siva Ramasani.

248-875-9014

martin_nooteboom
Active Contributor
0 Kudos

Hi Siva,

Please refer to the forum guidelines [here|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] on how to post a question.

Regards,

Martin

KKilhavn
Active Contributor
0 Kudos

Is your <u>work item</u> created without problem? What about the purchase order? Not sure how this works for either BKPF/FIPP or BUS2012, but I assume ImageAssignEarly needs some sort of reference to which the image is to be assigned.

Former Member
0 Kudos

The work item is created fine. The PO is created fine as well. At that point, the PO objectID should be passed to the task container items in the BO IMAGE and the table should be updated..I assume anyway. This never happens with BUS2012.

I set up a small workflow with just the task and ran it manually. When I put the doctype that refers to BKPF in the load data, it runs perfectly and updates the table. When I run it again and only change the doctype in the load data to a PO doctype, the item is created. I run it and create the PO and save and the item never gets the terminating event IMAGE.ASSIGNED and the table is never updated. I can't really think of any way to debug the process at this particular point.

The only difference in the two doctypes is BKFP versus BUS2012. I keep coming back to my subtype ZBUS2012 but I don't know what is in BKFP that I'm missing...or even if this is the problem. I added the interface to archivelink and a create method. There's an interface.create in BKPF but that looks to be just for the invoice information...not anything to do with archivelink. There are a couple of methods in BKPF that refer to GOS but the GOS seems to work fine in my PO...it's just that my paperclip remains greyed out due to no attachments.

As far as references to imageassignearly, I have the same bindings in my workflow no matter which doctype I use in my load data. I use the same guid to the image document in either case. Any binding issues with the task would seem to be moot unless bus2012 doesn't have the container elements necessary to pass to the task. I've looked at the log container elements in both cases and I don't see anything obviously wrong but I can't think of any other reason it wouldn't work for both business objects.

Former Member
0 Kudos

I just ran the workflow manually again with both document types. The BKPF works perfectly and the BUS2012 does not. I went into the workflow log of both items and compared the containers line for line. The only difference is one container element DocumentType. If I use the documentype for BKPF it works. If not, it doesn't. The BUS2012 test did return a generic error message:

Message Text Execution interrupted

Exception 0

Symbolic name

Error Type 0

Area SWF_RUN

Message 611

Former Member
0 Kudos

After some more digging, I think I discovered the problem but I'm not sure how to correct it. In standard task TS30001128, there's a container element called OBJECTS. When I run the BKPF archive, this multiline container element has an entry which corresponds to the invoice I created. It has all the information about BKPF including all it's interfaces, methods events, etc. I'm getting none of that using my modified ZBUS2012. When I run the PO, nothing gets passed to this element. The task doesn't know the ID of the PO so I assume that's why it can't link the image.

It all seems to point back to my modified business object.

KKilhavn
Active Contributor
0 Kudos

Hmmm... Unless I have overlooked it you haven't said anything about delegation. Have you delegated BUS2012 to ZBUS2012? It is done/checked in transaction SWO1, the Settings menu.

When you delegate you should refer to object type BUS2012 instead of ZBUS2012. Not because you <u>have to</u>, but standard solutions refer to e.g. BUS2012, they don't know your object type unless you can customize it.

I don't know if this will solve your problem, but it would be worth a try I think.

Former Member
0 Kudos

Yes I tried delegating and referring to BUS2012 in OAD5 but the OBJECTS container element still doesn't get populated.

I wish I understand a little more about the flow of the process.

I run OAWD and archive an image. At this point, the Archivelink setup knows my business object BUS2012 and my task TS30001128. It creates a work item for the task and sends it to my inbox. But the task uses BO IMAGE and the only reference to BUS2012 is the "virtual" container element OBJECTS. I'm not sure at what point this element gets assigned. It must be after I execute the item and save the PO otherwise there's no actual BO to reference and "bind"...for lack of a better term. I just don't understand how it knows to put the reference to the PO/Invoice in the OBJECTS container of the standard task. I just know that it does with an invoice and BKPF. That leads me to think there's code in the standard BO BKPF that I'm missing in my ZBUS2012 but I've looked everywhere and can't really see it. Beyond the simple code addition to the create method, every interface/method etc reference the same program names that BKPF uses.

I've also looked at some of the code in the IMAGE BO and it looks like it (at most) references items in the TOA01 table...perhaps it actually creates the entry at some point but I didn't see it. I'm not sure at what point the update to this table is supposed to happen. And the only link between the standard task and BUS2012 is the configuration in OAD5 which does nothing (I think) but update config tables. I would think there needs to be a resulting value of the object from the create event somehow bound to OBJECTS in the task container. I found another object with the ISARCH21 interface that has a result parameter for the object which seems like what I'm talking about but BKPF doesn't have one and apparently doesn't need it because it does work.

I've pretty much run out of ideas to try.

Former Member
0 Kudos

Wow is been a month. I decided to post again in case anyone runs into a similar problem with archivelink.

I was on the right track earlier with reference to the OBJECTS container element that wasn't getting populated in my archive task TS30001128. The question remained why not? After working on some other things the past few weeks, I came back to this problem with a blank slate. I spent a few mins on google and instead of searching for archivelink...I searched for IFARCH21. This the archivelink interface. This led me the following page:

http://www.jt77.com/business-warehouse/work-flow-15703.html

A reference is made there to an FM WF_COMMIT:

"My advice would be to debug the code from the point you click 'save'. There should be a function module in there just before the 'commit work' statement is met, usually called 'WF_COMMIT'".

Followed by a solution:

"I had to change the standard SAP code to add the 'WF_COMMIT' FM just before the transaction's 'commit work' statement"

I decided to debug the create method of BKPF (an invoice which works) and BUS2012 (a PO which does not) with a breakpoint at WF_COMMIT. And to my surprise, BKPF has a call to this FM and BUS2012 does not. The solution was (as mentioned in the link) to add a reference to the FM just before the commit work statement...in my case inside the include MM06EF0B_BUCHEN. I added an enhancement with the same call as in BKPF:

ENDENHANCEMENT.

ENHANCEMENT 25 ZWF_COMMIT. "active version

*

data : xwfla(1) TYPE c.

DATA: BEGIN OF wfltab OCCURS 3.

INCLUDE STRUCTURE wfas2.

DATA: END OF wfltab.

wfltab-asgtp = 'BUS2012'.

wfltab-asgky = ekko-ebeln.

APPEND wfltab.

CALL FUNCTION 'WF_COMMIT'

IMPORTING

called_by_workflow = xwfla

TABLES

assignments = wfltab

EXCEPTIONS

assignment_error = 01

db_error = 02.

CASE sy-subrc.

WHEN 1.

MESSAGE a503 WITH wfltab-asgtp.

WHEN 2.

MESSAGE a504.

ENDCASE.

ENDENHANCEMENT.

$$-End: MM06EF0B_BUCHEN_03----


$$

After adding this code, the early storage archivelink task works perfectly.

A checklist to adding this functionality to a business object without archivelink:

1. Create subtype of BO

2. Add a create method with code and a parameter to pass the appropriate create transaction (simply get the transcode from the container and do a call transaction).

3. Add the interface IFARCH21.

4. Make sure WF_COMMIT is called just prior to the COMMIT WORK statement.

5. Delegate to new business object subtype.