cancel
Showing results for 
Search instead for 
Did you mean: 

Help with adding PO link to workitem.

shailendra_jain4
Participant
0 Kudos

Hi All,

I need help in adding the link for PO like below to the work item.

I was able to add it manually by passing BUS2012 to the '_Adhoc_Objects', but how to add it programmatically.

P.S. I'm using classes and not BO

Regards,

Shailendra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

What do you mean by programmaticaly ?

One thing you can do is create one workflow containrr of type of BO BUS2012.

then get this container instantiated by calling method GENERICINSTAINTIATE of BO SYSTEM in an activity via task. You can pass OBJTYPE as BUS2012 and OBJKEY as PO number.

Finally bind instantiated workflow container to _adhoc_object container of workitem task.

Regards

ibrahim

shailendra_jain4
Participant
0 Kudos

Hi Ibrahim,

Can the above process be done using classes instead of BO as I've never worked with BO before.

Regards,

Shailendra

Former Member
0 Kudos

Hi

It doesnt require much efforts  and BO knowledge to instantiate BO in workflow containrr.

you juat need to call the method in activity task as I mentioned above.

also like BO, I dont think there can be a concept of default method in classes. But you can give a try in your class constructor method to call transaction to display PO. then bind your workdlow container having class instance to _adhoc_object container of workitem task.

Regards

ibrahim

former_member185167
Active Contributor
0 Kudos

Hello,

Just create a step that calls task TS01200205 and pass in the correct values. No knowledge of BO required.

regards

Rick Bakker

shailendra_jain4
Participant
0 Kudos

Hi Ibrahim,


I went ahead with your approach to solve my issue.

But while trying to bind workflow container of type "BUS2012" to "&OBJECTINSTANCE&" of workitem task I was getting a binding error: "An object compatible with '[BO.]' was expected as the source expression".

So directly I did binding of "_adhoc_object" with "&OBJECTINSTANCE&" and it worked.

Thanks & Regards,

Shailendra

Answers (1)

Answers (1)

pokrakam
Active Contributor
0 Kudos

Hello Shailendra,

Of course this this can be done completely in classes and don't let anyone tell you otherwise. Your object needs to implement IF_WORKFLOW, and the BI_OBJECT~EXECUTE_DEFAULT_METHOD method will be called when the hyperlink is clicked.

If you are not familiar with using classes in WF, you do need to Instantiate them correctly using the the two LPOR methods. I can recommend the WF book (3rd edition due any day now), or Jocelyn's excellent blogs found right here on SCN.

Regards,

Mike

shailendra_jain4
Participant
0 Kudos

Hi Mike,

Thanks for your inputs.

But I just need to bind the element "_adhoc_object" by passing BUS2012 and PO# and rest sap will take care. I don't see why we'll need to implement EXECUTE_DEFAULT_METHOD. Can you pour some light?

Regards,

Shailendra

pokrakam
Active Contributor
0 Kudos

Hi Shaliendra,

Of course you can go that route, but you specifically asked if it was possible to do this via classes instead of BO. Yes it can be done, you don't need BOR, and I would even recommend that route.

Regards,

Mike