cancel
Showing results for 
Search instead for 
Did you mean: 

Container binding issue

Former Member
0 Kudos

Hi All,

I have modified a SAP workflow and seem to have problems ppassing sata between steps, The first step I use object CA_WRTOFF method Write-off. This completes a write off. After this step variable DOCUMENTNUMBER is filled with the created document number.

In the next step I want to display the document, I use object CA_DOC method display. The main parameter it neeeds is document number. I try to use the generate binding. It will pass &CA_DOC& to &_WI_OBJECT_ID&. from workflow to step, both these objects contain document number.

However when I look in SWEL at the display document step &_WI_OBJECT_ID&. says no instaance under value? How can I populate this value. I try to manually add document number to the binding but am told I cannot use &_WI_OBJECT_ID&. as a target. I have CA_DOC set as inport and export. Any idea's?? I am on a 4.6 system

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member185167
Active Contributor
0 Kudos

Hello,

I may be missing something here, but wht does SWEL have to do with this?

And why are you trying to copy something to WIOBJECT_ID ?

Can't you just pass DOCUMENTNUMBER to the Display method?

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Hi<

I am sure it is I that am missing something, I am new to workflows and will be attending a course soon but have been given this task to complete in the meantime.

I use swel just to view the workflow so that I can see if document number is indedd kept, It is and I can see it in the workkflow. However in the binding on the left side there is a seperate variable for document number, there is no seperate variable on the right side for document number. It is part of &_WI_OBJECT_ID&. I am basically just trying to get the task to take me to F(08 which it does and fill in the document number which of course it isn't.

Thanks for any light you can shed,

George

former_member185167
Active Contributor
0 Kudos

Hello,

SWEL is the event trace, maybe you mean SWIA.

What do you mean by "F(08" ?

The Display method, what parameters does it have?

regards

Rick Bakker

Haabi Technology

Former Member
0 Kudos

Hi,

Sorry a typo I meant trans FP08 display document. I use swel then look at work item then at container that shows me the variables. Is there something better that I should look at? The parameters that display has are this is the step container

Adhocobjects

attachobjects

WIACTUAL_AGENT

WIGROUP_ID

_WORKITEM

RULERESULT

WIOBJECT_ID

the binding it propeses as I mentioned above is &CA_DOC& to &_WI_OBJECT_ID&\. This does not pass the document number.

Thanks,

former_member185167
Active Contributor
0 Kudos

Hello,

You're right, you can get from SWEL to the workflow log, I just like using SWIA.

What is the main object of your workflow, is it CA_DOC? This will be the

object that the triggering event belongs to.

Normally you would pass the object container element, eg &CA_DOC& to

&_WI_OBJECT_ID& in the bindings between workflow and task in the step,

if the task runs a method of the workflow object.

At one point you say you're using object CA_WRTOFF, I'm not sure how that's

related.

So: what object are you using, what methods of that object are you using?

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Hi First of all thanks for your patience,

Second I seem to have passed the document number but it still is not actually passing to the document number field in trans FPE3 (I mentiooned FP08 in error before, that is ultimately my goal which I will clarify)

Ok here is what I am trying to accomplish

The original SAP wrtoff workflow CA_WRTOFF activates with event FP04 create writeoff, my company does not like the fact that when it goes to an approver the writeoff is held in limbo. This allows others access to the write off amount. So they have asked me to restructure the workflow.

The event link as above is CA_WRTOFF with event trigger approval required as above, the first thing I do in the workflow is complete the writeoff with object CA_WRTOFF method writeoff. I then send a user decision to the approver asking if he wants to display document, accept write-off, reverse write-off. I use CAA_DOC display for the display as CA_WRTOFF does not have document number associated with it.

In the last few moments I changed my binding in the display to coyp all elements except system, this has passed the document number to the display container. When the approver clicks on the display item it brings him to transaction FPE3 but does not populate the document number in FPE3. So the real issue is to have the display method take the approver to FPE3 and fill in the document number so all the approver has to do is hit enter.

Again thanks for your time and patience, Much appreciated. I am an ABAPPER but quite new to work flows.

George

former_member185167
Active Contributor
0 Kudos

Hello,

A bit too much information!

Could you answer these questions:

1) What is the name of your workflow?

2) What is the name of the BOR object of your workflow?

3) What event of 2) triggers 1)?

4) Is a method of 2) used for the Display step in the workflow?

5) How is the Display achieved, eg is a transaction called (which)?

6) Do you bind 2) to WIOBJECT_ID in the Display step in the workflow?

regards

Rick Bakker

Hanabi technology

Former Member
0 Kudos

Hi, ok here are the answers to your above questions

1) What is the name of your workflow?

The name of the workflow is Name Dual Control: Approve Write-Off, Abbr FICA_WRTOFF, I created a z version ZICA_WRTOFF

2) What is the name of the BOR object of your workflow?

The BOR Object is CA_WRTOFF

3) What event of 2) triggers 1)?

Approval Required

4. 4) Is a method of 2) used for the Display step in the workflow?

No

5) How is the Display achieved, eg is a transaction called (which)?

The display is called at this point using object CA_DOC method Display. It calls transaction FPE3 (Display Document initial screen)

6) Do you bind 2) to WIOBJECT_ID in the Display step in the workflow?

yes, and CA_DOC is checked for input.

