cancel
Showing results for 
Search instead for 
Did you mean: 

To use the value of container in Progam exit

Former Member
0 Kudos

Hi friends,

I am using program exit in my workflow. While using this class, I am able to use the value of container which is flowing in my workflow but How can I use a container which is of type some business object. Say I am using a container DRAW type business object DRAW. I want to use the values flowing in the container DRAW. Please guide.

Thanks,

Gaurav

Accepted Solutions (1)

Accepted Solutions (1)

bpawanchand
Active Contributor
0 Kudos

Check out this [article|http://wiki.sdn.sap.com/wiki/display/ABAP/Program%20Exits%20In%20Workflow]

Former Member
0 Kudos

Hi Pavan,

As a matter of fact, I was following this article only. In method after creation, I want to read the value of attribute of my container DRAW which is referring to business object DRAW. If you see, it has an attribute called 'STATUS'. How can i read that one?

Thanks,

Gaurav

bpawanchand
Active Contributor
0 Kudos

After read the value of the BOR object DRAW by using the method Get mehtod...

Beofre using the belwo code snippet you have to make sure that you have included the INCLUDE cntn01_swc in the

Utilities ---> call-locval types ---> Macros ---> Include cntn01_swc.


DATA: lv_draw type swc0_object.
DATA: lv_status type char32.

SWC0_GET_PRORPERTY lv_draw 'STATUS' lv_status.

IF at all the get method is reading the container element then by using the below code snippet you can get the status property of the Draw object....

Former Member
0 Kudos

Hi Gaurav

Try the below code:

Data: data1 type SWC_OBJECT,

lt_container type table of swcont.

call method container->get

Exporting

name = 'DRAW' u201CB.O. used in workflow

importing

VALUE = data1.

CALL FUNCTION 'SWO_INVOKE'

EXPORTING

ACCESS = 'G'

OBJECT = data1-handle

VERB = 'DocumentStatus'

TABLES

CONTAINER = lt_container

lt_container will then have the attribute with the data.

Former Member
0 Kudos

Hi pavan,

When i am adding this INCLUDE cntn01_swc in my method, an error is coming 'Statement ENDMETHOD is missing'. When i comment this code, all is fine. Moreover, i did not find this path Utilities ---> call-locval types ---> Macros ---> Include cntn01_swc. Please guide.

Thanks.

bpawanchand
Active Contributor
0 Kudos

ok.. do like this

1. Got se24 and enter the program exit class name and open in chnage mode.

2. Now on menu click on GOTO---> class locla types ---. Macros ---> here you need to write include cntn01_swc.

Former Member
0 Kudos

Hi Pavan,

that was indeed a very helpful answer. After writing the code, when i checked the value of lv_draw and lv_status, both were blank.

SWC0_GET_PROPERTY lv_draw 'DOCUMENTSTATUS' lv_status.

Thanks,

Gaurav

bpawanchand
Active Contributor
0 Kudos

That means the DRAW bor isnot getting populated or there could be a possibility that the name might be different in thewo0rkflow container......make sure that you use the same name what you have deifned in the workflow container.....

Until the Lv_draw is populated property status can not be read.

Former Member
0 Kudos

Hi Aman,

Problem solved with your given logic.

Thanks alot.

Gaurav

Answers (2)

Answers (2)

former_member185167
Active Contributor
0 Kudos

Hello,

For an object instance, all you need is the object type (eg DRAW) and the key to get passed. After that you should be able to instantiate the object and access all of its attributes.

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Hi Gautham,

You can use the FM, SAP_WAPI_READ_CONTAINER to read the container values based on workitem ID.

Thanks.