Use SAP_WAPI_READ_CONTAINER to read all container element

Hi All,
I am writing an ABAP to read message texts from a workflow container. The text is stored in a container element called RejectionTexts which is a multiline container element.
When I call the Function Module SAP_WAPI_READ_CONTAINER it brings be back the "standard" container elelments but doesn't return the element RejectionTexts.
Am I doing something wrong or is there another FM for getting the other container elements?
DATA: lt_container LIKE swr_cont OCCURS 0 WITH HEADER LINE.
DATA: lt_worklist TYPE swr_wihdr OCCURS 0 WITH HEADER LINE. "PH9K008190
DATA: lt_message_lines  LIKE  swr_messag OCCURS 0 WITH HEADER LINE,
      lt_message_struct LIKE  swr_mstruc OCCURS 0 WITH HEADER LINE,
      lt_subcontainer_bor_objects LIKE  swr_cont OCCURS 0 WITH HEADER
LINE,
      lt_subcontainer_all_objects LIKE  swr_cont OCCURS 0 WITH HEADER
LINE.
lt_worklist-wi_id = '495105'.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
  EXPORTING
    workitem_id                    = lt_worklist-wi_id
*   LANGUAGE                       = SY-LANGU
*   USER                           = SY-UNAME
* IMPORTING
*   RETURN_CODE                    =
  TABLES
    simple_container               = lt_container
   message_lines                   = lt_message_lines
   message_struct                  = lt_message_struct
   subcontainer_bor_objects        = lt_subcontainer_bor_objects
   subcontainer_all_objects        = lt_subcontainer_all_objects.

It looks like that if there is no value on the container for RejectionText the container element doesn't come through as a blank (even though the other container elements come through if they are blank).
Once I manually popuated an entry and read the container again the value appeared.
Thanks for the help,
Colm

