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.

Similar Messages

  • How to retrieve data from workflow container ?

    Hi ,
    I  have to retrieve workflow container ID (not sure , may be it is workitem ID). Using that ID I have to fetch data from workflow container . If anyone is aware of it , help me out . It would be better if u can provide some code snippets.
    Thanks in Advance.
    Regards,
    Vishesh

    Thanks Vishal!!!
    I  am  not  aware about workflow. I don't know anything about it so I had posted it in this forum.
    Regards,
    Vishesh

  • 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.

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

  • 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

  • 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.

  • 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]

  • 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

  • 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

  • How to retrieve ABAP query field metedata using SAP JCO?

    How can I retrieve all field details (such as field name, field description, output length field type) using SAP JCO for an ABAP Query?
    I have query name, user group, query area and infoset name with me.
    Thanks

    Hi,
    Please use the DDIF_FIELDINFO_GET (standard) Function Module to retireve the details which you have mentioned.
    Thanks,
    Arun

  • How to retrieve data dynamically from db using db adapter in 11.1.1.4 jdev?

    in my bpel process,i am invoking db by passing a variable which is there in db table.with that variable, iam trying to retrieve data.But i don't know the code for dynamic retrieval.I am a fresher.So please help me .

    Hi',
    I think you are trying to do this "select empName from emp where empID=$empid" and the $empid should dynamically come.
    check this http://kr.forums.oracle.com/forums/thread.jspa?threadID=674513
    -Yatan

  • How to retrieve VM's IP Address using WMI query

    Hi,
    Please let me know the WMI query to retrieve the IP of the Hyper-V VMs via Host.
    Regards
    Raamesh Keerthi N J

    try this in powershell
    $VMS = get-vm
    $outputArray = @()
    foreach($VM in $VMS)
          $output = new-object psobject
          $output | add-member noteproperty "VM Name" $VM.Name
          $output | add-member noteproperty "Description" $VM.Description
          $output | add-member noteproperty "RAM(MB)" $VM.Memory
          $output | add-member noteproperty "vCPU" $VM.CPUCount
          $output | add-member noteproperty "Status" $VM.Status
          $output | add-member noteproperty "State" $VM.VirtualMachineState
          $output | add-member noteproperty "IsHighlyAvailable" $VM.IsHighlyAvailable 
          $output | add-member noteproperty "Cloud" $VM.Cloud
          $output | add-member noteproperty "HostName" $VM.Hostname
          $output | add-member noteproperty "Integration Tools" $VM.VMAddition
          $output | add-member noteproperty "Operating System" $VM.OperatingSystem
          $output | add-member noteproperty "Location" $VM.Location
          $output | add-member noteproperty "VMID" $VM.VMID
          $outputArray += $output
    write-output $outputarray | sort "VM Name" | format-table * -autosize | out-string -width 600 | out-file $file -append
    Get-SCVirtualNetworkAdapter -all | select name, vlanid | sort "Name" | format-table * -autosize | out-string -width 600 | out-file $file -append
    #load the report in notepad
    notepad.exe "C:\scripts\reports\Report_$DATEStamp.txt"
    exit
    [email protected] visit my blog stephanco.blogspot.com

  • How to retrieve column name from Excel using POI HSSF eventusermodel?

    Hi ,
    I am simply reading the excel sheet and writing in a txt file. I have done the following in the switch construct. It works fine but I want to retrieve only the column header. But this code gives me all available strings in the excel sheet. Any pointer would be greatly appreciated.
    case SSTRecord sid : 
             SSTRecord sstrecord = (SSTRecord) record;
             for (int i=0; i<sstrecord.getNumUniqueStrings(); i++){      
                  System.out.println(" Column name" +  sstrecord.getString(i));
    break;bye for now
    Sat

    try labels:
            case LabelSSTRecord.sid:
                LabelSSTRecord lrec = (LabelSSTRecord) record;
                if (lrec.getRow() == 0) {
                    System.out.println(" Column name "
                            + sstrec.getString(lrec.getSSTIndex()));
                break;

  • "Smart update" question or how to overwrite the library in current use

    Hello,
    I would like to add a "smartUpdate" feature to an application i.e.
    1. Read an updated library from the web (e.g. as archive- zip)
    2. Extract files from archive and write them to a local drive.
    3. After all the files are written, close the appliaction and restart it.
    #1 is easy enough, there problems is with #2 and #3.
    I will need to overwrite jar file that the running application is using.
    Does anybody has experience with this. Any ideas how to do this.
    Thank you.
    Leo

    Appreciate any other ideas...If you have to exchange classes in an application while it is still running, this will always be a bit tricky (if not
    impossible). It is much easiser to close and restart the application (= make the OS call the Java-interpreter again). But if you decide, that restarting from the OS is not possible, there is some work to do :-)
    There are three main problems:
    1. If your classes are loaded from Jar-files, the Jar-files will be locked by the java-process. Once a class has been loaded from a Jar-file, that file is write-protected
    2. Java will not reload a class that it has already loaded, even if the Class- or Jar-File has changed
    3. Even if the class would be reloaded, this could not affect any instances of these classes.
    Problems 1 and 2 can be solved by using a custom ClassLoader (this is still 100% pure Java, no hack or
    something).
    This custom ClassLoader could be written in a way that it could close the Jar-Files on demand (closing the Jar-File every time a class has been loaded would slow down class loading significantly).
    To force reloading (=using the new jar-file) you would have to instantiate a new ClassLoader (= another instance of your own custom ClassLoader). This new ClassLoader will use the new versions.
    The third problem is just a matter of your application; you must ensure that it re-instantiates everything with the new ClassLoader.
    So, it would be something like:
    //Create custom CLassLoader
    MyClassLoader cl = new MyClassLoader();
    //--- start update code (assuming my.package.MyClass1.main will receive the new jar-file)
    Class mc = cl.loadClass( "my.package.MyClass1");
    Method main = mc.getMethod( "main", new Class[]{ String[].class } );
    main.invoke( null, new Object[]{ new String[0] } );
    //--- overcome write-protection
    cl.closeFiles();
    //--- now copy the new Jar-File into the appropriate directory
    //--- dispose first ClassLoader and create a new one
    cl = new MyClassLoader();
    //--- start app (assuming my.package.MyClass2.main is the "real" application)
    Class mc = cl.loadClass( "my.package.MyClass1");
    Method main = mc.getMethod( "main", new Class[]{ String[].class } );
    main.invoke( null, new Object[]{ new String[0] } );All this ClassLoader stuff is a bit tricky, but this kind of "smart update", where you exchange classes while the VM is still running, is not a trivial problem (though
    it's quite common if you're write application servers).
    HTH
    Matthias

  • How to remove elements/attributes from XML using Xpath in XSLT ??

    Hello ,
    Is there anyway or method of Xpath from which I can delete the elements and attributes from XML at runtime ??
    Like I have such XML and I have to remove per attribute highlighted below
    <person per="and">
    <e:emp a="ir" b="ad" >
    </e:emp>
    </person>
    And want a result like this
    <person>
    <e:emp a="ir" b="ad" >
    </e:emp>
    </person>
    Thanks

    To achieve this you can use the bpelx:remove function: http://download.oracle.com/docs/cd/E12483_01/integrate.1013/b28981/manipdoc.htm#CIHJBJFD
    your assign will look like:
    <bpel:assign>
    <bpelx:remove>
    <target variable="person" query="/person/@per" />
    </bpelx:remove>
    </bpel:assign>
    Regards,
    Melvin

Maybe you are looking for