on 10-28-2015 3:55 AM
Hi Experts,
I have created one BO Type ZBO1 which having the Key_field1, Key_field2 and Method M1 and 1 attribute Atr1 defined.
From within the Workflow Template, I have used first Activity step which uses the single step Task which in turn uses the BO Type SYSTEM method GENERICINSTANTIATE. I am passing the BO Type and Key fields Key_Field1 and Key_Field2 in input and getting the reference of the generated BO Type Object into the Workflow container Element lets say GO_1(this is of type ZBO1).This step is working fine, I can see in Workflow Technical log SWIA.
Now using this GO_1 workflow container element, in next Activity step, I have called the ZBO1 method M1.this is also working fine, I can see in Log that same Reference variable GO_1 is being used with the same key fields values. NO issue till this point.
My requirement is to set the ZBO1 attribute Atr1 inside the method M1, so that after calling the ZBO1 method M1 from workflow, I would be able to use the Atr1 using the GO_1 ( I mean I want to use Atr1 value inside the workflow using the GO_1).
in nutshell, using the GO_1(of Type ZBO1) workflow container element inside the workflow, I would be able to access all the ZBO1 attributes. (In Technical log of workflow, I should see all the attributes values gets populated for GO_1).
I have already gone through the existing Threads in this regards but not getting the idea.
please suggest me some steps to follow.
Regards,
Jagesh
Hi Jagesh,
If you are new to BOR I would recommend bypassing it altogether and use ABAP Objects. That way you use the same skills and techniques as regular ABAP and don't need to learn two ways to do the same thing.
Regards,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jagesh,
I'm Mike by the way, not Mark.
You misunderstood. What I meant was if you are new to BOR, don't spend too much time on it. Rather learn ABAP Objects. They are both used in Workflow, both do the same thing.
BOR Objects are the older technology and are specific to workflow, but ABAP Objects are used in almost all of SAP ERP. If you can code in ABAP you can understand BOR.
The Workflow book is a good resource. CL_SWF_FORMABSENC is a good example. And there are Jocelyn's excellent Blogs right here on SCN:
Why use ABAP OO with Workflow? - ABAP Development - SCN Wiki
Regards,
Mike
Hi Mike,
sorry I wrongly used your name.
so from your reply, I understood that ABAP BO is the older concept and hence new concept ABAP OO is to be used within the workflow.
ok I will follow this approach, so far I was using the concept like, inside the workflow Template, from each single step I used to call the BO Type method and this BO method internally calls the custom FM and custom class method for actual logic implementation.
so I nee to change this in such a way that from the single step task, I would have called ABAP OO class method directly and in this way can avoid the use of the custom BO Type.
Thanks for your guidance.
Regards,
Jagesh
Hi Jagesh,
I havn't tested but can you try this:
lv_obj-Attribute = value
swc_set_element container 'GO_1' lv_obj
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi jagesh,
To get object attribute use the following code
DATA lv_obj TYPE swc_object.
DATA lv_atr type atr1.
swc_get_element container 'GO_1' lv_obj.
swc_get_property lv_obj 'Atr1' lv_atr.
To set object attribute
swc_set_property lv_obj 'Atr1' lv_atr.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathew,
when I am using the SWC_SET_PROPERTY macro inside the BO method then I am getting the syntax error as show below.
I also tried to access the attribute directly as "OBJECT-Attribute_name" inside the BO method and assigned a value to it. in this case when I run the BO method in test mode from SWO1 then I can see the value in this attribute perfectly, however when I execute the workflow and then when I check the Technical log in SWIA for the steps then I don't see any value inside the BO Reference variable (workflow container as shown below).
HI,
It is correct, if you want to set the attribute, then you have to create custom method in BO to set the attibute.
Just try to check the program for your attribute in SWO1. You will find the code populate the attribute ie only read
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would like to know the below points.
(1)how to get/set the BO Type attribute inside the BO method itself.
(2)what coding is to be done inside the BO method so that I can access all BO attributes inside my workflow subsequent steps through GO_1 as mentioned above.
please go through my post again Anjan.
Thanks for your reply.
Regards,
Jagesh
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.