Skip to Content

how to access BO Type attribute inside workflow steps

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Nov 03, 2015 at 11:42 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2015 at 07:10 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Hi,

          Every Attribute generally select value from database. So you have to use a method to update the database from method , so that attribute   are populated from database.

  • Oct 28, 2015 at 08:58 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2015 at 01:23 PM

    Hi Jagesh,

    I havn't tested but can you try this:

    lv_obj-Attribute = value


    swc_set_element container 'GO_1' lv_obj



    Regards

    Add comment
    10|10000 characters needed characters exceeded