PASS DATA FROM ABAP PROGRAM TO WORKFLOW CONTAINER

Hello Everybody,
I am a workflow beginner and I want to pass a data from my ABAP code to a workflow container. This workflow container is used in the Send Mail step.
The ABAP  Program is:
REPORT  zdb_work_flow.
tables : vbak.
DATA : k TYPE sweinstcou-objkey,
            e TYPE swetypecou-event.
DATA : st TYPE swcont,
            itab TYPE STANDARD TABLE OF swcont.
PARAMETERS : vbeln TYPE vbak-vbeln.
start-of-selection.
  st-element = 'VBELN'.   "This is my WORKFLOW CONTAINER
  st-tab_index = 1.
  st-elemlength = 10.
  st-type = 'C'.
  st-value = vbeln.
  append st to itab.
  k = vbeln.
  e = 'TRIGGER'               "This is an event in my BUS OBJ ZDB_WFLOW
  CALL FUNCTION 'SWE_EVENT_CREATE'
    EXPORTING
      objtype                               = 'ZDB_WFLOW'   "My BUS OBJ
      objkey                                 = k
      event                                  = e    "Event TRIGGER in ZDB_WFLOW
    tables
      event_container               = itab
    exceptions
      objtype_not_found             = 1
      OTHERS                        = 2
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.         .
  COMMIT WORK.
Now I have created a workflow in SWDD as ZDB_WF_SW.
In this WF I have created a container as VBELN.
In the SEND MAIL I have given a header as "Worflow Triggered for &VBELN&"
PROBLEM.
The Workflow is getting triggered. I am also getting a mail "Workflow Triggered for" in my mailbox but the &VBELN& is missing from the header.
I have set the IMPORT EXPORT flag of the WF CONTAINER "VBELN"
Please Help.
Edited by: Deepankar.B on Feb 22, 2011 4:08 PM
Edited by: Deepankar.B on Feb 22, 2011 4:10 PM

You wouldn't use a SMA as an assistance class - but refer to one within it.
I would use Shared Memory Area classes - but I'd also build a SMA that could talk across multiple application servers.
Thomas Jung proposed this in a forum reply some time ago.
It shouldn't be too difficult to use RFC's to access the content of SMA's in multiple app servers - ensuring synchronisation across multi app servers. I've not yet had the need, so haven't attempted.
The long polling in 7.02 apparently uses this approach, so in a 7.02 system there may even be standard components/ SMAs that you could use.
I do not think global areas in FM's are available across sessions - I don't think you could use that as a data transport.

