Flipkart.com

Friday, September 24, 2010

SAP Workflow: How to read Multi-Line container of a Work item

Here is a sample code for reading multi-line, BOR, Objects in a work item container

* For multi line class attribute of a container
  DATA: lv_wi_handle TYPE REF TO if_swf_run_wim_internal,
  cnt TYPE REF TO if_swf_cnt_container,
  l_req_wf_attribs TYPE REF TO cl_pt_req_wf_attribs.

* Get the instance of the workitem
  CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
      EXPORTING
          im_wiid     = wa_wf_data-wi_id
      RECEIVING
            re_instance = lv_wi_handle.

* Get the container
  cnt = lv_wi_handle->get_wi_container( ).

* Get the required attribute from the container
  CALL METHOD cnt->if_swf_cnt_element_access_1~element_get_value
      EXPORTING
             name  = 'REQ' " Name of your object
      IMPORTING
             value = l_req_wf_attribs.

5 comments:

  1. Hi KK,

    I am using same code for my requirement,but it gives short dump for some work items and its working fine for some work items.

    whats the reason i getting short dump for some work items.

    Please give me reply, this is very urgent.


    Please find the short dump below.
    What happened?
    The exception 'CX_SWF_CNT_ELEM_TYPE_CONFLICT' was
    anywhere along
    the call hierarchy.

    Since exceptions represent error situations and th
    adequately responded to, the running ABAP program
    'CL_SWF_CNT_CONTAINER==========CP' has to be
    terminated.

    Thanks,
    Kumar

    ReplyDelete
  2. Hi Kumar,

    The dump description says that the type of "returning container value" does not match with the type of "the return container".

    Check the declaration types for the container.

    -Krishna

    ReplyDelete
  3. Hurrah! In the end I got a web site from where I be able to
    really get valuable information regarding my study and knowledge.
    Feel free to surf my homepage - male breast reduction

    ReplyDelete
  4. navigate to this website Click This Link this my website website here Discover More Here

    ReplyDelete