cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Read Workflow Container Values

0 Kudos

Hello,

I need to read the Workflow Container values in my method of z business object. when i click on the work item in the SAP inbox the code SWC_GET_ELEMENT CONTAINER 'LEVEL' LEVEL. works fine in the method and give the value of container(LEVEL), but when i click on the Link under Objects & Attachments, the container table does not contains any value. so I could not get the value i am looking for.

thanks & Regards

Mohit

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

1. I am triggering my workflow using  cl_swf_evt_event=>raise also passing the key of the ZBO.

2. Copied Std DECISION task and created task containers

     a. LEVEL

     b. ZBO

3. maintained the display method of ZBO in the methods tab, binded LEVEL and ZBO of the Workflow to LEVEL and ZBO of the task.

4. Objects & Attachment Link is Coming in the Workitem as it is binded with ZBO.

5. in the display method based on level need to call required screens.


Now its is Working fine when i executes the Workitem. But when the link is clicked value of LEVEL is initial(as i checked in Debugger)

Former Member
0 Kudos

Hi Mohit,

Have you tested the Display method using SWO1?

If it is not working, can you post your code of Display method?

Thanks,

Vijay.

Richa_Gupta
Contributor
0 Kudos

Hi Mohit,

Default Method of business object(which is display in your case) should be dependent upon the key fields and attributes only and not on any container of workflow. That is the reason that the attachment is not working in your case.

What you can do to resolve this is instead of doing binding for importing or exporting parameters, write the logic inside the display method itself to get the values of required parameters directly from database tables. Other option is to make the parameters as attributes of business object but in this case please make sure that you handle the scenarios whenever this attribute is not populated.

Hope this helps you.

Richa.

former_member186746
Active Contributor
0 Kudos

Hi,

I don't think you need to.

You just maintain correct bindings from workflow step<-->workflow task<-->method.

No need to programmatically read container values.

Kind regards, Rob Dielemans

Former Member
0 Kudos

Hi Mohit,

Go to SWO1 --> Display --> Basic data --> Defaults tab.

You have to check what method maintained there.

This method only will trigger once you click on Objects & Attachments.

Thanks,

Vijay.

0 Kudos

Hi Vijay,

It's getting triggerd but the conatiner table is Initial when i click the link. container table have values when it executed by clicking on workitem. My requirement is to read the container values in the business object when the link is clciked.

Thanks

Mohit

Former Member
0 Kudos

Hi Mohit,

What's your actual requirement?

You can not read values from other methods of business object.

You have to use business object key or method parameter to get the required data.

Thanks,

Vijay.

Former Member
0 Kudos

Hi Vijay,

Instead of reading it from SWCXXX... , you can use WAPI FM's to read the container vaolues of the current workitem. By this way , you can read the values of parent workflow container and do you work. Please search for WAPI FM , there is definately one which gives you workitem container values.

Thanks

Rakesh

pokrakam
Active Contributor
0 Kudos

Hello Mohit,

This is bad OO:


My requirement is to read the container values in the business object when the link is clciked.

The link is one of several actions that calls the BI_OBJECT interface's display method, and is independent of workflow and should not be reading the container.

What happens when the document appears in another WF that has nothing to do with approval? Or if someone accesses the object via GOS? You get the picture.

If your object is level-dependent then it should reference the current approval level somewhere. Either store it somewhere it becomes part of the object (e.g. a field, or something like the Release Code concept in MM), or another creative solution could be to make it part of the object key. You could have an associated object with a composite key <DOC_NUM><LEVEL> that has your 'real' object as one of it's attributes.

Or if you want to keep the logic near your display method, please relocate it into it's own method. Add a method GET_APPROVAL_LEVEL, which can query whether it's currently an object in an active workflow. But this gets messy again as you would need to handle all sorts of things, see my initial questions.

Regards,

Mike