Call BAPI in Custom ZRFC

Hi all,
    My requirement is create a  one ZRFC, inside RFC
  call BAPI sales order creation.
How to call BAPI in side RFC.
        please give step by step.
Thanks,

hi,
First create a RFC FM and than call this BAPI in RFC. the following r the steps.
1. Create a FM using tcode SE37. go to Attributes TAB --. make Processing type as Remote enabled module.
2. In the Source ocde of this FM,  call the BAPI FM...
Hope it is clear to u.
Regards,
Deepthi.
Edited by: deepthi dandibhotla on Sep 23, 2008 1:51 PM

Similar Messages

  • How to Call BAPI From the Custom Controller

    Hi
    I developed frist WD Application Using RFC Adapter.
    i did the following steps
    1. created the project
    2. created the model.
    3. created the customer controller and mapped the model of the controller to the model.
    4. mapped controller context to the views
    5. created one action in the start view
    6. created one method in the customer controller.
    so please let me know the lines of code to call BAPI using RFC.
    and  how to pass input valus to the bapi and how to execute the BAPI
    plese send the reply ASAP
    regards
    mmukesh

    Hi
    i did like this
    In  Start View OnActionSearch () method code
    public void onActionsearch (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
           wdThis.wdGetTestCustControllerController().executeGetlistBapi();
    in CustomController Init method
    public void wdDoInit()
        Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input();
        wdContext.nodeBapi_FlightGetlist_Input().bind(input);
        input.setDestination_From(new Bapisfldst());
        input.setDestination_To(new Bapisfldst());
    In CUSTOMECONTROLLER executeGetlistBapi();
    METHOD
    public void executeGetlistBapi( )
        //@@begin executeGetlistBapi()
        try{
           wdContext.currentBapi_FlightGetlist_InputElement().modelObject().execute();
           wdContext.nodeOutput().invalidate();
        }catch(Exception ex){
           ex.printStackTrace();
    Then let me know what is wrong in this
    i did as per pdf
    please correct if there is any worng in this code.
    this is flight example .
    regards
    mmukesh

  • ABAP program to call bapi of catsdb in sap

    ABAP program to call bapi of catsdb in sap
    coding please,
    Thank you,
    points will be rewarded,
    Regards,
    Jagrut BharatKumar Shukla

    if the transactions are custom one, then you can do some work around.
    But i dont know how you will do it for standard ones.
    Aa far as i know this requiorement has a least possibility.

  • Getlist bapi for customer based on sales org, distbtn chnl

    Hi,
        Is there any standard BAPI for customer Getlist , i want to filter based on distribution chanel and sales org and divison.
            Now am using BAPI_CUSTOMER_GETLIST  its showing all customer list i want to filter this based on distribution chanel and sales org and divison.
    Thanks ,
    Arun

    Hi Siva : )
    In VK11 we have a key combination radio button called Country/ Destination Ctr./Plant/TaxClCust/TaxClMat.
    I think it might be a custom key combination (so you might have to create a siliar one for yourself), but basically all I had to enter there was Country = GB, Destination Coutry = GB, plant SORG1 (it's called the same as the sales org and is linked 1-1), tax classification on Customer = 2 (because I want the central setting on the customer to be 2 = ICO, no tax), tax classification on material 1 = full tax goods and enter relevat tax code.
    Hope this helps.
    It worked for me.
    Kind regards,
    Tanja

  • How to create an Accounting Document by calling BAPI

    Hai friends ,
    please tell me how to call this BAPI and fulfill all the parameters .. Please help me , I dont know the head and tail of it ...
    create an Accounting Document by calling BAPI  BAPI_ACC_DOCUMENT_POST
    Below is the step to fill the parameters for BAPI:
    Enter company code, invoice no, invoice date, document type, header text into DOCUMENTHEADER
    Enter customer, item text, company code, payment term into ACCOUNTRECEIVABLE
    Enter offset account, company code, document type, item text into ACCOUNTGL
    Enter currency type u201800u2019, currency, exchange rate, amount into CURRENCYAMOUNT. Please note there will be two rows in this table, one positive amount and one negative amount
    Call the BAPI to create the AR document. If p_check is checked, call the BAPI only without COMMIT and then do the message processing
    If p_check is initial, COMMIT the data to the database tables.
    Check the RETURN table after each BAPI, if no u2018Eu2019 message type found, output the document no. Otherwise, output the error messge to the screen with the message type u2018Eu2019.
    thanks in advance ...

    Hi,
    Check the link
    http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=617
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bapi_acc_document_post-error-1973720
    http://delaynomore.spaces.live.com/blog/cns!D2BFFB84EDFE4189!528.entry
    http://sap4.com/wiki/index.php?title=BAPI_ACC_DOCUMENT_POST
    http://www.sapfans.com
    Anurodh

  • Can i call BAPIs with explict commit uisng xi

    I have a RFC which has 3 BAPI's inside it . Each Bapi is using an explict commit. Can i call  this  RFC from XI .

    Hi,
    You have 2 options..
    In the RFC Receiver Communication channel set the Advanced Property - "Commit Control for Individual BAPI Calls"
    the description in help is as follows -
    <b>Commit Control for Individual BAPI Calls</b>
    If you want to use this communication channel to call BAPIs as remote-enabled function modules that change data in the database, set the indicator.
    If executed successfully, the transaction is written to the database by calling the function module BAPI_TRANSACTION_COMMIT explicitly. If an error occurs, the transaction is rolled back by BAPI_TRANSACTION_ROLLBACK.
    The result is determined by the value of the field TYPE in parameter RETURN. If successful, the tables are empty and the values “”, “S”, “I”, and “W” are displayed. All other values are regarded as errors.
    To change this setting, set the indicator BAPI Advanced Mode.
    In the Successful RETURN-TYPE Values table, enter the values that should lead to a successful execution.
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/e80440a832e369e10000000a155106/frameset.htm
    or
    you can include the commit in the RFC(if it is a custom one...)
    Thanks,
    Renjith

  • 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

  • Calling BAPI from VB with ECC 6.0

    I have a Visual Basic 6 application that calls some standard BAPI's in a SAP R/3 system using Frontend 4.6d in order to upload data.  It also calls some custom RFC enabled ABAP to download data.
    We are upgrading to ECC 6.0 with SAP GUI 7.1.
    Can anyone tell me if I can still call BAPI's from VB6 or will I need to upgrade to VB.net?  Are there any changes to references in VB that I will need to make?
    Thanks!!
    Edited by: Jolene Roell on Feb 20, 2009 8:33 AM

    Well I could never figure out a way to call a BAPI from VB6 with ECC 6.  I ended up creating a VB.net dll using the SAP connector to call the BAPIs.  I could then call the dll from my existing VB 6 program.  That cut down on the recoding that I had to do.

  • 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

  • BAPI for Customer Create

    Hi,
    I need to simulate XD01 as my web dynpro application. (My requiremtn).
    I have a requirement to create the customer. ( In WEB DYNPRO)
    I am looking for the BAPI.
    In my application I am giving the customer number from My Screen as Exporting Parameter.
    But, In BAPI, by default it is assigning the Customer number. It is not taking as Input.
    Can you please tell me any BAPI or any FM or which creates customer by taking KUNNR as input.
    Regards
    Sandeep.

    Hi Sandeep,
    first don't use SD_CUSTOMER_MAINTAIN_ALL.....
    SD_CUSTOMER_MAINTAIN_ALL is used in standard during the maintenance of a consumer using the standard customer master data transaction XD01 & XD02.
    It is not intended to be used out of the transaction and in no case it should be used out of its original context. Due to the specificity of the function module, out of the original context we may face limitations and data inconsistencies.
    For the maintenance of customers, there is NO BAPI and NO direct function module.
    There are some functions modules like the one above where the name is looking nice. But these should not be used.
    Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]
    Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
    Then some other informations that can help too.
    Starting with ERP 2005 ehp2 or ehp3, a new initiative has been developped. It called the Lean Customer. This is a Web dynpro application to maintain customer master data.
    This development proposes an api that can be used directly if the limitation are ok for your development.
    Otherwise you have to go to the CMD_EI_API class to fullfil you goal
    Hope this helps
    BR
    Alain

  • Call BAPI directly or use bus object types

    Hi,
    A quick question.
    At a customer, I need to create a targetgroup in a CRM system from an ABAP program
    I found that there exists the standard business object type BUS1185, what in fact has several methods which call BAPI functions ( for example BAPI_TARGETGROUP_CREATE )
    My question is know what is the best way to create the targetgroup, call the BAPI directly or use the object type ( via include <CNTN01> and the macro's SWC...
    Thanks in advance for your advice
    Erwin

    the only reason for using the BO macro's in regular ABAP programming, is if you want to emulate workflow behaviour, or if extra logic of the business object is needed (for instance if you have to know the content of several (virtual) attributes)). In the last case you also have to instantiate the BO.
    Other than that, just use the BAPI.
    Kind regards, Rob dielemans

  • Sample ABAP code for userexits, and calling bapi's

    Hi,
    Can someone please send me sample ABAP code
    1) to do extractor enhancement using user exit.
    2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
    3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
    Thank you very much in advance and appreciate any help.
    Regards
    Prasad

    hai ,
    check this code...
    *& Tables
    tables : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
      select single * from tstc
        where tcode eq p_tcode.
    Find Repository Objects for transaction code
      if sy-subrc eq 0.
        select single * from tadir
           where pgmid    = 'R3TR'
             and object   = 'PROG'
             and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
             where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
              where pname = tstc-pgmna.
            select single * from enlfdir
              where funcname = tfdir-funcname.
            select single * from tadir
              where pgmid    = 'R3TR'
                and object   = 'FUGR'
                and obj_name = enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
    Find SAP Modifactions
        select * from tadir
          into table jtab
          where pgmid    = 'R3TR'
            and object   = 'SMOD'
            and devclass = v_devclass.
        select single * from tstct
          where sprsl eq sy-langu
            and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            select single * from modsapt
            where sprsl = sy-langu and
            name = jtab-obj_name.
            format color col_normal intensified off.
            write:/1 sy-vline,
            2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          endloop.
          write:/(95) sy-uline.
          describe table jtab.
          skip.
          format color col_total intensified on.
          write:/ 'No of Exits:' , sy-tfill.
        else.
          format color col_negative intensified on.
          write:/(95) 'No User Exit exists'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(95) 'Transaction Code Does Not Exist'.
      endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.

  • 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

  • How to add error message to return structure of calling BAPI from a BADI

    i have a bapi where a badi is triggered.this badi method has just importing and changing parameters.is there any way with which i can add error message to the return structure of calling bapi.please reply at the earliest.High points can be expected.

    thanks got it

  • Bapi for customer scheduling agreement

    hi ,
    please tell a bapi for customer scheduling agreement(va31).
    Thanks,
    sridhar

    Hi Reddy ,
    what happend ? u told that u got the BAPI ?
    i already seen that FM ,Do one thing ? search for COMMIT WORK in VA31 program , i think u will get some idea.
    regards
    Prabhu
    Message was edited by: Prabhu Peram

Maybe you are looking for

  • Cannot get my website to display properly on Iphone...what gives?

    This mild annoyance has now become a huge problem lately.  My supporting pages on my website do render properly on the browsers in my iphone.  The background repeats itself and when I add the "no-repeat" code, one side of the screen is gray. Also, my

  • How to Play a sample sound using Java

    Hi, I have an mp3 music files in database. When a user chooses a particular button, all the songs are fetched from the database. I have two buttons namely, 'Buy' and 'Play Sample'. If I click the 'Play Sample' button, a sample of the song has to be p

  • Can't fast forward in QuickTime for iPhone 3.0?

    Does anyone know how to get the slider bar that allows you to fast forward a Quicktime on iPhone 3.0? On the previous version, any quicktime apps had the volume slider on the bottom, and the play timer up top, which you could slide to forward to or g

  • I have a question about how to contact HR with e-mail.

    I read the rules about anything about HR is not allowed, but I also read to contact HR directly, so I won't ask anything further here. My question is, how? I searched for an e-mail, but all I have been able to find is a phone number I can't ring sinc

  • How can I change the default url each time I open a new tab?

    New tabs used to open up with the same home page I use when I open firefox but now all tabs open up with something different and I can't find where to change that.