Problem in calling bapi

hi
i developed one report and one bapi (to create sale order with ref to contract) every thing working fine.
now my client asked he want to call bapi program from report because my report output is input to bapi for this i maintained check box for every row in report and in application tool bar i maintained one key , suppose he selected one record and press on that key it should move to bapi up to this working fine .for this my logic is
SET PF-STATUS 'ZCON'.
At USER-COMMAND.
CASE SY-UCOMM.
WHEN 'BAPI'. "this is key
CALL TRANSACTION 'ZBC'. "zbc = my bapi tcode
endcase.
now i have to pass selected record values to bapi input automatically so what i have to write .
please share information
thanks in advance
Moderator message : Duplicate post locked. Continue with the original thread.
Edited by: Vinod Kumar on Sep 7, 2011 10:32 AM

Hello Bhavin,
you have marked your question an self solved. Would be fine if you post your solution.
Regards
Gregor

Similar Messages

  • Problem in calling BAPI on HTML screen

    Hi all,
    i have an input tag on the html screen and ~event linked to the form is say Confirm.
    so when anyone clicks on button so it calls BAPI for the online form. it is making the server slow and after some time it gives the internal server error.
    say
         <event name="Confirm" next_state="Confirm"/>
         <state name="Confirm">
              <module name="ZV_FUNC_CCK_CONFIRM_ORDER" type="RFC" stateful="1">
                   <result next_template="ZV_CCO_CONFIRMED_ORDER">
                        <expr>RET == ""</expr>
                   </result>
                   <inputmapping source="Contract" target="CONTRACT"/>
                   <inputmapping source="SHIP_TO" target="CUSTOMER"/>
                   <inputmapping source="CONT_ITEM" target="ITEM"/>
                   <inputmapping source="RET" target="RET"/>
                   <inputmapping source="TRANSPORT" target="TRANSPORT"/>
                   <outputmapping source="ITEM" target="CONT_ITEM"/>
                   <outputmapping source="RET" target="RET"/>
                   <outputmapping source="SALESORDER" target="SALESORDER"/>
              </module>
         </state>
    thanks
    ekta

    Thanks
    Ekta

  • Locking Problem while calling BAPI

    Hi ,
    I am calling a BAPI in my wd appln . if there is some problem while executing the bapi like posting period not open then i am displaying the error of the BAPI . but after that i see in the locked tables through SM12 some tables gets locked .
    so when i call the BAPI again it gives me error like the following tables are locked by the user... so is there any way by which i can release the locks hold by the bapi if problems occurs.
    Regards
    Yash

    Hi Yash,
    Try the command ROLLBACK WORK if the error occurs.
    This will remove all locks set by the BAPI.
    Regards,
    Jos

  • Problem of calling BAPI to release transport request

    Dear Friends,
    I want to automatically release Transport Request using BAPI (BAPI_CTREQUEST_RELEASE), but I met a difficult during the process that only TR TYPE 'K'or 'W' can be release using this BAPI, if I create an addon program which TR Type is 'S' (stand for Development/Correction), then this BAPI does not work. 
    BTW, you can refer table E070.
    Could you please kindly give me some idea to solve this problem?
    Thank you in advance.
    Best regards,
    Nick

    Dear Li Nick,
    The reason that you cannot release a request of type 'S' is that type 'S' names a local correction, which cannot not be transported (and therefore of course not released).
    Regards, Tino

  • Problem with mutiple BAPI calls during the commit

    Hi all,
    I am trying to create accounts for a given partner i the transaction F9K1 using the BAPI BAPI_BKK_ACCNT_CREATE. After calling the BAPI I am committing it too.
    The problem is if I try to create multiple accounts like RCA, ACA, MCA, IOE and so on, the first time the BAPI is called to create RCA account it is successful an it is even committing. When I call the BAPI to create the the ACA account the return table from the BAPI shows success message but the commit fails. If I restart the program and try creation of accounts now the RCA will throw a error msg saying account already exist, ACA account will be created and then the MCA account creation fails in the same manner explained above.
    I see the issue is with multiple BAPI calls and I tried using all sort of methods like clearing buffers, start new task in local and wait command and all.  But none of them seems to be working for me.
    Can anyone please guide me on how I can overcome this problem.
    Thanks.

    BAPI :
    BAPI BAPI_BKK_ACCNT_CREATE
    Functionality
    Use this method to create an account in Bank Customer Accounts. This method returns the following values:
    Identification details for the newly created account such as the internal and the external account number, and the bank area details
    A table containing error messages
    To create an account by using this method, you must specify values for the import parameters Bank Area (BANKAREA) and Product (PRODUCTNAME).
    Note: You must also specify a value in the External Account Number (EXTERNALACCOUNTNR) parameter if you have defined an external number range for the bank .
    REgards,
    Jayan.

  • HTTP to RFC (Calling BAPI)

    Hi,
    I am working on creating a Purchase Order in SAP system by calling BAPI's from XI using RFC adapter.
    I defined the following in IR:
    1. Created data types for mapping with BAPI request and response.
    2. Created messsage types and assigned corresponding data types to the message types.
    3. Created one Message Interface (Outbound/Synchronous), Output message - request message type, Input message - response message type.
    4. Create request and response message mapping and one Inteface mapping (with request tab and response tab) properly assigned.
    Defined the following in ID:
    1. Created HTTP business system (no communication channel)
    2. Created communication channel for receiving system (SAP).
    3. Created receiving determination and interface determination, receiver agreement, no sender agreement.
    I sent XML message (required data to create purchase order) from HTTP client but I am getting the response as <b>Unable to determine name of mapping program</b>, my Interface Determination has proper Inbound Interface (ZBAPI_PO_CREATE) and Mapping program (PO_I_MAP). But Why am I getting the reposnse as I said above in my HTTP client?
    Appreciate your help,
    Thanks and Regards,
    Jagadish.

    Hi Jagadish,
    The error lies in Message Mapping .So please check it once again .You have mentioned your steps it seem there is problem in Message mapping..
    Please look at the following Steps..
    IR:
    1.Import Corresponding RFC(BAPI). No need to create Interface Objects( Data type, Message type,Message Interface ) for SAP( RFC ) system..
    2.Create Interface Objects For HTTP System.As you told it is synchronous.
    3.Perform Two Message Mappings
      (A).HTTP Request <--> RFC Req
      (B).RFC  Response<-->HTTP Res
    4.Perform one Interface Mapping which includes Request and Response Mappings ..
    5.Activate all objects..
    ID : what you have done is ok..
    URL: http://<hostname:port>/<path>?<query-string> Make sure your URL is correct or not for( sender HTTP )..
    I think it will hepl you , if it is solved please assign points . If you have any doubt you can call me...
    Thanks
    N.Prasad Babu
    iGATE Global Solutions Hyderabad : 98490 65377

  • Calling Bapi through BADI gives data statement error

    Dear Experts,
    I am trying to call BAPI through BADI ME_PROCESS_REQ_CUST --> process_item.
    I get an error stating that "The addition OCCURS no longer supported in OO objects"
    If, I remove OCCURS statement I get an error stating that "Tables with headers are no longer supported in OO context" for the following data statement.
    Appreciate, if you could provide possible solution to overcome the problem.
    Regards
    Kumar
    BAPI code is as follows.
    DATA: LV_TABIX LIKE SY-TABIX,
    LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
    LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
    LV_TABIX = SY-TABIX.
    CLEAR: LT_WMDVSX, LT_WMDVEX.
    REFRESH: LT_WMDVSX, LT_WMDVEX.
    Fill communication table
    LT_WMDVSX-REQ_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
    LT_WMDVSX-REQ_QTY = ET_PROCUREMENT_ITEM-QUANTITY.
    APPEND LT_WMDVSX.
    Availability check with check rule '03'
    CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
    EXPORTING
    PLANT = ET_PROCUREMENT_ITEM-PLANT
    MATERIAL = ET_PROCUREMENT_ITEM-MATERIAL
    UNIT = ET_PROCUREMENT_ITEM-UNIT
    CHECK_RULE = '03'
    TABLES
    WMDVSX = LT_WMDVSX
    WMDVEX = LT_WMDVEX
    EXCEPTIONS
    OTHERS = 1.
    IF SY-SUBRC EQ 0.
    READ TABLE LT_WMDVEX WITH KEY
    COM_DATE = ET_PROCUREMENT_ITEM-DELIV_DATE.
    IF SY-SUBRC EQ 0.
    ET_PROCUREMENT_ITEM-AVAIL_QTY = LT_WMDVEX-COM_QTY.
    ENDIF.
    ENDIF.

    Hi,
    Occurs is no more supported by SAP ( is an obsolete statement )
    <b>Instead of following code</b>
    DATA: LV_TABIX LIKE SY-TABIX,
    LT_WMDVSX LIKE BAPIWMDVS OCCURS 0 WITH HEADER LINE,
    LT_WMDVEX LIKE BAPIWMDVE OCCURS 0 WITH HEADER LINE.
    you can use
    data: LT_WMDVSX type standard table of BAPIWMDVS,
            LT_WMDVEX type standrad table of  BAPIWMDVE,
            LS_WMDVSX like line of LT_WMDVSX ,      "( work area )
            LS_WMDVEX like line of LT_WMDVEX.       "(work area)
    use workarea to get the data and then append the records from workarea to Internal tables
    Reward points if usefull
    Regards,
    Mohan

  • How to call BAPI from R/3 system

    hi,
    i am doing small application by using Model. that is calling BAPI from R/3 system. but i am not able to get data from the back end system. please suggest me regarding this problem
    thanx
    tanvi

    steps:
    1) create Model
    2) bind Model to component controller ( you can use data modeler.) 2.1) open data modeler; if your model is not there, you can add by clicking add existing model;
    2.2) create data link between model and controller, it will open map dialog.
    2.3) click and drag BAPI_xxx_Input to context of controller and select all nodes inside
      - if there is any duplicate nodes, just rename it.
    3) map context to view controller
    3.1) map input parameters separately ( which takes value for IMPORT to BAPI. select only that fields
    3.2) do map for output (exact node which contains BAPI output)
    coding:
    1) in component controller you need to instantiate model and bind to context
    BAPI_xxx_Input my_input = new BAPI_xxx_input();
    wdContext.nodeBAPI_xxx_Input my_input().bind( my_input);
    2) create a method in the component controller so that we can execute it from any of views used.
    try{
      wdContext.currentBAPI_xxx_Input my_input().modelObject().execute();
    }catch(WDRFCException e) {
    e.printStackTrace();
    wdContext.node<ExactOutput>().invalidate();
    // this stmt will reflect new values
    3) Go to view and bind values to UI Elements
    in wdDoInit()
    IPrivate<Comp_Name>View.I<ExactOutput>Element  input = wdContext.create<BAPI_xxx_Input>Element();
    // see if this may demand model instance as parameter
    wdContext.node<BAPI_xxx_Input>().addElement( input);
    4) In OnAction you just executes the component controller method
    wdThis.wdGet<Com_Name>Controller().executeMyBapi();
    // executeMyBapi() is the method contains the mentioned try..catch code
    nikhiL

  • Calling BAPI in the Classes and also in Methods

    hi ,
    is it possible to call the BAPI function module in the classes, i am creating BSP for creating the material, i think BDC will not work properly in this case, so i want to use BAPI for creating material , so please suggest me which way is suitable for this, and let me know is it possible to use BAPI's in classes which is created throw SE24 tcode.
    srujan.p

    Hi,
    yes, it is possible to call BAPI from method. It is just normal function module call. Generally I am trying to avoid BDC. It almost always brings some problems. There is BAPI BAPI_MATERIAL_SAVEDATA for maintaining material master data.
    Cheers

  • Calling Bapi from Dot Net

    Hi All,
    We are Trying to upload Bapi's From Dot Net.
    When we are uploading Sales Order upload i will get this error ""ERROR: Sales document type DG-1 is not defined"" ,But If i Call Again It is not giving the any error and simply its updating the SAP data base.Not only Sales Order upload but Customer Master upload also First time iam getting :"" Invalid form of address text"" This Error...After Second Exectuion I am getting Sucess Message.
    Why My Bapi Call is Not Sucess for First Call and why it is Getting sucess in Second Exection When i am calling bapi from .Net
    how can i solve my Problem?
    Thank you,
    Madhu
    Edited by: madhubabu rao on Oct 24, 2008 8:20 AM

    Hello,
           Refer to the below Thread & Link respectively.
    Re: Call BAPI WS from .NET
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/12f6d390-0201-0010-e18d-cdb4554a9e75
    Thought it might give you some inputs.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • Performance issue calling bapi po create in test mode to get error messages

    Hi,
    We have  a report which displays in alv the purchase orders that got created in SAP, but either got blocked due to not meeting PO Release Strategy tolerances or have failed output messages .We are displaying the failed messages too.
    We are looping the internal table of eban(purchase requisition) and calling bapi po create in test mode to get failed messages.
    Now we are facing performance issue in production.What can be the other effecient way to get the error messages without effecting performance.
    Regards,
    Suvarna

    Hi Suvarna,
    so you need to reduce the number of PO-simulations.
    - Likely you checked already, that all EBAN-entries should already be converted into POs. If there would be a large number of "new" EBAN-entries, they don't need to be simulated.
    - If it's a temporary problem: give aid to correct the problems (maintain prices or whatever the error-reasons are) Then the amount of not-converted purchase requisitions (PR) should drop, too
    - If it's likely, that your volume of open PR will stay high: create a Z-Table with key of EBAN and a counter, simulate (once a day) PO conversions and store the results in the Z-table. In your report you can use the results... if they are "new enough". From time to time new simulations should be done, missing master data might be available.
    Maybe users should be allowed to start this 2nd report manually (in background), too -> then they can update the messages after some data corrections themself, without waiting for the result (just check later in online report and do something different in between).
    And you might need to explain, PO simulation takes as long as PO creation... there is no easy or fast way around this.
    Best regards,
    Christian

  • Calling  BAPI by using JAVA connector..

    hi friend.. sorry for silly question..
    can u guide me how i can call BAPI in JAVA ..
    i know how to create JCO connection...
    i need to create client for this or not??or not??
    thanks
    NARPAL.

    Hi Rajesh Paranjpe,
    Here is sample code from SAP help:
    import com.sap.mw.jco.*;
    public class Bapi1 extends Object {
       JCO.Client mConnection;
       JCO.Repository mRepository;
       public Bapi1() {
          try {
             // Change the logon information to your own system/user
             mConnection =
                JCO.createClient("001", // SAP client
                  "<userid>", // userid
                  "****", // password
                  null, // language
                  "<hostname>", // application server host name
                  "00"); // system number
            mConnection.connect();
            mRepository = new JCO.Repository("SAPJCo", mConnection);
          catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
          JCO.Function function = null;
          JCO.Table codes = null;
          try {
             function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
             if (function == null) {
               System.out.println("BAPI_COMPANYCODE_GETLIST" +
                                  " not found in SAP.");
               System.exit(1);
             mConnection.execute(function);
             JCO.Structure returnStructure =
               function.getExportParameterList().getStructure("RETURN");
             if (! (returnStructure.getString("TYPE").equals("") ||
                    returnStructure.getString("TYPE").equals("S")) ) {
               System.out.println(returnStructure.getString("MESSAGE"));
               System.exit(1);
             codes =
               function.getTableParameterList().getTable("COMPANYCODE_LIST");
             for (int i = 0; i < codes.getNumRows(); i++) {
               codes.setRow(i);
               System.out.println(codes.getString("COMP_CODE") + '\t' +
                                  codes.getString("COMP_NAME"));
          catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
          try {
            codes.firstRow();
            for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
              function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
              if (function == null) {
                System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
                                   " not found in SAP.");
                System.exit(1);
         function.getImportParameterList().
           setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
         function.getExportParameterList().
           setActive(false, "COMPANYCODE_ADDRESS");
         mConnection.execute(function);
         JCO.Structure returnStructure =
           function.getExportParameterList().getStructure("RETURN");
         if (! (returnStructure.getString("TYPE").equals("") ||
                returnStructure.getString("TYPE").equals("S") ||
                returnStructure.getString("TYPE").equals("W")) ) {
            System.out.println(returnStructure.getString("MESSAGE"));
         JCO.Structure detail =
           function.getExportParameterList().
           getStructure("COMPANYCODE_DETAIL");
         System.out.println(detail.getString("COMP_CODE") + '\t' +
                            detail.getString("COUNTRY") + '\t' +
                            detail.getString("CITY"));
      catch (Exception ex) {
        ex.printStackTrace();
        System.exit(1);
      mConnection.disconnect();
    public JCO.Function createFunction(String name) throws Exception {
       try {
         IFunctionTemplate ft =
            mRepository.getFunctionTemplate(name.toUpperCase());
         if (ft == null)
           return null;
         return ft.getFunction();
       catch (Exception ex) {
         throw new Exception("Problem retrieving JCO.Function object.");
    public static void main (String args[]) {
       Bapi1 app = new Bapi1();

  • Using the container format to call BAPIs

    I'm trying to call BAPIs with the SWO_CREATE and SWO_INVOKE RFC's, and having a difficult time getting the container marshalled correctly.  Can anyone supply or point me to information about marshaling arguments in the container?
    Thanks

    Hi Jhon,
    I have seen your question for the container format to call BAPI and could not find any replies or any kind of information regarding the container marshalling on the web. I am having a simillar problem when invoking the SWO_INVOKE, i am passing a container and it gives me a error saying "packed field with incorrect BCD format" and i am trying to find some kind of solution for this, if you  had a some kind of solution or guidance that would be great.
    Thanks,
    Praveen

  • Calling BAPI only ones and receiving all values

    HI all,
      I am having a BAPI and I want to receive all the values from the BAPI at the first time.I am having two tables table1 and table2. These tables are inside a Tab(tab strip).
    When i click the Tab strip the BAPI fills the first table table1 and based on the lead selection in table1 it calls the BAPI again and fills the second table tab2. But I want to call BAPI only ones when i enter the Tab and show the details from buffer.
    It should give the values based on the lead only from webdynpro.
    Please help..Its urgent..
    Thangs&regards
    karthik.

    Hi Karthi,
    1> Take a Value Node with the necessary attributes to store the BAPI output only once.
    2> Inside wdDoint Method:  Execute the BAPI and Copy the BAPI Output to your Value Node.
    3>All the data will be available in your ValueNode. Use the Value Node as per your requirement.
    Re: RFC Issue - Cardinality and Selection problem
    Issue with Table
    Regards,
    Mithu

  • Filter table data without calling BAPI

    Hi all,
    How I can filter VC table without calling BAPI or other backend? The objective is to bring a large data only once and allow to user filtering of this data.
    The problem is that the filter options are dynamic so I can't use "hidden tables" workarownd.
    Any ideas?
    Thanks,
    Ola

    Hi,
    I think this is not possible, because you can only filter the data once with the filter element. If you use a BI query you can use filters. Maybe you can bring the data to a hidden table and get the data again from this table with different filter elements resp. dynamic filter values, but I think this is very tricky and not a good solution.
    Best Regards,
    Marcel

Maybe you are looking for