How to call business objects in BO part from a servlet in lean-webapp

Hi Gurus,
for oci-implementation (and as it has been suggested here: http://scn.sap.com/thread/3340669) we want to implement a servlet that calls certain actions in a business object. The servlet resides inside the leanwebapp-DC. The business object is in the bo-part of our own custom module. Our problem is to find a way for the servlet to call the business logic. Our first thought was to go via the moduleAccess. However, we could not figure out how to access the module of the leanwebapp.
Any suggestions?
Best regards,
Christian

Hey Wolfgang,
thank you very much for your quick and accurate answer.
After struggling a little bit with our project setup we implemented your solution and it worked immediately.
However, we now have the problem to declare the module dependency between the leanwebapp and the bo-part of our module. The Development-and-Extension-Guide for WCEM 3.0 tells us (page 39) to do this in the metadata.xml of the calling module (which would be the leanwebapp). Unfortunately, the leanwebapp does not have a metadata.xml.
Declaring the dependency in the .dcdef of the leanwebapp-DC leads to either:
a runtime exception while calling ModuleAccess moduleAccess = wecSession.getModuleAccess("oci"); in the servlet (com.sap.wec.tc.core.modulemgmt.metadata.exceptions.ModuleRuntimeException: Module access of module 'oci' cannot be created. It is not part of the current application.) or
a runtime time exception while accessing the servlet:
Caused by: com.sap.wec.tc.core.common.init.InitializeException: Error initializing 'com.sap.wec.tc.core.modulemgmt.metadata.ModuleMetaDataDeploymentModel' com.sap.wec.tc.core.modulemgmt.metadata.exceptions.ModuleRuntimeException: The deployment unit contains multiple JAR files or folders which declare the same part/namespace combination. Module: 'oci', part: 'bo', namespace: 'xxx', JAR/Folder 1: 'D:\usr\sap\DE2\J02\j2ee\cluster\apps\xxx.com\xxx~oci~dpu\app_libraries_container\xxx.com~xxx~oci~bo~assembly.jar', JAR/Folder 2: 'D:\usr\sap\DE2\J02\j2ee\cluster\apps\xxx.com\demo-leanapp\servlet_jsp\demo\root\WEB-INF\lib\xxx.com~xxx~oci~bo~assembly.jar'
Do you have any hints on how to declare the dependeny properly?
Best regards,
Christian

Similar Messages

  • How to Call Business Objects in Program

    Hi All,
    if i want to create PurchaseOrders how can i use Business Object in my program.i know how to create PO through Bapi's.how can i use this Business Objects and how to pass Vlaues into them?
    any Sample code>
    What are the diffrence between both PO upload bapi and business Object for PO.??
    Thank you,
    Madhu Rao.
    Edited by: madhubabu rao on Oct 29, 2008 10:41 AM

    Hi Madhu,
    Business Objects can be triggered via Work flow tasks. When ever you create a Purchase Order, check whether any standard event is getting triggered.
    Now create a work flow task with the above task as starting event, and link your BOR object to this.
    Or try to use the Function module SAP_WAPI_CREATE_EVENT.
    Regards,
    Subhani.

  • Calling business object in report ?

    Hi,
    i want to call bussiness object method in my report as that method will give me the data which i need to display in my report. But i dont know how to call business object it's method in ABAP report  and how to pass parameters to it.
    Plz help me out as  this is very urgent.......
    Thanks,
    rahul

    Hi Rahul,
    You have posted your query in a wrong forum, but still this is the solution:
    You can use macro SWC_CALL_METHOD from include <CNTN01> or directly a FM called SWO_INVOKE.

  • How to directly call business object class from backing bean class

    I woul like to call business object class directly from the backing bean class and implement methods in BO. If possible can anyone give an example code.
    Thanks in advance

    Which problems are you occurring then? I really don't see problems. You're just free to access and invoke them.

  • How to use  Business Object like Vendor or PurchasingInfo

    Hi,
    How to use Business Object ( like Vendor or PurchasingInfo ) from my Object?
    For example:
    CLASS myEntity DEFINITION.
              PUBLIC SECTION.
                   METHODS: getVendor EXPORTING pVendor TYPE Vendor.
               PRIVATE SECTION.
               DATA: aVendor TYPE REF TO Vendor.
    ENDCLASS.
    CLASS myEntity IMPLEMENTATION.
    METHOD getVendor
               pVendor = aVendor .
    ENDMETHOD.
    ENDCLASS

    Hi,
    I am giving u a demo Program for ur doubt.
    REPORT demo_class_counter .
    CLASS counter DEFINITION.
      PUBLIC SECTION.
        METHODS: set IMPORTING value(set_value) TYPE i,
                 increment,
                 get EXPORTING value(get_value) TYPE i.
      PRIVATE SECTION.
        DATA count TYPE i.
    ENDCLASS.
    CLASS counter IMPLEMENTATION.
      METHOD set.
        count = set_value.
      ENDMETHOD.
      METHOD increment.
        ADD 1 TO count.
      ENDMETHOD.
      METHOD get.
        get_value = count.
      ENDMETHOD.
    ENDCLASS.
    DATA number TYPE i VALUE 5.
    DATA cnt TYPE REF TO counter.
    START-OF-SELECTION.
      CREATE OBJECT cnt.
      CALL METHOD cnt->set EXPORTING set_value = number.
      DO 3 TIMES.
        CALL METHOD cnt->increment.
      ENDDO.
      CALL METHOD cnt->get IMPORTING get_value = number.
      WRITE number.
    For more demo programs type 'abapdocu' in the command field
    U will be getting some demo programs.
    There select the abap objects.
    Regards,
    Jagadish

  • Calling Business Objects Reports

    Hi,
    I want to call Report made in Business Objects by clicking a button in form.
    I can see the Business Objects Library files in forms (OLE Packages) but i don't
    know how to call Reports objects on click of button.
    RDgs,
    savita

    can't you just host to the BO command line?

  • How to call business service from xquery transformation in OSB ??

    Hi All,
    How to call business service from xquery transformation in OSB ??
    I need to assign the response variable of Business Service to a target element in XQuery Transformation Mapper file.
    It's urgent.
    Regards,
    Jyoti Nayak

    Transformation is to mapping the source and target of 2 different schemas.
    In your case you should have a XQuery transformation between, your Business Service output schema and the target schema.
    Thanks,
    Vijay

  • How to access Business Objects Explorer?

    I am new to Business Objects and would like to know how to access Business Objects Explorer from my local system. I have Business Objects XI 3.1 installed on my system.
    I would like to know if BO explorer requires a separate installation package? If yes, how can I acquire it?
    If No, what are the steps to integrate the BO Server with the BO explorer?
    Edited by: Bhavani I on Jan 28, 2010 11:23 AM

    Hi,
      You can refer to the below link for more details on BO EXplorer,
    https://cw.sdn.sap.com/cw/servlet/JiveServlet/previewBody/119973-102-1-220562/BO%20Explorer%20Implementation%20checklist.pdf
    Regards,
    Balajee
    Edited by: Balajee Sivakumar on Apr 27, 2011 6:30 PM

  • How to register Business Object Portlet in Oacle Portal

    Hi Gurus,
    Could anybody give me an idea How to register Business Object Portlet in Oacle Portal.
    Thanks & Regards
    Vikram

    Hi
    I am also looking into BO portlets but maybe I am one step behind you as I am still trying to find where to download the provider from.
    Could you tell me where to got the portlet from.
    I recently went to the Business objects web site and could only find a java portal integration kit for JSR 168 platforms (10g included in the list)
    at http://www.businessobjects.com/products/downloadcenter/boepik.asp

  • How to call business workflow in PI?

    Hi,gurus:
    How to call business workflow in PI and vice versa? Can I implement it using idoc adapter or RFC adapter?Or is it possible to expose the workflow to a web service?
    Any help will be appreciated.

    xinjiang li ,
    >is it possible to expose the workflow to a web service?
    Yes
    What is your actual requirement,
    Cheers
    Agasthuri

  • How to Find Business Objects for any Tranaction .

    Hi Abapers,
                        How to find Business objects for any transcation.....  and how to connect the Work flow to  any  Trancation  so that for example any body changes the date of Birth ...... so that the work flow should trigger .
    Thanks & Regards
    Bhaskar Rao.M

    Hi Bhaskar,
    For finding business object,you can try transaction SWO4 and by checking the documentation in it you can find your required business object.
    Another method is:
    1) Go to Trx SWE4 and switch on the event trace.
    2) Run your transaction which you want to use for triggering your workflow.
    3) Run transaction SWEL and find your Business Object and related event in it.
    For connnecting your WF to your transaction you have to create a start event in your WF in SWDD,where in you specify the Business Object and start event which you find using above method.
    Eg.You want your WF to be triggered whenever you have an error in your idoc.For this your BO will be IDOCAPPL and your event will be (inputErrorOccurred).This you will give in header data in SWDD.
    Neerja

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • How to call a exe or bat file from java program

    hi,
    i actually want to know that how to call a exe or bat file from program so that i can run them parallely.

    Try this :
    String strCmd = "myFile.bat";
    try
         Runtime rTime = Runtime.getRuntime();
         Process process = rTime.exec(strCmd);
         InputStream p_in = process.getInputStream();
         OutputStream p_out = process.getOutputStream();
         InputStream p_err = process.getErrorStream();
         p_in.close();
         p_out.close();
         p_err.close();
    catch(Exception e) {
         throw new Exception("Unable to start, "+strCmd);
    }

  • How to call Operating System commands / external programs from within APEX

    Hi,
    Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
    E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
    c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
    Any pointers will be greatly appreciated.
    Thanks & Regards,

    Hi Guys,
    I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
    However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
    sqlplusw.exe user/password@database @script1.sql
    sqlplusw.exe user/password@database @script2.sql
    sqlplusw.exe user/password@database @script3.sql
    sqlplusw.exe user/password@database @script4.sql
    What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
    Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
    Any help will be greatly appreciated.
    Thanks & Regards,

  • How to call a sql server stored procedure from oracle

    Hi all,
    Please anybody tell me how to call a sql server stored procedure from oracle.
    I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
    "dbo"."CreateReceipt"@hsa
    where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
    my database version is 10g
    Please help me how can i call it... I need to pass some parameters too to the SP
    thanking you

    hi,
    thank you for the response.
    when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
    my code is,
    declare
    c INTEGER;
    nr INTEGER;
    begin
    c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
    DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
    DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
    nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
    end;
    Create_Receipt is the sp which requires two parameters.
    please give me a solution
    thanking you
    sreejith

