cancel
Showing results for 
Search instead for 
Did you mean: 

How to update the class attribute in workflow container

Former Member
0 Kudos

Hi Experts,

Can anyone please tell how to assign a value to the the class attribute in workflow container.

i am having an element in the container of object type CLABAP Class that contains class CL_PT_REQ_WF_ATTRIBS an in that i have to update the STATUS.

i am having the RFC to trigger the workflow and update the workflow container.

i had updated the workflow container element and but not the element of type class attribute.

plz suggest how to update the class attribute in the workflow container.

Eg:

Element : Req

Object Type : CLABAP Class

CL_PT_REQ_WF_ATTRIBS

(Attribute = STATUS)

Thanks & Regards

Chandran Subramanian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

You cannot update a class attribute from the workflow (or at least not in the way you are now trying).

The class (or the object) gets its values from database, when the object is instantiated. So even if you somehow managed to change the attribute, it would change back next time the object gets instantiated (=soon).

Basically if you want to change the status of the attribute, you really need to change the status of the object (in this case leave request) in the database - for example with some BAPI, method, or whatever. But probably you don't want to do this.

Maybe you could create a new container element 'ZSTATUS' and update its status? But before you do that, it would by nice to know that what are you actually trying to achieve.

Best regards,

Karri

Former Member
0 Kudos

Hi,

Thanks for your reply

What you said i had done in my RFC thats not my problem

CALL FUNCTION 'SWC_ELEMENT_SET'
        EXPORTING
          element       = 'ZSTATUS'
          field         = lv_status
        TABLES
          container     = lt_container

Actually i want to set the value to the attribute inside the class

Req.STATUS = Approved (or) Rejected

Element : Req

Object Type : CLABAP Class

CL_PT_REQ_WF_ATTRIBS

(Attribute = STATUS)

Thanks & Regards

Chandran Subramanian

Former Member
0 Kudos

As I said in my previous reply, you cannot change an attribute of a class. The only way to do it, is to change the actual object in the database, which the object of type CL_PT_REQ_WF_ATTRIBS is a representation.

Please tell us that what you are actually aiming for? Why do you want to change the attribute of a class in the workflow?

Regards,

Karri