Similar Messages

  • Read Workflow Container Elements attributes

    Hi,
    I am using a F.M <b>'RH_GET_TASK_ATTRIBUTES'</b> to get the attributes of the <b>Workflow container</b> elements.
    But the above F.M does not show the element attributes that I create inside the Workflow Builer under <b>Workflow Container Block</b> and I dont select either Import or Export Properties.
    Is there any F.M that reads ALL Workflow Container elements.

    If you want to clear a single element, use a container operation and assign it to space. If you need to clear an internal table, create another internal table container element that is always empty. Then, inside the container operation assign the empty table to the table you want to clear.
    Basically, you are doing this:
    container_element = space. OR container_element = ' '.
    container_internal_table[ ] = container_empty_internal_table[ ].

  • Text_io using webutil not reading all characters correctly

    Hello all,
    is anyone familiar with this problem: using client_text_io to read a word-generated html-page. With Forms 4.5 using text_io this worked fine, with webutil certain chars are not transferred correctly (getting upside down question marks in the text). Is the charset that is supported by client_text_io smaller than the charset supported by text_io?
    Note: forms on web are started with the same NLS_LANG setting as the old 4.5 C/S forms.
    Regards, Ron

    Webutil does not currently do any characterset translation for you. So if your Forms Server is running in a character set which is not the same or not a superset of the one on your client you can have this issue

  • Read Simple container element

    Hi,
    I have implemented the SAP_WAPI_READ_CONTAINER module function in Java Web Dynpro. This module function retreive information stored in a workflow container.
    In my view, I have mapped the simple container context element to a table and I can see the data.
    Now I would like to retreive the data individually and out of the table. The problem is that I have no idea how I can manage to do that. Can anyone give me a hand to solve that problem ?
    Thanks in advance for your help.
    Thibault

    Hi,
    You can traverse the node and get the each element (row). Please find below the sample
    for ( int i = 0; i < node.size(); i++) {
    <variable1> = wdContext.node<Node>().get<Node>ElementAt(i).get<Attribute>;
    <variable2> = wdContext.node<Node>().get<Node>ElementAt(i).get<Attribute>;
    - Saravanan K

  • Use JFilechooser to read all Files inside Directory

    Hello gang!
    I was wondering how to modify the code below to allow it to select Files AND Directories. If it selects a Directory, I want it to be able to look in that directory for all .jpg files, and return a list of all the jpg files to me. It does not have to search in any subfolders..only the folder that the user selects with the jfilechooser.
    File defaultDirectory = new File("C:\\"); // Set Default Directory
    JFileChooser fc = new JFileChooser( defaultDirectory );
    fc.addChoosableFileFilter(new ImageFilter());
    fc.setFileView(new ImageFileView());
    fc.setAccessory(new ImagePreview(fc));
    fc.setMultiSelectionEnabled(true);
    int returnVal = fc.showDialog(currentFrame, "Attach");
    if (returnVal == JFileChooser.APPROVE_OPTION)
    File files[] = fc.getSelectedFiles();
    for (int b=0; b < files.length; b++)
    String pathName = files.getAbsolutePath();
    storeInfoRef.setFiles(pathName);
    defaultDirectory = files[0];
    fc.setCurrentDirectory( defaultDirectory ); // New Default Dir
    else
    { System.out.println("Attachment cancelled by user"); }

    I have solved my problem. For anyone with a similar problem here is the code I added since my last post
    JFileChooser fc = new JFileChooser( defaultDirectory );
    fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fc.addChoosableFileFilter(new ImageFilter());
    fc.setFileView(new ImageFileView());
    fc.setAccessory(new ImagePreview(fc));
    fc.setMultiSelectionEnabled(true);
    int returnVal = fc.showDialog(currentFrame, "Attach");
    if (returnVal == JFileChooser.APPROVE_OPTION) //If Button Pressed
    File files[] = fc.getSelectedFiles(); // Get Users Selections
    for (int b=0; b < files.length; b++) // For Each Selection
    if ( files.isDirectory() ) // If User Selected a Directory
    File[] folderFiles = files[b].listFiles(); // Get contents of folder
    log.append("For folder: " + files[b].getName() + "." + newline);
    int count=0; // Keeps Count of # of Image Files
    for ( int i=0; i < folderFiles.length; i++ ) // For each item in folder
    if( (folderFiles.getName().endsWith(".jpg") ) || //If file is an Image
    (folderFiles[i].getName().endsWith(".jpeg")) ||
    (folderFiles[i].getName().endsWith(".bmp") ) ||
    (folderFiles[i].getName().endsWith(".gif") ) ||
    (folderFiles[i].getName().endsWith(".tif") ) ||
    (folderFiles[i].getName().endsWith(".tiff") ) )
    System.out.println( folderFiles[ i ].getName() );
    String pathName = folderFiles[i].getAbsolutePath(); //Get Path of File
    storeInfoRef.setFiles(pathName); //Save Path of File
    log.append(" Attaching file: " + folderFiles[i].getName() + "." + newline);
    count++; //Increase Counter
    if ( count == 0 ) // If No Images
    log.append( " There are no Image Files to Attach" );
    else if ( files+.isFile() ) // If User Selected File(s)
    String pathName = files[b].getAbsolutePath();
    storeInfoRef.setFiles(pathName);
    System.out.println ("File Size: " files[b] +" is "+files.length() );
    log.append("Attaching file: " + files[b].getName() + "." + newline);
    defaultDirectory = files[0];
    fc.setCurrentDirectory( defaultDirectory ); // New Default Dir
    else
    { log.setText("Attachment cancelled by user." + newline); }

  • Read Workflow container

    Hi,
       I am using SAP_WAPI_READ_CONTAINER to read the container. In the container i have a structure and the result of this function module gives the list of container elements, but the structure as structure names and not as field names.
    EX: 'Personal' structure of type P0002, gives output with element name P0002 and not with the field names of P0002.
    Is there any way to get output like that?
    Thanks,
    Sri

    You must find your structure in SIMPLE_CONTAINER you have to put code to get data ..
    Example :
      CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
           EXPORTING
                WORKITEM_ID      = L_WI_ID
           TABLES
                SIMPLE_CONTAINER = LT_CONTAINER
           EXCEPTIONS
                OTHERS           = 1.
      READ TABLE LT_CONTAINER WITH KEY ELEMENT = '_WI_OBJECT_ID'.
      IF SY-SUBRC EQ 0.
        MOVE LT_CONTAINER-VALUE TO LS_POR.
        SELECT SINGLE * FROM SWXFORMABS
          WHERE FORMNUMBER = LS_POR-OBJKEY.
        IF SY-SUBRC EQ 0.
          SWXFORMABS-PROCSTATE = L_INPUT.
          IF SY-SUBRC EQ 0.
            EXPORT L_PREPROCESSED TO MEMORY ID 'PREPROC'.
            L_OKAY = 'X'.
          ENDIF.
        ENDIF.
      ENDIF
    Regards,
    Gurprit Bhatia

  • Container Element in ALERT

    Dear Experts,
    Can you plz explain, when it is required to create a CONTAINER ELEMENT in Alert Configuration.?  As we can use the System Defined Variables like  SXMS_ERROR_CODE, SXMS_FROM_INTERFACE etc, what is the need for the container element?
    The System Defined Variables are filled by the System during Runtime, when such an error happens. But who ‘ll fill  the Customized Container Variable and how??
    Also while creating a Container Element for ALERT, the data type can be of OBJECT TYPE/ ABAP DICT.REFERENCE/ABAP DICT DATA TYPE. What is the significance of each?
    Plz explain.
    Regards,
    Navneet

    Hi Navneet,
    The container element contains all the control information required at run time in the form of constants and object references.
    To inform the WF which object was created in the step via the method the reference to the bus object is passed via the binding definition from the task container to the Wf container. An appropriate element was therefore created automatically in the WF container with the correct data type.
    The workflow container contains an element which is defined with a data type reference to the same object type that is created in the referenced task, this binding definition is proposed automatically when an activity is defined.
    If no element with an appropriate data type reference is available in the workflow container, a suitable element is added to the workflow container and the binding entered.
    For more info pz go through the link given below,u will get the useful info regarding creation of container element and much more .
    http://****************/Tutorials/Workflow/Workflow.htm
    Reward points if this helps
    Regards
    Vani.

  • Container element for Count in Parallel Approval Workflow

    Hi Gurus,
    We are using ECC 6.0 and I have this below requirement. Please share your thoughts on how we can achieve this.
    We are using a User decision step in parallel workflow to generate and send individual work items to multiple approvers. that is, we generate multiple work items and send to individual approvers for the same step in the workflow and get the combined result (Approve or Reject) to proceed further. I understand that individual result for each work item is stored in container element '_RESULT' (0001 for Approve, 0002 for Reject) and combined result of all the sub-work items is stored in '_WI_RESULT' (0001 for Approve, 0002 for Reject). Also, we can see the index # of work items generated for the same step (node) from container element ''_WF_PARFOREACH_INDEX'.
    My requirement is to set work item to COMPLETED status after we obtain a certain # of APPROVE (_RESULT = 0001) decision. Let's say, after 2 of the approvers say Ápproved', then I'd like to close all the other relevant work items and set the Combined result '_WI_RESULT'to APPROVE and Complete the relevant work item. I was wondering if there is a container element that holds the (count) # of work items generated in individual work item container so that I can keep reading this value to see how many decisions have been made. That is, for example, If there are 3 parallel work items generated and 1st user said Äpproved',  is there a way to know out of a total of 3 approvals (to get the combined result '_WI_RESULT'), one is completed and 2 approval decisions are still pending. I'm trying to use step-level Pgm Exit (After_execution Method) to read this container element for # of approvals done and if the combined result '_WI_RESULT'is '0001'(Approve), i'll try to end other work items. One way of doing is to have a custom table to capture this and keep reading this table after each decision. But, I don't want to have all this customization and I believe there should be a way the SAP is storing somewhere this # of completed or Pending approval work items that got originated from a single step/node. One way of doing could be, after each decision, read the dependent work items (having same node # and Parent Work item etc.,) and get the other relevant work items and read their status etc., But I think this is a lengthy process and may be there is an easier way, perhaps some container element that holds this information.
    Please let me know if you need any clarification on my requirement and share your thoughts on how I can achieve easily.
    Appreciate and thank you in advance for your help.
    Regards,
    Venu

    Hi Karri,
    Thank you for your reply. I was actually doing the same with having an APR_COUNT and passing that for each of individual work items and bind it back to task--> wflow container. And keep checking this counter in wf container.
    Once, we obtain certain # of approvals, then I guess I'll have to complete or cancel the other work items.
    I was thinking may be there is some container element already exists that keep track of this, I guess not .
    Thanks for your input
    Regards,
    Venu

  • XML DB: is it possible to get a row for each element in a container element?

    I have an XML document containing a container element (collection). If I query, using an XPath expression, the contained elements I get a row for each container element with the contained element concatenated. Is it possible to get a row for each contained element?
    I run this simple query:
    select extract(xmltype('<colors><color>Red</color><color>Green</color></colors>')
    , '/colors/color/text()').getstringval() from dual
    And get this result:
    EXTRACT(XMLTYPE('<COLORS><COLOR>RED</COLOR><COLOR>GREEN</COLOR></COLORS>'),'/COL
    RedGreen
    1 row selected.
    What I would like to have is:
    Red
    Green
    2 rows selected.
    Wishful thinking or possible? Many thanks!

    Sure. This is where our XMLSequence() function comes in. It allows you to treat the top-level nodes in a nodeset as if they were rows in a table when combined with the TABLE() operator. Here's an example.
    First, to make the SQL look a little cleaner, I like to define a function like this:
    create or replace function testdoc return xmltype as
    begin
      return xmltype('<colors><color>Red</color><color>Green</color></colors>');
    end;.
    To break out the nodeset of <color> elements as a table, we use the following query:
    select value(list_of_color_elements).extract('*/text()').getStringVal() as color
    from TABLE( XMLSequence( extract(testdoc(),'/colors/color'))) list_of_color_elements.
    Or, using the new-in-9.2 extractValue() operator so we don't have to remember the text() part:
    select extractValue( value(list_of_color_elements), '.') as color
    from TABLE( XMLSequence( extract( testdoc() ,'/colors/color'))) list_of_color_elements.
    Here the TABLE(XMLSequence(...)) combo produces a table of XMLType, with one XMLType object in each row of the table.
    In general, if the XMLType instance were coming from an XMLType table xmltab the query would look like this:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( value(x),'/colors/color'))) colors.
    And if the XMLType were instead in a column of XMLType named doc in a table xmltab, then we would have the syntax:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( x.doc ,'/colors/color'))) colorsOnce you get the hang of it, you'll see that the combination of TABLE(XMLSequence()) to "shred" XML nodes into rows, and XMLAgg() to aggregate fragments of XML across multiple rows back into a single document, is quite powerful.

  • Displaying Container element in send mail

    Hi Experts,
    I am a beginner in SAP Workflows. I  have created a simple wokflow in which a mail is sent to a particular user.The workflow is triggered whenever a  complaint (BUS20000120)is raised.Now I want to display values of certain container elements in the workflow.I  have  also created a container element based on BUS20000120. But every time I use some or the other container element attributes, in the mail it is displayed '<BONmae>.<Attributename> not  found.
    I  am  not  getting  any  solution to this problem.Please  help  me.....

    Hi Raja Sekhar,
    The  start  event  of  my  workflow  is  'created' event  of  the  Business Object (BUS20000120) .But where to implement the binding for  the  'EVT_Object'?The start  event  for  the  workflow  is  firing  as  I  have  checked  in  the  transaction 'SWEL'  and  also  the  mail  is  being  sent  to  the  desired  user.The  only  problem is  that  I   cannot  display  any  data  of  my  container  element  based  on  Business Object  BUS20000120 . I  can  display  elements  of  the  system  container  like  current  date  ,time  etc. Please give me  a  solution.Infact  this  is  happening  to  some  other  workflows  as  well.

  • Container Element!!!!!!!! in workflow

    Hi to alll.....
        Can anyone throw some light on "Container element " in workflow....
         Why do we need that ? whats the purpose of that..
      Plz its urgent..
    Regards,
    Sanjana

    hi Sanjana,
    The workflow container contains an element which is defined with a data type reference to the same object type that is created in the referenced task, this binding definition is proposed automatically when an activity is defined.
    If no element with an appropriate data type reference is available in the workflow container, a suitable element is added to the workflow container and the binding entered.
    For more info pz go through the link given below,u will get the useful info regarding creation of container element and much more .
    http://****************/Tutorials/Workflow/Workflow.htm
    please reward if u find the info useful for u
    regards
    ashish

  • TIMESTAMP container element in ALRTCATDEF

    I have tried to use with the below mentioned container elements from alrtcatdef but nothing was getting displayed in alerts
    I need the timestamp container element in alrtcatdef to configure as longtext/shorttext, where it can carry the alert triggered timestamp
    1. &TIMESTAMP&
    2. &TIMESTAMPL&
    3.&/ISCER/TIMESTAMP&
    Thanks

    Hi,
    have a look into this document, you will get the answer.
    http://sapdocs.info/wp-content/uploads/2009/01/alert-configuration-in-xi.pdf
    Regards
    Aashish Sinha

  • GoldenGate : Why to read all the Redo or Archive, can't we skip ??

    Hi All,
    I have a big doubt if anyone can give clarity. The scenario is :- In my environment data is flowing from Oracle to Oracle but Huge transactions in Millions and we use this tool basically to improve LAG when we get data for reporting.
    Now let's say I have database user A which is doing some temporary transaction on source for couple of hours but it is HUGE and generating lot of archives AND we don't want to flow any data from the transaction being performed by user A - so we use EXCLUDEUSER A parameter.
    Now during same time if any other user say B is performing some operation in one table - we want it to flow, So it is flowing normally BUT the main problem is LAG increased like anything cause GoldenGate is now reading all the redo or archives which of no use and data is flowing very slowly :( :(
    My point was will it be also possible that I don't want my GoldenGate to read any redo log or archives if the user A is performing operation and read only those archives if user B or any other user is performing some operation. This will improve the LAG cause even though we ignore the particular user, It is still going to read all the redo or huge archives generated by user A or user B or whatever in sequence, Please correct me if I am wrong ?
    I suppose goldengate is going to read all the transaction regardless of A or B user. Only it will ignore the A and process transaction of B.
    I know it reads in sequence but can't it read specific archives which is useful instead of reading all.

    Hi Steven,
    Thanks for your reply.
    I agree with you that "normal" mode of GoldenGate is to capture changes and replicate them and Ofcourse I want it to capture any changes but I don't want it to pass through reading all the archives if I am ignoring one user who is performing HUGE temporary transaction and generating huge archives.
    It is going to slow down all the other small transaction changes cause it is passing through all those archives also which is of NO use. Do you mean that "Integrated mode" of new Goldengate version will work in that case ?
    Please help, I really need this information. It will help everyone.

  • Error while using container element _WF_PARFOREACH_INDEX in workflow

    Hi All,
    I am using internal container element WFPARFOREACH_INDEX in internal table so that i can use it as index to read table row one by one..but in binding i am getting error "Container element '_WF_PARFOREACH_INDEX' does not exist" in form of an example.
    Can someone tell me that how to get rid of this error in binding? I am using this element variable to achieve parallel branching in workflow.
    Regards,
    Sumit

    Hi AA,
    You would probably need to create more than one containers.
    In workflows, we have following types of containers:
    1. Workflow container
    2. Task Container
    3. Event Container
    Now, since you need the element VBELN, try the following:
    1. Create a WF container for VBELN. Make it as both input and output parameter.
    2. Create a container for the Mail Step, again with VBELN field as an input parameter.
    3. There would be a button for binding in the mailstep. Bind the Field VBELN from Work flow container to the Mail Step container.
    Once binding is done, save it and Activate the Workflow.
    Hope this helps.
    Do get back in case of any issues.
    Regards,
    Sonal

  • Unable read container element in the BO

    Hi
    I have created a new container element in the task and trying to pass the value and read the same value in the bussiness object method
    using the statement   "SWC_GET_ELEMENT CONTAINER 'Classification' l_KLGRU1". I have created the the container element in parameters of the BO method.
    In the task binding I am direclty passing the container value i.e my case
    Classification  = FI
    "SWC_GET_ELEMENT CONTAINER 'Classification' l_KLGRU1".
    But the above statement is not returning the value at all.
    Where am I going wrong....
    Regards,
    Krishna prasad

    This question is going waaaaaayyyy off-topic, sorry about that Krishna. Just a final response from me, pointing people in the right direction if they are not already aware of another great forum.
    There is a debate (see the Coffee Corner forum which I try to read at least a few times a week) going on with respect to technical solutions to reduce the number of repeated questions and questions to which the answer is available on help.sap.com. There are many suggestions already, some of which are:
    forcing a forum search before posting (as when creating customer messages on service.sap.com)
    restricting the number of open questions a user can have
    a solution as in Experts Exchange where asking a question cost you some points, thus encouraging people to find the answers from previous questions and saving their points for a question that they <u>really</u> can't find an answer to
    forcing a period as lurker, i.e. a new member can not post before he has visited the forums X number of days
    Obviously, not all suggestions will be implemented, and not all are desireable. For instance, forcing a period as a lurker can shut out people who have spent 15 days trying to solve a problem on their own before finally deciding to give SDN a try.
    PS: Mike's last name is Pokraka, I had to double-check it quite a few times before I finally could remember it - my variation was Pokarka

Maybe you are looking for

  • Can i  view a list apps that were purchased from shared account

    can i reveiw a list of apps that were purchased from shared account

  • Logical multiply instead of pause trigger

    Hello all! Can some one help me with gating counter with another one, i want to produce modulated timebase, first counter generate pulses in continuous mode, and another one does the same, but with lower frequency, for example f1 = 20Hz, f2 = 0,1 Hz.

  • Dragon Dictate headset not recognized by V3

    The usb headset came with Dragon Dictate v3.  After defining the Profile and proceeding to Training, I am instructed that I need to attach the headset!!! I have been a user of Dragon Dictate since its inception  ... it isn't me! Frustrated Chuck

  • Runtime Error:MESSAGE_TYPE_X in VA01 tcode

    Hi All, I got VA01 tcode Dump While Entering the Texts, in that dump it is showing use SAP note 158985 , By using That note number verifed finally i got one relevent note 1104496. And i applied that but still getting same dump. Can any body help me t

  • Unable to start - emctl start iasconsole

    Dear All, when i try to start Enterprise manager by emctl start iasconsole.......it shows the bellow --> $ emctl start iasconsole Oracle Enterprise Manager 10g Application Server Control Release 10.1.2.0.2 Copyright (c) 1996, 2005 Oracle Corporation.