So again at this point the problem is that when the user gets to FPE3 the document number is not filled in. If I just do a mini test workflow and make CA_DOC input and run test, enter a document number on the test screen. It will display the document. When I look at the SWiA it shows WIOBJECT_ID having CA_DOC0000800000074 which is the doc number I entered. When I look at it in the z workflow WIOBJECT_ID has no instance. That seems to be the problem.

Hoping you mayhave some insight.

Thanks

former_member185167
Active Contributor
0 Kudos

Hello,

Thanks for the clarifications.

So basically you have a workflow of object A and you want to call a task which executes a method

of object B.

In order to pass an object instance of object B to that task, you first have to instantiate that

object.

What I would do is create a method in object A to which you pass the key of object B, and have that

method pass back an object instance of B.

Create a task which calls that method, and create a workflow step to call that task.

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Hi Thanks for the reply,

Ok I think I have an idea what you mean, I would have to make a z subtype of the object correct? Create a method that calls transaction FPE3? and delegate the new object. I am not quite sure how I would pass the key of the object and pass the instance? Do you know of a link that would cover something like this a sort of step by step guide. If it is not too long a procedure would it be possible for you to frame it in a more step by step format? As I say I will be taking the workflow course next month or so but would really like to get this working before then.

Thanks for any help you can provide,

former_member185167
Active Contributor
0 Kudos

Hello,

Yes, you'll have to make a ZCA_WRTOFF subtype and delegate

it. Then add a method to ZCA_WRTOFF that will do something

like:

data: lv_objtype type swo_objtyp,

data: lo_ca_doc type swc_object.

begin of lv_ca_doc_key,

documentno like ?????-????,

end of lv_ca_doc_key.

lv_objtype = 'CA_DOC'.

lv_ca_doc_key-documentno = p_documentno.

swc_create_object lo_ca_doc lv_objtype lv_ca_doc_key.

Then you will pass back lo_ca_doc from the method

to the task.

Do all this and you'll be way ahead on your course!

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Concerning the object instance creation, you can also use the wizard in SWDD

Others => Include "Create Object Reference"

It will create the task, and the workflow step for you, no modification in SWO1 needed.

Then, in the binding, you pass the objectid, and you get back the reference to the object.

Former Member
0 Kudos

Hi Rick,

Thanks again for both your time and patience, I am going to give this a shot. It seems quite detailed but your little tutorial is much appreciated. I see we are fellow Canadians though I work in the US now.

Thanks George

Former Member
0 Kudos

Hi Xavier,

I thought I would try the approach you mentioned first as it maay be a simplier fix, I did use the wizard and created an object id. It added a step where it binds the object ID to Object ID. It then continues to the step it was created for. I am not sure in the binding how I am to use the object ID. There does not seem to be anything on the right side to bind it to. I see it on the left side and tried to bind it to &WI_OBJECT_ID&

Former Member
0 Kudos

Hi Xavier,

I thought I would try your approach first as it may be a bit easier fix, I used the wizard and created the object ID, the wizard created a step where it bound object_id to object_id. It then linked to the actual step I was working on which is a display object. I am not sure it the display object step how to use the object_id? I do not see anything on the right side to bind with, I see object_id on the left side. I tried binding it to &_WI_OBJECT_ID& but that did not work. Any idea's on how I should use the new object ID in the binding of the display step?

Thanks for any insight

Former Member
0 Kudos

In the Task container create a Container element that is referencing Business Object ZCA_WRTOFF if it is not delegated to CA_WRTOFF or if it is delegated referencing Business Object CA_WRTOFF and do the binding with the Business Object Wflow container element to Task Container element.

Thanks

Arghadip

Former Member
0 Kudos

Hello,

I don't know what version of SAP you are using, but in ECC6 the wizard creates a step with the following binding:

&OBJECTKEY& from WF to task: this is the key of the instance to create.

&OBJECTINSTANCE& from task to WF: this is the instance of the object that has been created by the task

The wizard also creates &OBJECTKEY& and &OBJECTINSTANCE& elements in the workflow container.

These are the elements you have to use. You set &OBJECTKEY& with your object key (the document number?) before the wizard step, and after the wizard step you execute the display method of &OBJECTINSTANCE& in a new task.

This only works if the document number is the key of the object you want to display, otherwise you have to add some code to get the object key / instance based on the document number.

Hope that it will help.

Former Member
0 Kudos

Hi,

Thanks for your reply, I was on vacation for a bit and getting back to this issue now. I have created the instance and we are on version 6.0 here as well. thingsare as you explain here

I don't know what version of SAP you are using, but in ECC6 the wizard creates a step with the following binding:

&OBJECTKEY& from WF to task: this is the key of the instance to create.

&OBJECTINSTANCE& from task to WF: this is the instance of the object that has been created by the task

The question I have is in reference to the next step

The wizard also creates &OBJECTKEY& and &OBJECTINSTANCE& elements in the workflow container.

These are the elements you have to use. You set &OBJECTKEY& with your object key (the document number?) before the wizard step, and after the wizard step you execute the display method of &OBJECTINSTANCE& in a new task.

How do I set the &OBJECTKEY& with the document number? Do I create a activity step using CA_DOC if so what method would I use? I think if I can get past this step the rest will work.

Thanks for your patience, it is much appreciated

former_member185167
Active Contributor
0 Kudos

Hello,

I assume you can just use a container operation or a binding to give &OBJECTKEY& the document number.

regards

Rick Bakker

Hanabi Technology

Answers (0)