How to Run Multiple BAPI's

Hi All,
i was trying to run multiple BAPI's using Jco. but no luck. it giving error message like "Employee/person not locked yet".
the BAPI's i'm trying are
1. BAPI_EMPLOYEET_ENQUEUE
2. BAPI_ABSENCE_REQUEST
3. BAPI_TRANSACTION_COMMIT
4. BAPI_EMPLOYEET_DEQUEUE
i'm using connection pooling to get connection.
the code
JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
JCoFunction function = destination.getRepository().getFunction("BAPI_EMPLOYEET_ENQUEUE");
function.getImportParameterList().setValue("NUMBER", "00000002");
function.execute(destination);
function = destination.getRepository().getFunction("BAPI_ABSENCE_REQUEST");
function.getImportParameterList().setValue("EMPLOYEENUMBER", "00000002");
function.getImportParameterList().setValue("VALIDITYBEGIN", c.getTime());
function.getImportParameterList().setValue("VALIDITYEND", c1.getTime());
function.getImportParameterList().setValue("ABSENCETYPE", "0014");
function = destination.getRepository().getFunction("BAPI_TRANSACTION_COMMIT");
function.execute(destination);
function = destination.getRepository().getFunction("BAPI_EMPLOYEET_DEQUEUE");
function.getImportParameterList().setValue("NUMBER", "00000002");
function.execute(destination);
i don't know where i'm going wrong. Plx help me out.
thanks in Advance.
Ravi.