Similar Messages

  • Passing data from abap-program to mssql database table thro native sql

    Hi,
    To pass the data from abap-program to mssql server,i have created database connection through dbco t.code.
    now i am trying to get connection thro native sql but am not able to get it .Am working in ECC 5.0.
    Could anyone help me on this.Did i miss anything?
    i have tried Native-sql like this.
    DATA: CON_NAME LIKE DBCON-CON_NAME VALUE 'BIW'.
    EXEC SQL.
      CONNECT TO :con_name AS 'C1'
    ENDEXEC.
    Thanks in advance.

    Hi,
    Trying to do the same here, only using Oracle DB.
    DATA:     dbc TYPE DBCON_NAME VALUE 'BI'
    TRY.
      EXEC SQL.
        CONNECT TO :dbc
      ENDEXEC.
      IF sy-subrc NE 0.
        RAISE EXCEPTION TYPE cx_sy_native_sql_error.
      ENDIF.
    CATCH cx_sy_native_sql_error INTO oref_native_sql_error.
      sql_emsg = oref_native_sql_error->get_text( ).
      MESSAGE sql_emsg TYPE 'I'.
    ENDTRY.
    I keep getting the message 'Native SQL exception has occured' (because of the RAISE statement, I wonder how we can get a meaningfull error description).
    Of course this can be a result of a number of network issues, so I'm trying to resolve this together with my BC admin.
    I suggest the same to you..
    In the meantime, if anyone can help out, it will be appreciated.
    Regards,
    SD

  • Passing data from ABAP to MSSQl

    Dear Experts,
                 I have an requirement to pass the data from Abap to Mssql server. Is it possible thro bapi? or should i follow ALE?
    Pls Give some ideas to proceed.
    Thanks in Advance.

    Closing this thread...

  • Passing data from user exit to workflow.

    HI,
    Please consider the below scenario.
    In the user exit 'MV50AFZ1' I have created an include in the form 'USEREXIT_SAVE_DOCUMENT_PREPARE.'.
    In this include based on some certain conditions a workflow is triggered.
    I am using the function module 'SWE_EVENT_CREATE' to trigger the workflow.
    Now the requirement is to pass some data from this user exit ('USEREXIT_SAVE_DOCUMENT_PREPARE') into the workflow.
    Could someone please explain me how to pass this data from the user exit into the workflow ?
    Thanks in advance.
    With regards
    Abhishek

    Hello everybody,
    Thanks a lot for your responses.
    I am using the fuction module 'SAP_WAPI_CREATE_EVENT' to trigger the workflow, I am also able to pass the delivery number through the paramater 'OBJECT_KEY' of the function module in to the workflow container.
    But I am unable to pass the line item number and the material number into the workflow.
    I am following the below process:
    I have defined a stucture ZST_DELIVERY containing the POSNR and MATNR in the data dictionnary.
    I have pouplated the internal table of this structure inside my user exit.
    Then I m passing the values of the above internal table into another internal table - 'Container''which is of structure type 'SWR_CONT'.
    And I am passing the internal table 'Container' into the paramater 'INPUT_CONTAINER' of the function module 'SAP_WAPI_CREATE_EVENT'.
    And in the workflow I have created a container 'ST_DELIVERY' which is of the structure ZST_DELIVERY and I have made it 'import', 'export.'
    And in my business object ZLIKP in the custom event CheckPrice I have defined a paramater 'ST_DELIVERY' of the structure  ZST_DELIVERY and I have made it multiline.
    And in I have binded my workflow container 'ST_DELIVERY' and the ZLIKP paramater with the same name.
    Please do let me know if the above steps that I have followed is correct.
    Please do let me know if any further information is required.
    Thanks in advance,
    ~Regards
    Abhishek

  • Reading XML Data from ABAP Program?

    Hi,
    How do I read XML Data from an ABAP Program? For example if I have the below basic XML Code-
    <xml>
    <Name> Thiru </Name>
    <Age> 24 </Age>
    <City> chennai </Chennai>
    </xml>
    How do i read the data within the Name,Age, and City tags into variables in the ABAP Program?
    Regards,
    Thiru

    if you decide to do in XSLT, I have a sample list here:
    XML file like this:
    <?xml version="1.0" encoding="UTF-16"?>
    <F>
    <P1>
    <t_1>value1</t_1>
    <t_2>testvalue</t_2>
    </P1>
    <P2>
    </P2>
    </F>
    XSLT file like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:template match="F">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <<b>DOCUMENT</b>>
    <xsl:apply-templates/>
    </<b>DOCUMENT</b>>
    </asx:values>
    </asx:abap>
    </xsl:template>
    <xsl:template match="P1">
    <ENTRY>
    <<b>T_1</b>><xsl:value-of select="t_1"/></T_1>
    <<b>T_2</b>><xsl:value-of select="t_2"/></T_2>
    </ENTRY>
    </xsl:template>
    </xsl:transform>
    ABAP program like this:
    DATA: BEGIN OF wa_upload,
    text(255) TYPE c,
    END OF wa_upload,
    itab_upload LIKE TABLE OF wa_upload,
    BEGIN OF wa_document,
    t_1 TYPE string,
    t_2 TYPE string,
    END OF wa_document,
    itab_document LIKE TABLE OF wa_document.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'XXXXX'
    filetype = 'ASC'
    TABLES
    data_tab = itab_upload.
    CALL TRANSFORMATION zrappel_xml_test
    SOURCE XML itab_upload
    RESULT <b>document</b> = itab_document.
    You should pay attention to the bold words.
    hope it will be helpful
    thanks

  • Upload data from abap program to abap inbound proxy

    Hi,
    I have requirement to upload flat file data to an internal table and call Inbound proxy abap class and pass all the internal table data to tha proxy clas method structure.
    So could any one help me how to send/pass data to class, Please give some e.g.
    thanks
    bobby
    Edited by: Bobby G on Nov 18, 2009 4:35 AM

    hi;
    you may follow the following ways
    1. create a report and by using GUI_upload, give the path as default , you can convert the flat file's data into internal table.
    2. call that report in proxy method by returning parameter as a table, this table can use further in the proxy.
    Another way, you have
    1.  Create a transparent table and by using the GUI_Upload in report,  you may  store the data.
    2.  from step 1, you may use data in the proxy.
    Regards
    Shashi

  • Import data from ABAP program to Excell template file

    Hello everyone
    I have  a such task: In abap program I have fields(screen fields), which I want to import into excell file. I don't want to export into empty file but into ready template .xls. Is there any possibility to match corresponding fields?
    I really need to know, I will be gratefully for any suggestions.
    Greetings

    Hi Katarzyna ,
    something like
    DATA: EXCEL TYPE OLE2_OBJECT.
    DATA: BOOKS TYPE OLE2_OBJECT.
    DATA: BOOK  TYPE OLE2_OBJECT.
    DATA: CELL  TYPE OLE2_OBJECT.
    DATA: FONT  TYPE OLE2_OBJECT.
    DATA: FILE  TYPE OLE2_OBJECT.
      CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
      CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
      CALL METHOD OF  FILE 'OPEN' EXPORTING #1 = P_FILE
                                            #2 = 1.  
      CALL METHOD OF EXCEL 'CELLS' = CELL EXPORTING #1 = P_LINE
                                                    #2 = P_COLUMN.
      SET PROPERTY OF CELL 'VALUE' = P_VALUE.
      CALL METHOD OF EXCEL 'QUIT'.
    This is just a compilation from a complex program. Do some modularization (i.e. create FORM fill_cell using P_line P_column P_value...)
    Hope I did not forget anything. Meanwhile we have much more modern and advanced methods and classes - this one is of 2000 (Release 4.5?).
    Regards,
    Clemens

  • How to trigger workflow from WDA and read workflow container into WDAscreen

    Dear Expert,
      Please suggest the solution for the following requirement:
       1. Create 1 leave request from WDA and submit for approval
       2. When User press "submit" button in WDA screen, workflow will be triggered for processing approval  .
       3. When 1 request is sent to approver, he logon into portal and access to UWL to process task himself.
       4. After he press approval link, the system will call WDA screen to process approval ( this screen will contain full information of requester.)
       5. After finishing process, the result will return workflow and end of process.
    Please send simple example for step 1 and one for get data from workflow into WDA screen at step4
    Any help would be appreciated
    Thanks and best regards,
    DucTV.

    Hi,
      I am not sure for what reasons you are developing a application but SAP has its own standard workflow process for applying leave from ESS portal..
    1. AS soon as you click on the submit button of the applicaiton then you need to trigger a workflow right in that case you make sure that you need to pass some data to the workflow container I hope you might be using either SAP_WAPI_CREATE_EVENT or SAP_WAPI_START_WORKFLOW to start the workflow  in both the function module you have to fill this table in Order to pass the values from ABAP    program to workflow container.
      The answer to your question is it depends on the type of the work item ID you are passing to the SAP_WAPI_READ_CONTAINER if you are passing a top work item ID  then you will have workflow container in LT_CONTAINER if you are passing any of the child or dependent work item ids of the top work item id then you have that respective task container value.
    2. You can make use of the any foreground activity or a decision step, it depends on how you want to get back the result, if you use a foreground activity step then in that case you have to populate the result back to the task container and if let say you are using a decision step then in that case you do not have to populate the result there will be standard  container element _RESULT in the decision step it will be filled.
    Make sure if you are expecting some work item in UWL and as soon as you click on the work item your application should open then configure in SWFVISU transaction and maintain DTD in UWL any portal consultant can perform this steps in few seconds.
    3. When the workflow is started then the work item which you are able to get back is the one which helps to identify dependent work item ids it is the TOP or PARENT work item ID.
    Regards
    Pavan

  • Passing data from check FM

    Hi,
    Wanted to know how to pass data from check FM to workflow container?
    We are not able to add parameters for event container as it is standard event.
    Can we set attribute of object ? I could not find macro for setting property.
    Expecting urgent help.
    Regards,
    Akshay

    Hi Akshay,
    Trying to pass data from check FM to workflow container is the wrong approach to use.  The purpose of a check FM is ONLY to see if the workflow should be started by the event or not.  You cannot and should not even attempt to change the event container in a check FM.
    What you need to do is to take a step back and think about your options:
    1. "Not able to add parameters ... as it is a standard event".  Well you can extend the event parameters on a standard event by creating a delegated subtype of the standard object type.  However if the event is raised by standard code this may not help you anyway.   It's worth reading the SAP Library doco on this as some types of events do pass additional information provided you define the event parameter names correctly, e.g. change document events will automatically pass the old/new value of certain fields.
    2. Is the data you are trying to pass related to:
    a) The object - then use attributes of the object instead to calculate the value
    b) The person creating the event - then use attributes of the event creator, i.e. as soon as the workflow starts, add a step to instantiate an instance of an object representing the user such as USR01 or USR01DOHR.
    c) Other standard data in the event container such as the calling program id, the date/time - any of that info can be passed to your workflow container and then used to derive further info from there.
    3. If the data you are trying to pass is only available in the standard calling application, then you need to find another way to raise the event or raise a custom event.  E.g. in a user exit or BADI.
    4. And one final option of last resort - create your own RECEIVER function module - this does allow you to fill the workflow container during the event linkage.  But I would still consider this a "last resort" option.
    Regards,
    Jocelyn
    Message was edited by: Jocelyn Dart

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • Read EDI-856 interface data in ABAP program

    HI Experts,
    I have a requirement to read the incomming EDI-856 interface data from ABAP program and generate an IDOC.  I have gone through few EDI-856 documents and theformat in which to read the data .
    Request you to let me know the code logic , function module to use or if  you have any document which can help me in the development.
    Thanks in advance
    Regards
    Santosh

    Please help regarding
    First could you please help me regarding the SCN search option?
    please always try to attempt from your side if not able to solve than search in SDN finally you may land on SDN with thread.

  • Call workflow from ABAP program

    created a zbusiness object (ZPRODH)with
    one key field product hierarchy,
    one attribute level number and
    one method display.
    I tested that zobject and using this object created workflow to display product hierarchy ,it is displaying it. now I have to call it from one abap program.
    In the abap program I am calling the funcion module, I
    CALL FUNCTION 'SWW_WI_START_SIMPLE'
    EXPORTING
    TASK = TASK
    IMPORTING
    WI_ID = WI_ID
    TABLES
    AGENTS = AGENTS
    WI_CONTAINER = WI_CONTAINER.
    It is calling the workflow and subrc is 0, but not passing the value to the workflow. Because of that the method is not working, any idea?
    Thanks in advance

    ttpa,
    Please check this thread:
    Re: Workflow from abap program
    Also check that your Fm do requires any explicit commit or not?
    Hope it will help u
    Cheers
    Jai

  • Pass the data from a form in workflow to z table

    Hi all,
    How can I pass the data from a form in workflow to z table?

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • Regarding how to pass the data from web dynpro to workflow

    hi gurus,
    how to pass the data from web dynpro to workflow.
    Regards
    vijay

    Check this [thread|SAP_WAPI_START_WORKFLOW;

Maybe you are looking for

  • G5 will not boot up

    When I start the G5 tower by pressing the button on the front, the chime sounds, the fan starts, the monitor Power LED indicator comes on, but nothing else happens. There is a red LED on a board near the bottom of the tower which is visible through t

  • Time Capsule dual wireless routers issues

    I have a TimeWarner cable modem in the closet with a net gear 8port router connected where are all my cat5 cables drop in for our home. I have a Cisco wireless router in the living room running wifi to iPads, iPhones, etc. That router has a cat5 cabl

  • Link master page to paragraph style?

    I'd like to have the first page of each chapter have a different master page (particularly no header with page numbers, etc.). I know how to apply a different page style, but I want the style to stay with the first page of each chapter -- even if mor

  • Explanation of panic reports

    Since the upgrade to Lion I've been having very many panic shutdowns and rather than wait for Apple to fix all the bugs in Lion, I've decided to see if I can minimise downtime myself. I've found a very useful document, TN2123, a technical note on und

  • QT won't open mp4

    When I try to open an mp4 file, I get the message: The movie is not in a format that QuickTime Player understands. Then I go to the page that supposedly "tells me more" and it clearly says QT will open mp4 files. Anyone know what's going on? Thanks,