Passing multiline element to workflow container ? how do i ?

Hello Folks,
I need to pass an internal table to the workflow container...In this container i had already created an Multiline element which the right table type assigned..
I need to call this Workflow using FM SAP_WAPI_START_WORKFLOW.... Eg:
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
  EXPORTING
   TASK                      = WFNAME
   LANGUAGE                  = SY-LANGU
   DO_COMMIT                 = 'X'
   USER                      = SY-UNAME
   START_ASYNCHRONOUS        = 'X'
  DESIRED_START_DATE        =
  DESIRED_START_TIME        =
  DESIRED_START_ZONLO       = SY-ZONLO
  IFS_XML_CONTAINER         =
  IMPORTING
   RETURN_CODE               = lv_return_code
   WORKITEM_ID               = lv_workitem_id
  NEW_STATUS               =
TABLES
   INPUT_CONTAINER           = lt_container_wf
   MESSAGE_STRUCT            = lt_message_struct
   MESSAGE_LINES             = lt_msg_lines.
lt_container_wf values should have an internal table to be passed a multiline element.....
I am unble to pass it this way and the error i get is that " Single Line element  <XXXX> is being passed several times...
How do i tell the system the the element which is passed is a mulitple element..
Regards,
Anand

check this code snippet
include <cntn01>.
DATA:
      lv_retcode   TYPE  sysubrc,
      lt_cont   TYPE TABLE OF swcont,
      ls_cont   TYPE          swcont,
      lt_kna1   TYPE TABLE OF kna1,
      ls_kna1   TYPE kna1.
SELECT * FROM kna1 INTO TABLE lt_kna1 UP TO 10 ROWS.
swc_create_container lt_cont.
swc_set_table lt_cont 'CUSTOMER' lt_kna1.
CALL FUNCTION 'EWW_WORKFLOW_START'
  EXPORTING
    x_task                = 'WSXXXXXXXX'
TABLES
   X_CONTAINER           = lt_cont
