Quantcast
Channel: SCN : Unanswered Discussions - SAP Business Process Management
Viewing all articles
Browse latest Browse all 3160

sap_wapi_write_container

$
0
0

Hi ,

 

I hvave problems with writing in container .

My step receives container element 'EACTIVITIES' form wf container  withe three records.

During  the task execution user has possibiy  to ad some activites . I the code below I add  two manually  .

New activites are writen into lt container internal table and passed to   fm sap_wapi_write_container.

After execution of this FM i have  returncode <> 0 . I was expecting to have  old values and two new ones first in

task container and than via bindings to see in worflow container .

 

As a item Id iam passing  wor item id  for  to read and write FM.

 

Please advice .

 

Chris

 

  DATA: lt_container TYPE TABLE OF SWr_cont.
  DATA  ls_container_line TYPE swr_cont.

 

 

  CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
   
EXPORTING
      workitem_id     
= is_wi_details-wi_id
   
IMPORTING
      return_code     
= lv_retcode
   
TABLES
      simple_container
= lt_container.

* frst ctivity
  ls_activity
-network = '000080000005'.
  ls_activity
-activity = '0040'.
  ls_activity
-control_key = 'PS01'.
  ls_activity
-description = 'Soltech team 3'.
*second activity
 
APPEND ls_activity TO  lt_activity .
  ls_activity
-network = '000080000005'.
  ls_activity
-activity = '0050'.
  ls_activity
-control_key = 'PS01'.
  ls_activity
-description = 'Soltech team 4'.
  
APPEND ls_activity TO  lt_activity .

 


ls_container
-element = 'EACTIVITY'.
ls_container
-value  = ls_activity-network.
ls_container
-value+12(4) = ls_activity-activity.
ls_container
-value+16(4) = ls_activity-control_key.
ls_container
-value+32(14) = ls_activity-description.APPEND ls_container to lt_container.
endloop.


Loop at  lt_activity  into ls_activity.


Sort lt_container by element.

"Write the updated container back to the workflow engine
 
CALL FUNCTION 'SAP_WAPI_WRITE_CONTAINER'
   
EXPORTING
      workitem_id     
= is_wi_details-wi_id
      do_commit       
= 'X'
   
IMPORTING
      return_code     
= lv_retcode
   
TABLES
      simple_container
= lt_container.
 
IF lv_retcode NE 0.
   
"Handle error
 
ENDIF.


Viewing all articles
Browse latest Browse all 3160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>