Error while launching the workflow from OAF controller class.

Hi Everyone,
I'm using the below code from the submit button event to launch the workflow. The workflow works fine when I submit for the first time, when i try to submit for the second time from the same session it throws me the error as
"Workflow with item type (XXCEDASP) and item key (SUNDRY-1061) is in progress. Abort existing workflow before launching a new process for this transaction."
The item key which it is showing in the error is the item key for the previous transaction. Also I tried the code that is commented below (code between /* */). If I use the commented code, it doesn't throw me error but cancels all the transactions(that are initiated from the same session) except the last one.
Is there any work around for this from oaf? Please help.
Code:
public void launchCustomWorkFlow(OAPageContext pageContext,
String transaction_id, String requestor) {
String wfItemType = "XXCEDASP";
String wfProcess = "XXCED_MAIN_PROCESS";
OANavigation wfClass = new OANavigation();
String wfItemKey = transaction_id;
/*if (OANavigation.isWorkflowInProgress(pageContext))
String oldKey = OANavigation.getItemKey(pageContext);
if (!OANavigation.abortProcess(pageContext, wfItemType,wfProcess, oldKey,
null, null))
throw new OAException("Error", OAException.ERROR);
System.out.println("transaction ID = " + transaction_id);
//Create Workflow Process
wfClass.createProcess(pageContext, wfItemType, wfProcess, wfItemKey);
wfClass.setItemAttrText(pageContext, wfItemType, wfItemKey,
"TRANSACTION_ID",transaction_id);
wfClass.setItemAttrText(pageContext, wfItemType, wfItemKey,
"REQUESTOR_NAME",requestor);
// Start Workflow Process
wfClass.startProcess(pageContext, wfItemType, wfProcess, wfItemKey);
Thanks
Sunny

Hi Haroon,
Thanks for your reply. I tried doing it using the database procedure too. I'm having different problem if I do so. The problem is that when I submit the first transaction, the workflow is not kicked off. when i submit the second transaction, the first one gets kicked off, when I submit the 3rd one second one gets kicked off. So the last one never gets kicked off. This is the pattern I have observed.
here is my code
OAF Code:
OracleCallableStatement cs = null;
try {
cs = (OracleCallableStatement)getOADBTransaction().createCallableStatement("{call XXCED_APWFL006_SUNDRYAPPR_PKG.INITIATE_WORKFLOW(:1,:2)}", -1);
cs.setString(1,transaction_id);
cs.setString(2,requestor);
cs.execute();
System.out.println("callable statement executed for transaction "+transaction_id);
cs.close();
catch(SQLException e) {
throw new OAException("Error Raised:"+e,OAException.ERROR);
Procedure Code:
PROCEDURE Initiate_Workflow(transaction_id in varchar2,
requestor in varchar2)
is
l_item_type varchar2(20):= 'XXCEDASP';
l_start_process varchar2(30):='XXCED_MAIN_PROCESS';
l_item_key varchar2(30):= transaction_id;
begin
wf_engine.createprocess(l_item_type,l_item_key,l_start_process);
wf_engine.setitemattrtext(l_item_type,l_item_key,'TRANSACTION_ID',transaction_id);
wf_engine.setitemattrtext(l_item_type,l_item_key,'REQUESTOR_NAME',requestor);
wf_engine.startprocess(l_item_type,l_item_
Can you please let me know what am I doing wrong?
Also please send the code that has worked for you.
Thanks
Sunny

Similar Messages

  • Getting the error while calling the report from oaf page

    Dear all
    when i am calling the report from oaf page
    if (pageContext.getParameter("PrintPDF") != null)
    DataObject sessionDictionary =
    (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response =
    (HttpServletResponse)sessionDictionary.selectValue("HttpServletResponse");
    try
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition", contentDisposition);
    response.setContentType("application/pdf");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode)am.invokeMethod("getEmpDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream =
    new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    //Generate the PDF Report.
    TemplateHelper.processTemplate(((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    "XXCRM", "XXCRM_EMP",
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF, null,
    pdfFile);
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    } catch (Exception e)
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(false);
    i am getting the error java.classcastexception at this line
    DataObject sessionDictionary =
    (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    regards
    Sreekanth

    check if you have import oracle.cabo.ui.data.DataObject; in your import statement.
    --Prasanna                                                                                                                                                                                               

  • There was an error while retrieving the universes from the CMS (Central Management Server). (PS 20003)

    Hi there,
    When I'm trying to manage spaces in SAP Business Objects Explorer 4.1 SP04, I'm getting the following error:
    Failed to retrieve the data source list.
    There was an error while retrieving the universes from the CMS (Central Management Server). (PS 20003)
    For input string: "false"
    I've already restart Explorer servers (Explorer Exploration Server, Explorer Indexing Server, Explorer Master Server and Explorer Search Server) and rebooted the server where Explorer is installed.
    Nothing seems to fix this error message. I'm not able to create new spaces because I cant access the sources:
    I'd appreciate some help !
    Thanks in advance

    HI Pavan,
    Admin is on the Administrators Group, which as Full Control on the Explorer Application
    I think this worked on the day the Explorer was installed (past week).
    Since them never worked.

  • No data Exists error while retrieving the data from a table

    Hi Everyone!
    I am getting "No Data Exists" error while retrieving the data from a table....where i need to check...if possible please give me example link.....please help me regarding this

    Hi !
    thanks for ur response...
    I have written vo.executeQuery for the table...My page is running but i m not getting the data....I have to select two LOV's and when I click on Go button the data has to display in the table...After the selection of LOV's when I click on Go in the table "No data exists" message is appearing...the table has the data and the query is also executing...please give info where i did the mistake....

  • Error while deriving the currency from table

    i am getting the below error while simulating the payroll for india.
    Error while deriving the currency from table T001P & Error during Initialization of payroll.
    i am SAP HCM Trainee.. practicing at home.

    Pls check the currency in table T500C.
    You can use TCode OE00 for table maintenance T500C.
    Also check whether currency is there in table V_CURC and T510.
    Hope this will help.
    Regards
    Ghouse

  • Error while deriving the currency from table T001P.

    Hi Friends,
    I am trying to run payroll for NZ using schema NZ00 but i am getting an error stating "Error while deriving the currency from table T001P. Error during initialization of Payroll"
    I have checked V_T001P, V_T001 and have deleted the personnel area and subarea and again created it but still i am unable to solve this problem.
    Could you please help me as to where this error can be corrected.
    Thanks,
    Manj

    About the incidence, the problem might be related to the links between
    personnel area, company code and currency set up (table T001P, T500P and
    T001).
    Please check the following points:
    1- Have you assigned the Personnel area to the Company code under SPRO -
    IMG -> Enterprise Structure -> Assignment -> Human Resource Management
    -> Assignment of Personnel Area to Company Code.
    2- SPRO -> Personnel Management -> Personnel Admin -> Basic Settings ->
    Determine Currencies (Public Sector Currency Need to be maintained along
    with the other node).
    3- SPRO- Personnel Management -> Personnel Admin -> Payroll Data ->
    Basic Pay -> Define Hourly Rates for several decimal places. (Please
    maintain all the nodes).
    4- Maintaining the table t500c through transaction code OE00.
    Regards
    Ramana

  • Error, while pushing the data from Oracle to MSSQL.

    Hi,
    I am facing the below error, while pushing the data from Oracle to MSSQL.
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Transparent gateway for MSSQL][Microsoft][ODBC SQL Server Driver][SQL Server]Update or insert of view or function 'View_Name' failed because it contains a derived or constant field.[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (SQL State: 00000; SQL Code: 8180)
    Please suggest me, how to overcome from this.
    Thanks.

    [email protected] wrote:
    Hi,
    I am facing the below error, while pushing the data from Oracle to MSSQL.
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Transparent gateway for MSSQL][Microsoft][ODBC SQL Server Driver][SQL Server]Update or insert of view or function 'View_Name' failed because it contains a derived or constant field.[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared. (SQL State: 00000; SQL Code: 8180)
    Please suggest me, how to overcome from this.
    Thanks.This is an error from SQL Server being passed back to Oracle so you can see the problem.
    What it is saying is that you are trying to insert (or update) data to a database view and that view contains a column that is either a constant (literal) value or is derived (a calculation, formula or string concatenation etc.).
    As such, you can't insert or update data on that column because it has nowhere to go on the database table(s) that underly the view.

  • Internal Server Error while running the page from server

    Hi gurus,
    We are getting below error while running the oaf page from our instance. we have executed the query behind the page and it took around 40 seconds to execute. but oaf page is getting errored out with below error message after taking long time.
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Please help me..
    Thanks
    Raghava

    Is it 9i Jdeveloper or 10G. Also check the Jdeveloper is being run on a compatible database. A Jdeveloper for 11i should run on an instance having 11i installed and same for R12. Also check the version of OA Frameworrk in the Jdeveloper you are using and the version deployed in instance.
    Regards
    Sumti

  • RC 8 error while transporting the query from Dev to Qa - Element missing

    Hi All,
    I have made a multiprovider by copying one existing one.
    I have copies one of the Bex queries using RSZC from the source to Target MP.
    While transporting the query from Dev to QA i have got the following error. (I have already moved the Multi Prov in a previous TR) 
    Has anyone seen similar types before. Any inputs will be highly appreciated.
    Start of the after-import method RS_ELEM_AFTER_IMPORT for object type(s) ELEM (Activation Mode)     
    Error when activating element 4LUSZK561QN74UDBJ7BPU9GFM                                             
    Element 4LUSZJXHIS1HM7TVDD9DK7HPU is missing in version M                                           
    End of after import methode RS_ELEM_AFTER_IMPORT (Activation Mode) - runtime: 00:00:06                                                                               
    Start of the after-import method RS_ELEM_AFTER_IMPORT for object type(s) ELEM (Delete Mode)         
    End of after import methode RS_ELEM_AFTER_IMPORT (Delete Mode) - runtime: 00:00:14                  
    Errors occurred during post-handling RS_AFTER_IMPORT for ELEM L                                     
    RS_AFTER_IMPORT belongs to package RS                                                               
    The errors affect the following components:                                                         
       BW-WHM (Warehouse Management)                                                                    
    Post-import method RS_AFTER_IMPORT completed for ELEM L, date and time: 20110517070045              
    Post-import methods of change/transport request BDAK959603 completed                                
         Start of subsequent processing ... 20110517070025                                              
         End of subsequent processing... 20110517070045                                            
    Kind regards,

    Hi Jith,
    First of all try to consolidate all your objects in a single TR and then move to Q from D.
    In this case check for the list of objects that you have in your TRs. If TR 3 have all the Objects that were in TR1, TR2, then transporting TR3 alone will work.
    Also, you can find the information related to the elements that were missed in your TR1,TR2 by following process.
    1. Go to your transport Logs and then to the entries marked as Error.
    2. There you will find the Query Element Ids, copy them
    3. Now, go to Table(Se16) RSZELTDIR, there enter those query elements.
    Now, you can able to find the elements that you have missed in your TRs. Hope this helps you.

  • Error while loading the data from PSA to Data Target

    Hi to all,
         I'm spacing some error while loading the data to data target.
    Error :  Record 1 :Value 'Kuldeep Puri Milan Joshi ' (hex. '004B0075006C0064006500650070002000500075007200690
    Details:
    Requests (messages): Everything OK
    Extraction (messages): Everything OK
    Transfer (IDocs and TRFC): Errors occurred
          Request IDoc : Application document posted
          Info IDoc 2 : Application document posted
          Info IDoc 1 : Application document posted
          Info IDoc 4 : Application document posted
          Info IDoc 3 : Application document posted
          Data Package 1 : arrived in BW ; Processing : Data records for package 1 selected in PSA - 1 er
    Processing (data packet): Errors occurred
          Update PSA ( 2462  Records posted ) : No errors
          Transfer Rules ( 2462  -> 2462  Records ) : No errors
          Update rules ( 2462  -> 2462  Records ) : No errors
          Update ( 0 new / 0 changed ) : Errors occurred
          Processing end : Errors occurred
    I'm totally new to this issue. please help to solve this error.
    Regards,
    Saran

    Hi,
    I think you are facing an invalid character issue.
    This issue can be resolved by correcting the error records in PSA and updating it into the target. For that the first step should be to identify if all the records are there in PSA. You can find out this from checking the Details tab in RSMO, Job log , PSA > sorting records based on status,etc. Once its confirmed force the request to red and delete the particular request from the target cube. Then go to PSA and edit the incorrect records (correcting or blanking out the invalid entries for particular field InfoObject for the incorrect record) and save it. Once all the incorrect records are edited go to RSA1>PSA find the particular request and update to target manually (right click on PSA request > Start update immediately).
    I will add the step by step procedure to edit PSA data and update into target (request based).
    In your case the error message says Error : Record 1 :Value 'Kuldeep Puri Milan Joshi '. You just need to conver this to Capital letter in PSA and reload.
    Edit the field to KULDEEP PURI MILAN JOSHI in PSA and push it to target.
    Identifying incorrect records.
    System wont show all the incorrect records at the first time itself. You need to search the PSA table manually to find all the incorrect records.
    1. First see RSMO > Details > Expand upate rules / processing tabs and you will find some of the error records.
    2. Then you can go to PSA and filter using the status of records. Filter all the red requests. This may also wont show the entire incorrect records.
    3. Then you can go to PSA and filter using the incorrect records based on the particular field.
    4. If this also doesnt work out go to PSA and sort (not filter) the records based on the particular field with incorrect values and it will show all the records. Note down the record numbers and then edit them one by one.
    If you want to confirm find the PSA table and search manually."
    Also Run the report RS_ERRORLOG_EXAMPLE,By this report you can display all incorrected records of the data & you can also find whether the error occured in PSA or in TRANSFER RULES.
    Steps to resolve this
    1. Force the request to red in RSMO > Status tab.
    2. Delete the request from target.
    3. Come to RSMO > top right you can see PSA maintenace button > click and go to PSA .
    4.Edit the record
    5. Save PSA data.
    6. Got to RSA15 > Search by request name > Right click > update the request from PSA to target.
    Refer how to Modify PSA Data
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40890eda-1b99-2a10-2d8b-a18b9108fc38
    This should solve your problem for now.
    As a long term you can apply some user exit in source system side or change your update rules to ensure that this field is getting blanked out before getting loaded in cube or add that particular char to permitted character list in BW.
    RSKC --> type ALL_CAPITAL --> F8 (Execute)
    OR
    Go to SE38 and execute the program RSKC_ALLOWED_CHAR_MAINTAIN and give ALL_CAPITAL or the char you want to add.
    Check the table RSALLOWEDCHAR. It should contain ALL_CAPITAL or the char you have entered.
    Refer
    /people/sap.user72/blog/2006/07/23/invalid-characters-in-sap-bw-3x-myths-and-reality-part-2
    /people/sap.user72/blog/2006/07/08/invalid-characters-in-sap-bw-3x-myths-and-reality-part-1
    /people/aaron.wang3/blog/2007/09/03/steps-of-including-one-special-characters-into-permitted-ones-in-bi
    http://help.sap.com/saphelp_nw04/helpdata/en/64/e90da7a60f11d2a97100a0c9449261/frameset.htm
    For adding Other characters
    OSS note #173241 – “Allowed characters in the BW System”
    Thanks,
    JituK
    Edited by: Jitu Krishna on Mar 22, 2008 1:52 PM

  • Error while loading the data from text file

    Hi,
    I got an error " Data Value Encountered before all Dimensions selected" while loading the data from the text file.
    Can any one please suggest me the solution.

    Possible Solutions
    Make sure that the data source is valid.
    Is a member from each dimension specified correctly in the data source or rules file?
    Is the numeric data field at the end of the record? If not, move the numeric data field in the data source or move the numeric data field in the rules file.
    Are all members that might contain numbers (such as "100") enclosed in quotation marks in the data source?
    If you are using a header, is the header set up correctly? Remember that you can add missing dimension names to the header.
    Does the data source contain extra spaces or tabs?
    Has the updated outline been saved?

  • Error While Testing the Data from RWB

    Hi Gurus,
    While testing the data from my RWB --> Component Monitoring -->IE -->Test Message
    I am getting the error as explained below:
    Error while sending Message -->RWB
    No header Mapping Defined -->Trace
    Moreover when i was assigning Inbound Interface in the Interface Determination its shows in the popup window NOObjects Found instead of showing the Inbound interfaces.
    Any help on this please
    Regards
    Sreeni

    Hi ,
    without completing your  configuration how are you testing your interface??
    1)you need to add your source and receiver interfaces in business service,select your business service then add your outbound interface in sender tab and add your inbound interface in receiver tab,if it is business system not required.
    2) then check your interface/operation mapping done perfectly between source and target interfaces.
    if you have above steps done perfectly then your interface will work.
    if you still getting error search in sdn with error message you will find  usefull tips..or post in sdn.
    Regards,
    Raj

  • Error while Releasing the Stock from Quality-CRTD CHCR SPRQ

    Hai Experts
                          While releasing the stock from Quality i got  error like function cannot be caried out,
    The Material Status CRTD CHCR SPRQ.
    Thanks
    Rajakarthik

    Rajakarthik
    It looks like the status you mentioned are of inspection lot.
    CRTD mean created status of inspection lot.
    CHCR means characterstics required. in your case the the material master inspection view says characterstics required however your inspection plan does not have any cahracterstics.
    assign the characterstics to inspection plan & both the status of inspection lot will change. you will be then able to process the inspection lot to move the stock from quality to unrestricted.
    Regards
    Mahesh

  • Error while retracting the data from BW system

    Dear all,
    while retracting the data from BW we are getting the below dump
    "Inconsistent entry in table TKA07 (Plan Version Maintenance)",Request you to please help to solve the issue
    Thanks,
    Jyoti

    Jyoti,
    Could you please explain in detail, were you using any standard retractor or custom?
    is it erroring out in ECC system or BI?

  • Error while reversing the GR from m.type 103 to 105

    Hi There,
    My scenario is once PO is created, then created the inbound delivery in VL31N against PO,after that post the GR with movement type 103 once inspection is complete then while reversing with m.type 105.
    system is giving error message that INBOUND DELIVERY STORAGE LOCATION CAN NOT BE CHANGED TO HERE
    When post the GR against the PO with m.type 103 system is allowing to post,but while reversing the document from m.type 103 to 105 system is giving above said error message,then entered the storage location in GR even though system is not allowing to reverse the document.
    If we enter the storage location in PO and Inbound delivery with out any problem system is allowing to post the GR with m.type 103 and reversing also allowing with m.type 103 to 105.
    So here I want to post the GR with m.type 103 and reverse with m.type 105 with out storage location in PO and inbound delivery. so for this issue is there any solution.
    EARLY ACTION IN THIS ISSUE WILL BE HIGHLY APPRECIATED
    Edited by: sapmm99 on Jul 13, 2010 6:48 PM

    >
    sapmm99 wrote:
    > Hi There,
    >
    > My scenario is once PO is created, then created the inbound delivery in VL31N against PO,after that post the GR with movement type 103 once inspection is complete then while reversing with m.type 105.
    > system is giving error message that INBOUND DELIVERY STORAGE LOCATION CAN NOT BE CHANGED TO HERE
    >
    > When post the GR against the PO with m.type 103 system is allowing to post,but while reversing the document from m.type 103 to 105 system is giving above said error message,then entered the storage location in GR even though system is not allowing to reverse the document.
    >
    > If we enter the storage location in PO and Inbound delivery with out any problem system is allowing to post the GR with m.type 103 and reversing also allowing with m.type 103 to 105.
    >
    > So here I want to post the GR with m.type 103 and reverse with m.type 105 with out storage location in PO and inbound delivery. so for this issue is there any solution.
    >
    > EARLY ACTION IN THIS ISSUE WILL BE HIGHLY APPRECIATED
    >
    > Edited by: sapmm99 on Jul 13, 2010 6:48 PM
    You should use the inbound delivery to post the GR doc not the PO.
    MIGO>Goods receipt>inbound delivery
    try that

Maybe you are looking for