EXCEPTIONS
   INVALID_TASK          = 1
   NO_ACTIVE_PLVAR       = 2
   START_FAILED          = 3
   GENERAL_ERROR         = 4
   OTHERS                = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Similar Messages

  • How to use data of multiline element from workflow container

    Hi,
    Can you please tell me how to access rows of multiline element of workflow container.
    Scenario is like below.
    I have values in a multiline container(table) of workflow container.
    Now inside Fork branches  i need to check for specific data in the above table and with that condition i have to send workitem.
    I hope u can understand,otherwise please revert.
    Thanks in advance,
    Madhu

    You cannot didrectly check the condition...
    what you have to do is.. write a inside the method as below and set the flag...and use the flag in condition editor...
    SWC_GET_TABLE CONTAINER 'AGENTS'  lt_agents.
    loop at lt_agents ino wa_agents.
    if wa_agents = 'A'.
    lv_flag = X.
    endif.
    endloop.
    SWC_SET_ELEMENT CONTAINER 'FLAG' lv_flag.
    Create an export parameter FLAG as char1 with export marked.
    Do the neccesary bindings from task to workflow.
    Then in workflow check this flag in condition editor.

  • Question on how to retrieve elements in workflow container using WAPI

    Hi all, I need your great help. I have started a workflow and during it running I want get element in workflow container. First I use SAP_WAPI_READ_CONTAINER to get a workflow container which called "simple_container", but I can not get element using SWC_GET_ELEMENT because the container type I got does not match the type TABLE SWCONT. 
    I have loop the container and could see the elements in the container, but I am not quit sure that I can get the element with its own type. For example, I have an internal table in container, when I loop to it and get its value, it can not be assigned to my local internal table variable for the type incomptible.
    Could any one give me some advice? Thank you very much!

    Thanks for your advice. I think I have found the way to do that by inside into the source code sap provide. The steps are as follows:
    1 If the element you want get in container is char-based, just get container use 'SAP_WAPI_READ_CONTAINER' and loop into it to retrieve what you want.
    2 If you want get element in other types, eg, internal table, then use:
    lv_wi_handle TYPE REF TO if_swf_run_wim_internal,
    cnt TYPE REF TO if_swf_cnt_container.
    CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
            EXPORTING
              im_wiid     = wi_id
            RECEIVING
              re_instance = lv_wi_handle.
          cnt = lv_wi_handle->get_wi_container( ).
    CALL METHOD cnt->IF_SWF_CNT_ELEMENT_ACCESS_1~ELEMENT_GET_VALUE
           EXPORTING NAME = 'element_name'
           IMPORTING VALUE = element_value.
    The variable element_value is just in your own type~.
    Hope it useful to you, the reader.

  • Can we pass Internal tables to workflow container?

    workflow container has a size limitation, we need to pass any infotype to the workflow container, so can we pass internal tables to workflow container or is there any alternate solution?
    Thanks in Advance
    Hari

    Hi,
    Check the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/a6/9bac935f2c11d194a40000e82dec10/frameset.htm">Multiline Container Element Definition.</a>
    Regards
    <i><b>Raja Sekhar</b></i>

  • How to create a container element in workflow container

    Hi,
    I am learning WF by a Tutorial. In which absence of notification was considered as example. As per tutorial, I created two task for creating a Notification and checking a absence
    In the next step it ask to create a container element(approver) to workflow container. How i can create the same.
    Also, please clarify me on the binding between task container and workflow container....with this example
    Thanks
    Suresh

    Hi,
    On the workflow builder LEFT side below the navigation area u can see this <Double-Click to Create>.
    Double click and create the container.
    During binding it looks as follows.
    Workflow  -
    >   Task
    Workflow <----
    Task
    What happen here is from workflow the data passed to task and it is used for processing, after that it returned back to the workflow. Now u can create the container on bothside and bind the data. ie Variables.
    Creating container u can refer : http://www.****************
    Reward for useful answer.
    Richard A

  • Not Able to Pass the Values to WorkFlow Container

    Hi All,
        Iam calling a WF from a BSP application by using the FM       
    EWW_WORKFLOW_START
    for this fucntion module iam passing a table  to the parameter
    X_CONATINER = t_values
    but I am a bit confused that how this table is assigned to the workflow conatiner.
    what I want to know is I need to assign the values of t_values to the WF conatiner elements .
    Thanks In Advance.
    Regards
    Pavan

    Pavan,
    try this code and include this in your corresponding include.
    Make sure that your workflow has a multiline import element with the same name as of the internal table. Here, WERKS.
    REPORT yh_sample.
    DATA : t_container TYPE TABLE OF swcont WITH HEADER LINE,
            wf_id TYPE swwwihead-wi_id.
    DATA: werks TYPE STANDARD TABLE OF werks_d WITH HEADER LINE.
    DEFINE swc_set_element.
      call function 'SWC_TABLE_SET'
        exporting
          element       = &2
        tables
          container     = &1
          table         = &3
        exceptions
          type_conflict = 1.
    END-OF-DEFINITION.
    werks = '1000'.
    APPEND werks.
    werks = '1003'.
    APPEND werks.
    werks = '1056'.
    APPEND werks.
    swc_set_element t_container  'WERKS' werks.
    CALL FUNCTION 'EWW_WORKFLOW_START'
      EXPORTING
        x_task          = 'WS99901222'
      IMPORTING
        y_workflow_id   = wf_id
      TABLES
        x_container     = t_container
      EXCEPTIONS
        invalid_task    = 1
        no_active_plvar = 2
        start_failed    = 3
        general_error   = 4.
    IF sy-subrc = 0.
      COMMIT WORK.
      MESSAGE 'success' TYPE 'S'.
      WRITE:/ wf_id.
    ELSE.
      MESSAGE 'Error' TYPE 'S'.
    ENDIF.
    Regards
    Indu.

  • Adding two characters to all the element of workflow container

    Hi All,
    I want to prefix two character to all the elements of a particular "multiline" workflow container.
    How can i do this?
    Please help me in this regard.
    Thanks,
    Ritesh

    you will have to use a custom method as step and pass the multiline attribute and loop at it, add and modify the multiline variable of the container. No other way possible, within workflow builder.
    regards,
    Sandeep Josyula
    *Mark if helpful

  • Error when trying to create new element in workflow container

    hi experts,
    I hit an error 'cusomer-own workflow are not allowed to be configure" when trying to create a new element in the container.
    have anybody come across this problem and how to overcome it
    TQ

    Aren't customer task not used anymore?
    Or am I mixing things up here.
    Well the problem isn't a problem it is SAP standard behaviour you simply can't configure customer tasks (type T in PFTC)
    You can only configure Standard Tasks (TS) or workflow templates (WS)
    Kind regards, Rob Dielemans
    Edited by: Rob Dielemans on May 29, 2009 12:51 PM
    Just had a look at the SAP help and indeed types T aren't allowed anymore SAP gives the solution to copy the customer task, this will automatically change it to a standard task

  • Multiline container element in workflow

    Dear all,
    I am using a multiline container element in workflow container.  Can anybody suggest how I can see the values of that element?  After workflow execution is COMPLETED and I go to SWI1, it shows only simple elements.  It doesn't show any of my multiline elements.
    Please help.
    Thanks in advance,
    Regards,
    Pranav.

    Hi Pranav,
    It does work in 6.20. I am not sure about 4.6C.
    Display Technical Details from the Workflow log for your WF instance. You can examine the Container values for each of the steps. See if the values show up (are you certain your multiline container has been populated?). If you are populating the multiline container from an object method, verify by testing your object method that the parameter are correctly defined and it is getting populated.

  • Element Missing in Workflow Container

    Hi,
    I am facing a strange issue.
    I am not finding a particular element in workflow container (both in the Container tab and also in Basic data->Workflow Builder->Workflow container->Element (R/3 4.70 Enterprise)) but at runtime - SWI1 (Workflow Log) when I execute with workflow instance id, I am getting that workflow container element with the value that I required. I am sure I haven't deleted that element from that container... since it's not appearing, again I went to workflow template and added the Element and now it's appearing and working. As of now my problem is solved but can you please tell why it was not appearing in definition.
    Advance thanks.
    Regards,
    Balaji Viswanath.

    Is there any reason to pass single line element to multiline element?
    Instead of that try to pass single line item to single line item and user
    SWC_GET_ELEMENT CONTAINER ac_container <container> <single line element> to get the value.
    After that you can pass the value to internal table(if required)
    Aman

  • Task container to workflow container binding

    Hi all,
    I have a requirement to send mail to department responsible of a quality notification as soon as it is created from defects recording.
    I am using sendmail step for this but since it doesnt have agent determination using rule, I am forced to create a background step which captures the value of department responsible (IHPA-PARNR) and passes on to a element in workflow container. The idea was I could later use the value of this container element in my send mail step which follows.
    For this, I have defined a background step in my workflow template. The method in the standard task of this step refers to a function module.
    The function module takes quality notification number as input (QMEL-QMNUM) and outputs the partner number (data type IHPA-PARNR).
    I want to capture this partner number into my workflow at runtime. For this I defined a workflow container element refering to IHPA-PARNR so that it can bind to the export parameter of the task, which gets the value from method.
    when I test my function module it works fine. BUt when I try to bind the task to my workflow, the binding between the elements refering to IHPA-PARNR gives error this error message:
    " incompatible data type reference"
    whereas the data type reference is same for both container elements.
    Please help.
    Thanks
    kiran

    Hi Ramki,
    This is the binding from workflow to task container.
    X                 => &EXPRESS&
    G                 => &TYPEID&
    &DEPTRESPONSIBLE& => &ADDRESSSTRINGS&
    Here the DEPTRESPONSIBLE is the WF container element which gets the value of department (basically a org structure IHPA-PARNR) via a background task in the previous step.
    And in the recepients list, I have given
    recepient type : organizational object
    expression     : &DEPTRESPONSIBLE&
    I think this is where the problem is. Because when I give workflow initiator as recepient, it works fine. But when I give the department responsible as expression as shown above it errors out.
    It also works fine when I hardcode the value of department responsible in the recepients list (say 50001930)and give recepient type as Organizational object.
    So the problem is it is not taking the value stored in the container element &DEPTRESPONSIBLE& as the recepient.
    Any ideas.
    Thanks a million.
    kiran

  • Urgent - How to pass value to Multiline container element in workflow

    Hi,
      I hav a requirement as below...
    1) In a Bus. Object, there is a method with a parameter which is Multiline.
    2) When I execute it directly from Bus. Object, I am able to populate any no. of lines to the multiline parameter & execute it. It is working correctly.
    3) Now I have created a task for the same Method & used it in my workflow.
    4) I want to pass multiline values to the parameter from workflow.
    5) I dont have any internal table being filled in the previous steps. I directly want to assign variables or constants to it.
    How can I do it????
    Thanks,
    Sivagami

    hi sivagami,
    Please help me. I am also facing same type of problem. i am new to workflow. i am using using FM sap_wapi_write_container. to write into the container. but here my problem is i don know wat is the element name to refer to the value. if i give any element naem its taking as separate element & not as the same multiline container. i hope u will be able to assist me since u have worked on the same type of problem.
    If u help i will be highly thankful to u.
    Thanks & Regards
    Nigesh

  • How to create workflow container element from workflow builder?

    How to create workflow container element from workflow builder?

    in workflow
    three are five container, for each container we have define according to requirement of that particular container.
    1. event container
    2. workflow container
    3. task container
    4. method container
    5. rule container
    1. event container
    in evernt contianer we have to create elements in BOR where we create event in parameters
    2. workflow container
    in workflow container we have to create elements in workflow builder itself. in left side of the screen we see <double click to create element>
    3. task container
    in task container we have to create in task itself it has a tab called container elements
    4. method container
    in method container we have to create in BOR. it is created in parameter of that BOR.
    5. rule container
    in rule container we have to create in PFAC transaction

  • How to set the following workflow container element

    In the below example i have created the following  field chgdocdat fieldnam in the workflow container in the initial value it is showing as <notset>
    but i want the value for initial value for field chgdocdat as 00.00.0000
    fieldnam as
    can any body help me

    hi koto,
    when u create a work flow element container.
    u have tye option to give the data type.
    there u u choose from dictonary, ie some date field from the data dictonory.
    after that in the 3rd tab it is initial value.
    click it and give 00.00.0000
    since it is date type no problem here.
    save it.
    thats all
    clarifiactions are welcome.
    pls reward points, if this helped u.
    regards,
    anversha.
    [email protected]

  • Workflow issue - Main workflow container elements are not updated.

    Hi All
    We have implemented N-step badi for approval process and for this we have activated one workflow which contains subworkflow .
    During approval process , only the subworkflow container elements( approver list and last approver) getting updated with status and time.But main workflow container elements is not updating with these details.
    Binding between main workflow and subworkflow is perfect. But reverse binding ( from subworkflow -> main workflow ) will take place once subworkflow is completely finished. But here we will require / need to pass some information from sub workkflow to main workflow when still subworlflow in process( before completed itself).
    Please let me know is there any process / steps is required to pass values between subworkflow to main workflow ( binding is perfect).
    Please let me the way how I can update the main workflow container from  subworkflow container or from any step in sub workflow .
    In subworkflow . we have loop of  approvers and it will send workitems to approvers one by one.
    Here i need to update Main workflow with the information like last approver and approver list with status and approved time.
    So please suggest how Can I update main workflow container from subworkflow while subworkflow is still in process( subworkflow not yet completed).
    Kindly reply me ASAP.
    Thanks and Regards
    Madhukar .

    Yes I am setting SWC_SET_ELEMENT for my container values,the ones for which i have defined as EXPORT.
    And I have checked the task also...
    Everything has been checked properly..The binding is fine.
    Thanks & regards,
    Ravikiran Kallimath

Maybe you are looking for

  • TS3161 iWeb 'disappeared' from my iMac after upgrading to OS X10.8 - any ideas? tkx

    iWeb 'disappeared' from my iMac after upgrading to OS X10.8 - any ideas? tkx

  • Troubleshooting: Help please. Creating a PDF file from a Photoshop-designed project

    I wanted to add personal design elements to my resume so I decided to use Photoshop to add in a logo and a footer. The problem is, when I converted the 3 Photoshop .psd files (3 pages) to .pdf files, the combined file came out to be very big in size.

  • Ipod wont sync

    so recently i got my computer reformatted i have 2 hard drives in it one with all my stuff on it and the other is new so i tried to sync my ipod after i reformatted and now it wont sync the songs and video comes up with 2 error messages itunes could

  • How to include certain shared fonts (AS2 on CS3)

    Hey everyone, I have a project which uses three different embedded fonts within it across a number of different swfs. As a result i have a separate fonts.swf file which contains the fonts and then i share them (so as not to have to load them within e

  • Safari does not cache videos

    Every time I visit a page with movies (quicktime even), Safari reloads the video as if there is no cache. If I use Firefox it does not need to reload the video, it just automatically plays the video from the cache. If I watch Apple Trailers or visit