Requirement on calling BAPI

Hi all
i have one requirement , when i submit the form in webdynpro by filling with some data and click the submit button then data has to be stored in the ECC/SRM system by calling required BAPI.
can you help me out , is there any coding required for the same in webdynpro application?
Regards
Suresh babu

Dear Sunil,
You can use AdaptiveRFC Model by creating models in webdynpro,
1. You will find Models image in dark blue in list.
2. right click on it,
3. create model.
4. import Adaptive RFC Model.
5. Give a name for that model.
6. give WD_MODELDATA_DEST and WD_RFC_METADATA_DEST change this to customised in logical system name by typing there.
7. click next
8. enter host name of your ECC/SRM system.
9. system no,
10. client no.
11. user ID for the system (can be any user ID who has access to Function Modules or bapi)
12. user's password
13. search bapi name in function module with *.
14. select the required bapi's from the list by ticking them.
15. click finish.
the model is ready to be used.
1. go to component controller.
2. right click.
3. right click, template apply, service controller.
4. choose the bapi for execution from the models list.
5. it gives the execution method which will be created in component controller.
6. finish.
double click on component controller
go to method.
organise import.
now,
go to diagram view of component.
you will find the connection between model and component controller.
connect between view and component controller.
drag and drop the model node from component controller.
the model node will be created in your iview.
to set values of table before executing bapi you need to create object of that model node.
Thanks...
-Mohak...