Maybe you are looking for

  • Failed boot after moving hard drive (IDE not SATA)

    Greetings all. I am attempting to setup a headless box, and in doing so I am installing Arch on one system (Sapphire Axion A3-M275 Motherboard), then moving the hard drive to the new system (SGS1660, a VIA CLE266/VT8235 based headless rack-solution).

  • Namespace problem with bpelx:rename typeCastTo

    Hi! I have j2ee web service which accepts types derived from one base type. Therefore i need to pass argument like request xsi:type="derivedType", where request is super type. After long searching i found out this can be done via bpelx:rename typeCas

  • Can't get photo gallery slide show to work

    Hello, If anyone could help, I'd appreciate it. This is for a non-profit I work for. After getting the gallery to work, I can't get the slide show to work. from my gallery.html: <title>Photo Gallery</title> <link href="../css/screen.css" rel="stylesh

  • N8 bad sound hardware

    Folks, I want to know if the problem is with my N8 or it is a general problem. I bought a Sennheiser CX680 to enhance my music experience, and when I put on my N8, the sound quality doesn't increase as much. but when I put it on an iPod or a PC, I ca

  • Unable to access my LR catalogue...

    Hi, I am trying to access my LR catalogue but get: "The Lightroom catalog named "Lightroom 3 Catalog" cannot be opened because another application already has it opened".  As far as I know, there is no other application open.  I am therefore unable t