cancel
Showing results for 
Search instead for 
Did you mean: 

Program exit to change workitem text

0 Kudos

Hi All,

I have a requirement to change work item text at runtime, i am using program exit to change the task contrainer variable which is being used to display work item text. i have written a code in program exit to update container element, but it's not reflected to change workitem text, when i check in ln workflow log the variable shows with updated value.

Please help to solve issue.

Many thanks,

Accepted Solutions (0)

Answers (1)

Answers (1)

I042439
Employee
Employee
0 Kudos

Hi

Are you changing the value of the container element of the workflow or of the task workitem?

Also, at which event of the program exit are we doing that?

Regards,

Modak

Better approach is to use in-line functional methods in binding to get the right work item text and pass it to a container element of the task. Use that element in Work item text. This is a maintainable approach.

http://wiki.scn.sap.com/wiki/display/ABAP/Using+functional+methods+in+workflows+and+tasks

Expressions: Functional Methods - SAP Business Workflow: Reference Documentation - SAP Library

Regards,

Modak

0 Kudos

Hi Modak Gupta,

Thank you for your help,

i am using event  swfco_event_after_creation(also tried with swfco_event_after_rule_exec) to change task container element which is used to display work item text, for double check i have written code to change workflow container element which is used in binding for task element.

In log, element shows with new value correctly but it's not getting refreshed workitem text.

i used this event because this event will be triggered after execution of rule assigned to a task, i want to get some value from rule to format my work item text.

I also tried with FM used in binding( program binding (container IF)) to change the parameter, but this FM is executed before rule executed, in this case i will not get required value from rule so this method is ruled out.

Exact requirement is, i need some enhancement to format work item text, this enhancement should be triggered after execution of rule assigned to task.

Hope this explains my requirement.

Regards.

0 Kudos

Hi Gupta,

I used below code to update container element.

CASE im_event_name.

     WHEN swfco_event_after_creation.

        CLEAR l_value.

       CALL METHOD l_wi_cont->get

         EXPORTING

           name  = 'LV_WITEXT'

         IMPORTING

           value = l_value.

         REPLACE '$' INTO l_value WITH lv_id.

       CALL METHOD l_wi_cont->set

         EXPORTING

           name  = 'LV_WITEXT'

           value = l_value.

With above code LV_WITEXT is updated with new value, but same is not displayed as workitem text in inbox.

After workitem displayed in inbox if i use FM SWL_REFRESH_WORKITEM_TEXT explicitly to refresh, workitem text getting refreshed.

Many thanks.

I042439
Employee
Employee
0 Kudos

Hi Shiva

Did you try the functional methods?

Also, try event SWRCO_EVENT_BEFORE_CREATION.

Just a silly question, are you plugging the exit at the WF Header or the step which generates the WI? It should be the latter one.

Regards,

Modak