Similar Messages

  • 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

  • Is RFC destination is required for accessing BAPI from java/VB program.

    I am not able to understant that all BAPI are Remote enabled ,but no where I observed that RFC destination is required.
    Can any body tell me exact flow and things step by step.
    Any example/full source code so that I can call from java program.
    I have tried some java code posted here but not able to understand ..
    please provide me setttings also in SAP and java system

    Hi Nagaraju,
    Thank you very much. your post resolve one of my basic need .really appreciate your post.
    I was not able to execute bapi BAPI_MATERIAL_GETLIST but I executed BAPI_PO_GETDETAIL succesfully.
    Still I have 2 doubt.
    [1]. I called BAPI function module(BAPI_PO_GETDETAIL) from simple java program,But I need to call API method ( GETDETAIL) created for this BAPI not direct BAPI function module.
    [2] this is something apart from original topic.
    I have tested your java code in java as well as similar in ECC 6.0
    But I am not getting any output in JAVA program.
    I am getting output in ECC6.0 only when I will take internal table lt_mara[] with header line.
    if I will take separate workarea output is not coming. I think this is the problem in JAVA also.
    Please see the code and tell me where I am wrong.
    REPORT ZTEST1.
    types: begin of ty_mara .
       include STRUCTURE BAPIMATRAM.
    TYPES: END OF ty_mara.
    types: begin of ty_list .
      include STRUCTURE BAPIMATLST.
    TYPES: END OF ty_list.
    data: lt_mara type STANDARD TABLE OF ty_mara with HEADER LINE.
    data: lt_list type STANDARD TABLE OF ty_list,
          ls_list like LINE OF lt_list.
    START-of-SELECTION.
    lt_mara-SIGN = 'I'.
    lt_mara-option = 'EQ'.
    lt_mara-matnr_low = '000000000000000088'. "'P1001087'.
    lt_mara-matnr_high = ''.
    APPEND lt_mara.
    lt_mara-SIGN = 'I'.
    lt_mara-option = 'EQ'.
    lt_mara-matnr_low = '000000000000000089'. "'P1001087'.
    lt_mara-matnr_high = ''.
    APPEND lt_mara.
    CALL FUNCTION 'BAPI_MATERIAL_GETLIST'
    TABLES
      MATNRSELECTION                     = lt_mara
      MATNRLIST                          = lt_list[]   .
    WRITE / 'output:  '.
    LOOP AT lt_list into ls_list .
      write: ls_list .
    ENDLOOP.
    REPORT ZTEST2.
    types: begin of ty_mara .
       include STRUCTURE BAPIMATRAM.
    TYPES: END OF ty_mara.
    types: begin of ty_list .
      include STRUCTURE BAPIMATLST.
    TYPES: END OF ty_list.
    data: lt_mara type STANDARD TABLE OF ty_mara, ">> Without header line
           ls_mara like line of lt_mara.
    data: lt_list type STANDARD TABLE OF ty_list,
          ls_list like LINE OF lt_list.
    START-of-SELECTION.
    ls_mara-SIGN = 'I'.
    ls_mara-option = 'EQ'.
    ls_mara-matnr_low = '000000000000000088'. "'P1001087'.
    ls_mara-matnr_high = ''.
    APPEND ls_list to lt_mara.
    ls_mara-SIGN = 'I'.
    ls_mara-option = 'EQ'.
    ls_mara-matnr_low = '000000000000000089'. "'P1001087'.
    ls_mara-matnr_high = ''.
    APPEND ls_list to lt_mara.
    CALL FUNCTION 'BAPI_MATERIAL_GETLIST'
    TABLES
      MATNRSELECTION                     = lt_mara
      MATNRLIST                          = lt_list[]          .
    WRITE / 'output:  '.
    LOOP AT lt_list into ls_list .
      write: ls_list .
    ENDLOOP.

  • 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

  • Calling BAPI's from java

    Hi ,
      Is there any way can we call BAPI's in java.   If yes, could you pls tell me the required jar files for that or any useful sites. 
    Thanks in Advance
    JM

    Hi,
    did you check:
    http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000463654&
    there's some sample code inside
    https://websmp209.sap-ag.de/~sapdownload/011000358700007640702002E/SAPJCo.pdf
    also blogs:
    /people/tarun.telang2/blog/2005/10/03/debugging-a-rfc-call-using-jco-api-part-2
    Regards,
    michal

  • Call BAPI to Create Invoice During PGI(VL01N) via BADI

    Hi,
    Requirement: During PGI (VL01N), we have implemented a BADI (IF_EX_DELIVERY_PUBLISH) in method (PUBLISH_AFTER_SAVE) to call BAPI (BAPI_BILLINGDOC_CREATEMULTIPLE) to create invoice simultaneously with the PGI. In DEV box, the call BAPI is working fine (invoice is created). However in QA box there is a update termination occuring in the call BAPI, thus no invoice is being created. The thing is, how do I locate why the BAPI is terminating in QA but not in DEV? Is the BADI used correct? I have searched SAP Notes related to this termination when doing PGI in VL01N. Up to now we still do not know why in DEV is okay in QA it is not.
    SAP Notes:
    782447 Runtime error SAPSQL_ARRAY_INSERT_DUPREC when posting GIs
    777409 Foreign trade: Update termination EXPIMP_POSTING
    ST22 dump analysis:
    In the source code you have the termination point in line 51
    of the (Include) program "LV50EU05".
    The program "SAPLV50E" was started in the update system.
    The termination is caused because exception "CX_SY_OPEN_SQL_DB" occurred in
    procedure "EXPIMP_POSTING" "(FUNCTION)", but it was neither handled locally nor
    declared
    in the RAISING clause of its signature.
    The procedure is in program "SAPLV50E "; its source code begins in line
    1 of the (Include program "LV50EU05 ".
    Source code:
    DESCRIBE TABLE XEIKP LINES LIN.
    IF LIN GT 0.
       INSERT EIKP FROM TABLE XEIKP.         <<< the dump is happening in this standard logic
       REFRESH XEIKP.
    ENDIF.
    Edited by: Mawi C. Ng on Sep 2, 2009 2:24 PM

    Hi,
      Based on the DUMP i can say that in the below statement :
    INSERT EIKP FROM TABLE XEIKP. <<< the dump is happening in this standard logic
    The program is trying to insert lines which have duplicate key values check the btable XEIKP at this point and see if the records that are there do they have key fields values that already exist. You can put a break-point at that statement and check.
    Regards,
    Himanshu

  • Can we call bapi from SAP or ABAP How? Pls Step by step

    Can we call bapi from SAP How? Pls Step by step
    thank you,
    Regards,
    Jagrut BharatKumar Shukla

    Hi,
    Do you mean you want to access BAPI in ABAP report?
    If yes, then YES we can call,
    1.Create a report -> In pattern write your BAPI name.
    2. It is like your FM , Read correspoding BAPI documentation
    3. Fill required parametes.
    4. Test run and if successful , final run it.
    And from Outside,
    You have to establish a connection and create a wrapper and access using avaialble APIs.
    Reward if useful!

  • 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

  • CALLING BAPI IN RFC ENABLED FM

    Hii Experts,
    I have a query,Please help me to solve it. My problem is I do not know to call the two bapis together in an RFC enabled FM and then expose it as a weblink which can be used to enter data for PO creation .Because calling bapi as a fn module requires passing values to its import parameters and my req is to take the parametrs as input in the bapi po create weblink.
    Regards
    Brijesh

    You mean you want to create a "web service" within SAP I guess. There are blogs which explain that well.

  • Smart Synchronization Without calling BAPI wrapper

    Hi All,
    I am very new to SAP MI development...
    I wanted to know that
    is it possible to call BAPI directly not calling with use of BAPI Wrapper?
    is there any other way to do Smart Synchronization where BAPI wrappern not required?
    Thanks,

    Hi Maulik,
    if u directly want to call the BAPI u will need to call the underlying RFC related to that BAPI.
    This is done through Generic Synchronization.
    Please refer to documents on help.sap.com and MDK for further help.
    cheers
    Anand

  • 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

  • How to call BAPI from ABAP Inbound Proxy

    Hi All
    Can some one provide/giude  a sample code on how to call a BAPI from generated Method (Inbound Proxy) and how are the table parameters passed from Proxy to BAPI.
    Thanks
    Ravi/

    Hello Ravi,
    In the proxy before calling the BAPI, construct the table, fill it with the appropiate values by lopping over the proxy request object. Now use this table for calling BAPI
    Cheers,
    Naveen

  • 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

Maybe you are looking for

  • What's wrong with my T2i?

    I just purchased a 2nd hand T2i and it looks like its in pristine condition. I decided to take a few test photos with the kit lens (I dont have any other lens to work with at the moment) and immediately noticed a thin line appearing in every single p

  • LV file corrupt? I try to load, it asks to find the file I just tried to load

    I have a LV file that when I go to open it, it brings up the prompt saying "please find the Vi named "xxxx.vi" " which is the file that I just tried to open.  I select the file again and just stays in a loop and never actually opens the file.  Both I

  • How do I add e-signature to pdf?

    THIS IS AWFUL SOFTWARE. How do I add e-signature to a pdf? I've wasted this entire day trying to figure out this crappy software. I just need to sign ONE DOCUMENT.

  • Restore from  desired  backup file

    Hi, I am new with oracle and RMAN. Can we restore database from desired/certain backup file? how to do that? Thank's Tatang

  • Opening iMovie projects

    I have a question about iMovie HD 6. When I launch it, I want the screen to come up that asks if I want to create a new project, open an existing project, or make a magic movie. Is there a way to make this the default screen when I open iMovie HD6.