Hi.
I found the correct form to use.
BAPI_EMPLOYEE_ENQUEUE
BAPI_PERSDATA_CHANGE
BAPI_EMPLOYEE_DEQUEUE
In a java file need use JCoContext to generate a group functions to will be execute
try {
JCoContext.begin(destination);
     if (JCoContext.isStateful(destination))
          bloqFunction.execute(destination);
          cambFunction.execute(destination);
          desbFunction.execute(destination);
} finally {
JCoContext.end(destination);
Declarated:
JCoFunction bloqFunction = destination.getRepository().getFunction(
                    "BAPI_EMPLOYEE_ENQUEUE");
JCoFunction cambFunction = destination.getRepository().getFunction(
                                        "BAPI_PERSDATA_CHANGE");
JCoFunction desbFunction = destination.getRepository().getFunction(
                                        "BAPI_EMPLOYEE_DEQUEUE");
I hope help with this.

Similar Messages

  • How to run the BAPI after creation or Modification ?

    HI Abapers,
    How to run the BAPI after creation or Modification ? What is the step by step procedure to run the the BAPI?
    Immediate reply is highely appriciable.
    Regards,
    Chow.

    Hi
    If you have done with BAPI creation correctly Run it similar to the fun mdule which we run in SE37 calling this BAPi in the program with CALL FUNCTION and passing the necessary parameters
    see the sample bapi code how it is called in Program
    data : w_resb_header like bapirkpfc.
    data: begin of itab_resb occurs 0.
    include structure bapiresbc.
    data: end of itab_resb.
    data: begin of itab_bapi_return occurs 0.
    include structure bapireturn.
    data: end of itab_bapi_return.
    data : w_resb_no like bapirkpfc-res_no.
    w_resb_header-plant = p_werks.
    w_resb_header-res_date = sy-datum.
    w_resb_header-created_by = sy-uname.
    w_resb_header-cost_ctr = '0000010001'.
    w_resb_header-move_type = '201'.
    w_resb_header-gr_rcpt = w_room_time.
    w_resb_header-part_acct = 'OR'.
    *ITEM DATA
    loop at i_details.
    itab_resb-material = i_details-matnr.
    itab_resb-plant = i_details-werks.
    itab_resb-store_loc = i_details-lgort.
    itab_resb-quantity = i_details-qty.
    itab_resb-unit = i_details-meins.
    append itab_resb.
    clear itab_resb.
    clear i_details.
    endloop.
    call function 'BAPI_RESERVATION_CREATE'
    exporting
    reservation_header = w_resb_header
    NO_COMMIT =
    MOVEMENT_AUTO =
    importing
    reservation = w_resb_no
    tables
    reservation_items = itab_resb
    return = itab_bapi_return
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    IMPORTING
    RETURN =    .
    wait up to 5 seconds.
    w_resb_no contains your reservations numnber
    Regards
    Anji

  • How to run multiple CodedUI Ordered Tests over multiple Test Agents for parallel execution using Test Controller

    we are using VS 2013, I need to run multiple Coded UI Ordered Tests in parallel on different agents.
    My requirement :
    Example:   I have 40 Coded UI Test scripts in single solution/project. i want to run in different OS environments(example 5 OS ).  I have created 5 Ordered tests with the same 40 test cases. 
    I have one Controller machine and 5 test agent machines. Now I want my tests to be distributed in a way that every agent gets 1 Ordered test to execute. 
    Machine_C = Controller (Controls Machine_1,2,3,4,5)
    Machine_1 = Test Agent 1 (Should execute Ordered Test 1 (ex: OS - WIN 7) )
    Machine_2 = Test Agent 2 (Should execute Ordered Test 2 (ex:
    OS - WIN 8) )
    Machine_3 = Test Agent 3 (Should execute Ordered Test 3
    (ex: OS - WIN 2008 server)  )
    Machine_4 = Test Agent 4 (Should execute Ordered Test 4 (ex:
    OS - WIN 2012 server) )
    Machine_5 = Test Agent 5 (Should execute Ordered Test 5 (ex:
    OS - WIN 2003 server) )
    I have changed the  “MinimumTestsPerAgent” app setting value
    as '1' in controller’s configuration file (QTController.exe.config).
    When I run the Ordered tests from the test explorer all Test agent running with each Ordered test and showing the status as running. but with in the 5 Test Agents only 2 Agents executing the test cases remaining all 3 agents not executing the test cases but
    status showing as 'running' still for long time (exp: More then 3 hr) after that all so  its not responding. 
    I need to know how I can configure my controller or how I can tell it to execute these tests in parallel on different test agents. This will help me reducing the script execution time. 
     I am not sure what steps I am missing. 
    It will be of great help if someone can guide me how this can be achieved.
    -- > One more thing Can I Run one Coded UI Ordered Test on One Specific Test Agent?
    ex: Need to run ordered Test 1 in Win 7 OS (Test Agent 1) only.
    Thanks in Advance.

    Hi Divakar,
    Thank you for posting in MSDN forum.
    As far as I know, we cannot specify coded UI ordered test run on specific test agent. And it is mainly that test controller determine which coded UI ordered test assign to which test agent.
    Generally, I know that if we want to run multiple CodedUI Ordered Tests over multiple Test Agents for parallel execution using Test Controller.
    We will need to change the MinimumTestsPerAgent property to 1 in the test controller configuration file (QTControllerConfig.exe.config) as you said.
    And then we will need to change the bucketSize number of tests/number of machines in the test settings.
    For more information about how to set this bucketSize value, please refer the following blog.
    http://blogs.msdn.com/b/aseemb/archive/2010/08/11/how-to-run-automated-tests-on-different-machines-in-parallel.aspx
    You can refer this Jack's suggestion to run your coded UI ordered test in lab Environment or load test.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/661e73da-5a08-4c9b-8e5a-fc08c5962783/run-different-codedui-tests-simultaneously-on-different-test-agents-from-a-single-test-controller?forum=vstest
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to run multiple scripts in sql*plus?

    I would like to run 2 scripts in sql*plus, how do I do this? I tried the following, but it won't run.
    create table student_new
    AS
    select *
    from student
    insert into student_new
    (last_name, first_name
    values
    (Crop, Jenny)
    The above are the two scripts I want to run, what am I doing wrong.
    Thanks

    Do you have a solution to run multiple scripts continuosly, one after the other as one script.
    Say I have file1.sql file2.sql, file3.sql.
    I want to create a script run.sql, where this will run file1.sql,file2.sql,file3.sql one after other without any one running one after the other like follows:
    run.sql should have
    begin
    @file1.sql
    @file2.sql
    @file3.sql
    dbms_output.put_line(select sysdate from dual);
    end;
    If I run run.sql all the three scripts should be executed successfully and then display the current time . All these files have update statements(50,000 updates each file).
    Very urgetn. Can some one hlpe, please.
    Thanks in advance.

  • How to run a BAPI in background mode?

    Dear friends,
    I have a requirement [In the UI user can choose two options - run online or run backgroud] to run a BAPI (BAPI_SALESORDER_CHANGE) in background mode (background job)  , does anybody know how to implement it?
    Thanks a lot!!

    Hi
    You can define 2 radio button one foreground and otherfor background then
    for background use FM BP_JOB_CREATE or BKK_UPT_DISP_JOBS_START  or DB2_SCHEDULE_JOB_IMMED
    Regards
    Shiva

  • How to run multiple reports From One Form with 1 report object?

    Hi ALL!
    i want to run multiple reports (in 10g technology) from 1 Form having only 1 report object.
    i.e
    IF parameter=yes THEN
    Rpt_new should run
    Else
    Rpt_old should run
    END IF;
    How can i do this?
    thanks
    rana

    Rana,
    I found this in the Forms online Help. You could easily found it yourself. Don't be afraid of pressing CTRL-H:
    SET_REPORT_OBJECT_PROPERTY(repid, REPORT_FILENAME, 'yourreportsfilename.rdf')Regards,
    Martin Malmstrom

  • How to run multiple sqls in one jasper report

    Hello!
    Is there any one that can help me in integrating/ viewing my xml file to the web. I have my GUI in jsp format, the jsp makes a call to the bean class and then finally bean class hit my reports java class.The report java class generates the report and shows it in the new window.
    The problem is with writing mutiple sql queries and showing the result from multiple sql queires in one report.
    I do not know how to write multiple queries for just 1 report. I can give a simple example of my problem also.
    My report is as follows:
    First Name Middle Name Last name
    Sandeep               Pathak
    Now First and Middle Name come from 1st sql query and Last Name comes from 2nd sql query.
    I want to join the result obtained from both the sql queries in one Jasper Report (not as 2 separate sections but as one section).
    My problem is how to view my report in the web. furthermore, how to make complex query in jasperassistant, like multiple table in one query, because i�m integrating multiple query in one form or sheets of paper.
    Please help me in this.
    Thanks
    Sandeep
    Calance
    India

    Hi Sheldon,
    we never have issues when we combine standard objects, like a cliear with a load inforprovider, or the master data integration you mentioned in your document. However, from the moment we combine a script logic with a standard package (like a move) it does not work .The data package contains the task needed for the script and for the move. the process chain is called up but always comes in error in the first step (BPC modify dynamically ) ... there is also no log when checking the view status ...
    I can sent you some screenshots if you like ...
    D

  • Can you suggest me how to run multiple calc scripts using singel maxl script

    Hello,
    I am writing a maxl script which should be able to :
    1. update Set Variables for the Essbase DB
    2. Execute multiple calc scripts
    2a. Trying to put specific sleep time within multiple calc scripts.
    Thanks and Regards.

    Why are you looking for a Maxl to run multiple maxls? Can't you use a batch or sh script to do it.
    Unix has a sleep command in batch file try using choice
    Regards
    Celvin

  • How to run multiple java files concurrently using command line?

    Hi,
    I have to write a script to run multiple java files and c files concurrently. Say, A and C are java files and B is another binary executable file, I have to make sure they are run in the order A-B-C, then I was trying to run by using
    java A & ./B & java C
    But it turned out that B could run before A started... Is there any way that I can ensure that A runs before B, and B runs before C by using the command line?
    Thanks a lot.

    GKY wrote:
    Sorry, I didn't make my question clear enough...
    A has to give some output files that B needs to get started,Then B can start at any time--even before A--and just wait for those files to be written. For instance, A could write to a temp file, then rename it to the real name. However, if there are multiple files, and they all have to exist, even this won't necessarily work. There are other approaches that will though.
    although writing the output takes very short time,Depends on when the OS decides to give A CPU time, what else is going on on that disk controller and/or network, etc.
    B could still run before A finishes the writing, As it can if you sleep for 1, or 10, or 1,000,000 seconds before starting B.
    if B can't find the info it wants, it fails to move on. That's why I need to make sure A starts before B.No, you need to make sure A's data is there before B tries to use that data.
    Edited by: jverd on Jul 29, 2008 1:06 PM

  • How to run multiple Test Script versions at once

    HI
    How to Run different versions of Test Scripts ( TCD record & SAP GUI) continiously.
    Thankyou

    >
    d s wrote:
    > HI
    > How to Run different versions of Test Scripts ( TCD record & SAP GUI) continiously.
    >
    > Thankyou
    Hi DS,
    If I understand your question correctly,you want to execute different version of TCD and SAPGUI continously,then please find the steps below:
    1)Create a new script.
    2)Call the individual scripts created in TCD and SAPGUI in the new script using REF command in the pattern you want to execute.
    3)eCATT will automatically choose the relevant version automatically suitable for the system.
    4)Maintain the input and output paramters in the main script.
    5)Paramterize the input and output values.
    6)Once the script is without errors,you can execute the scripts and they run continously.
    Hope this answers your query.
    Regards,
    SSN.

  • How to run multiple DOS commands from a single Webutil Client_Host session?

    Hello all,
    I have a requirement where I need to create an interface with SVN from Forms for basic checkin-checkout of files.
    So, I've been trying to use webutil client_host to open a command line session and issue svn commands.
    For svn, sometimes I need to give multiple commands like change to a particular directory and then run an svn command.
    But client_host takes in only one command at a time and I'm unable to issue a series of DOS commands to perform
    a particular task.
    Is there a way to do this?
    Pls suggest.
    Regards,
    Sam

    First your original question... You can put more than one DOS command on a single line, simply separate each command with an ampersand (&). For example:
    mkdir c:\abc & cd abc & dir*
    Regarding your concerns about performance, well that would depend on exactly what you mean. Using CLIENT_HOST (or HOST on the server) simply opens a shell (DOS in this case) then passes your command to it. The performance of performing this action really isn't measurable. Basically you are just pressing a button and you should get a near immediate action. As for the performance of executing each command, that has nothing to do with Forms. Once the command is passed to the shell, the rest is a function of the shell and whatever command you passed.
    Having said that, if you were to write something sloppy like a loop (in pl/sql) which called CLIENT_HOST lots of times repeatedly, then yes there would be a performance problem because the pushing of the button will cause an exchange to and from the server and each cycle in the loop will do the same.
    So the answer to how performance is impacted will depend on what exactly you need to accomplish. If it is a single call to CLIENT_HOST, this should be fine.

  • How to run multiple queries in a report 6i

    hi!
    i have multiple queries that i have created in data model
    how can i invoke them in my report?
    thanks!

    Every query is run automatically. You can have a Q1 and Q2 and display results of Q1 on one page, and the results of Q2 on another.

  • How to run multiple Instances of wls5.1 under one instance

    Hello forum,I want to make 3 instance of weblogic that runs under one instance,but
    i don't know how.
    for example I will like to have the following.
    Weblogic is my main instance,so i will like to have more instances called web,db,batch
    witch run on their own under.
    Weblogic/web,db,batch,
    I have made the 4 instance first weblogic has empty weblogic.properties file,
    and the otheres 3 have their full weblogic.properties,my problem is how can I
    refer eatch instance individually, that means the
    subinstances like web,db,batch in my startweb.cmd,startdb.cmd,startbatch.cmd
    I don't know how to start eatch instance alone.
    HELP

    To run more than 1 instance of Logic at the same time, you really need 2 copies as while the license allows you to install on 2 machines (1 laptop 1 desktop ideally), they can not run at the same time.
    So, where now? Well there is a legitimate way around this, assuming you have a fast enough network between the 2 computers and that is to have 1 machine running as a Logic Node to share the work out. When I'm not 'Out and about' I could use the MacBook Pro as a node for my home setup (For example) running some of the soft synths for example.

  • Urgent: How to run Multiple Applets from a URL

    Hi,
    I am developing an applet that needs memory more than 64MB and I have used -Xmx to set it to 128 MB.
    On my web page, I have 3 applications that use the same JAR file of the applet, but the problem is all applets are opened/loaded in same heap space by JVM. So, when I load first applet, it uses 80 MB and when I start 2nd applet, after using 40 MB, it throws OutOfMemory exception.
    Is there a way to start each applet with fresh 128 MB heap space rather than all applets sharing 128 MB heap space?
    Thanks,
    Ajit

    That's some hefty requirements for an applet. I believe that the only way to do the Xmx thing on the client side is to have them manually add it in the JVM arguments section of the Java Plugin Control Panel.
    The browser/plugin is going to use the same JVM to run all 3 applets in a page. I've never seen a way to tell it to do otherwise. The only separation is the applet contexts, but that is more of a security manager grouping thing.
    Maybe you should look into how you can better manage your data so you don't need so much memory.

  • How to run multiple subprocesses in paralel and in chunks?

    I have a requirement for user to be able to request the proposal for 10 different products from 10 different suppliers. The number of products (vendors) is known at the run time.
    The additonal problem I have is that users need to be able to send requests in chunks (5 products to 5 vendors for example now, and other 5 next week). Once all the proposals are in user can load them and proceed with the order of all 10 items, or request to re-do the process for 3 products with different suppliers choose.
    I was thinking of using splitN calling a subprocess for this but then i realized that process will be blocked in the join activity until all of them are done, so I won't be able to send the other 5.
    Then I was thinking of using "fire and forget" approach for the process but then how I receive/compile all the offers?
    Any guidance with and/or example would be highly appreciated.
    Thanks!

    Dan,
    Thanks for your answer but I failed to explain my problem properly.
    I have 20 different products that I need to send to a 20 different vendors (one each) in phases. It is not a competitive situation, each vendor is providing a price on the specific part. Then parts quotes once they are all in get assembled in a total quote for all 20 parts-products.
    The challenge is that requests for quotes need to be sent in chunks not all at once.
    First, I am sending for quotes to 5 different vendors on 5 different products (vendor 1-product 1,...,vendor 5-product 5) for the information I already have. After I find out all the info required I might want to send request for another 3 or 5, and so on until I send them all in for quotes. So I need some kind of loop to go back re-send additional group (vendor 6-product 6,...., nendor 10-product 10), etc. until I reach all 20 different vendors on 20 different products. Vendor assesment on product 1 to 5 might still be going while I am submiting the other chunks of five. What approach should I use here, still the same or fire and forget and track everything in external db somehow. I would prefer to use the tool.
    N.

Maybe you are looking for

  • Is it possible to process watch folders on a MAC (OS X) without being logged in?

    We are running Adobe Media Encoder 5.5 on our MAC OS X system with a number of watch folders on our network. This works as expected while a user is logged onto the system but not when logged out. Is there any way to set this up so that AME will still

  • Imovie will not load correctly

    Hi imovie 11 was playing well until a few days ago. Now, when it loads, only the tabs load. The screen remains as my desktop. I can go to a tab, such as edit, and create a new movie clip, and then I will see imovie appear out of the top right corner

  • PO Tax Code retermination

    Hello First when the PO is created, the tax code determined and assigned at the Line item. Now, when the condition table is updated and the condition type NAVS finds new condition record, it automatically updates in the pricing schema. However the Th

  • Problem in getting Jobid

    I am calling a report from a form in oracle AS 10g. But when I am trying to get the jobid before passing it to web.show_document() it is hanging... Can anyone help

  • MS Outlook 2010

    I am about to upgrade my laptop and will be using MS 7 Professional 64 bit + MS Office Professional. I have been told that I will need to change from 'Click to Run' to MSI based Office in order for my Blackberry 9800 to sync correctly. Is this correc