Hi regarding bapi

hi can any one of you make me know which bapi to be used to find material availability check based on sales order and item no.
thanks & regards
prasanna kumar

HI,
Try with following bapi's
BAPI_MATERIAL_AVAILABILITY
BAPI_SALESORDER_SIMULATE
Reward if useful.

Similar Messages

  • Regarding BAPI Docu

    Hi,
    I want to learn BAPI,can anyone send me the documentation regarding BAPI.
    Like what is BAPI?
    use of BAPI?
    When the BAPI will be used..........
    Thanx in advance.

    Hi,
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    u can check the below the material also
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Bdc to Bapi
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.
    Bapi to VB(Visual Basic)
    Long back I had used the following flow structure to acheive the same.
    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
    You need to have com4abap.exe
    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
    else refer OSS note 419822 for installation of com4abap
    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
    for setting up com4abap and rfc destination please refer to the documentation for com4abap.
    Invoke NEW DCOM session
    call function 'BEGIN_COM_SESSION'
    exporting
    service_dest = service_dest "(this will be a RFC destination created in SM59)
    importing
    worker_dest = worker_dest
    exceptions
    connect_to_dcom_service_failed = 1
    connect_to_dcom_worker_failed = 2
    others = 3.
    call function 'create_com_instance' destination worker_dest
    exporting
    clsid = g_c_clsid
    typelib = g_c_typelib
    importing
    instid = g_f_oid
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    call function 'com_invoke' destination worker_dest
    exporting
    %instid = g_f_oid
    %method = 'UpdatePDF'
    sntemp = g_v_const_filent
    snsysid = sy-sysid
    snflag = 'N'
    tables
    rssaptable = g_t_pdfdetail1
    %return = g_t_pdfdetail1 "t_test
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    then close the com session , using
    FM delete_com_instance
    FM END_COM_SESSION
    Regards,
    Priyanka.

  • Regarding BAPI HRXSS_CAT_WD_RECORD

    Hi Experts,
    This is regarding BAPI HRXSS_CAT_WD_RECORD.for  this BAPI ,  I am providing inputs like this
    IV_PERNR = 90030.
    IV_ACTION  = COPY_FROM_PREVIOUS_PERIOD.
    IV_BEGDA = 09/20/2008 .
    IV_ENDDA = 09/26/2008 .
    So this BAPI has to copy the previous period(week) data to current week what I provided in the input area.But it is not returing (it is not copying previous week data).means COPY_FROM_PREVIOUS_PERIOD action is not working in BAPI.
    Is there any BAPI for meeting this requirement. I want copy the previous weeks time sheet data to week dates provided in input. This functionality is available in Tcode in cat22.
    Regards,
    Vinod

    You may use the following BAPI (actual BAPI these one) to fulfil your requirement:
    - [BAPI_CATIMESHEETRECORD_GETLIST|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetrecord_getlist&adv=false&sortby=cm_rnd_rankvalue]
    - [BAPI_CATIMESHEETMGR_INSERT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=bapi_catimesheetmgr_insert&adv=false&sortby=cm_rnd_rankvalue]
    Regards

  • Regarding BAPI at sales order

    Dear guys,
    I have CSV file having records, which is read from local PC and has to be uploaded in R/3 screen.
    Concretely speaking, Now Records from CSV files will be displayed in Sales order screen. customer will correct the data changes in screen(if necessary for each record) and save the record to sales table.
    1-Here i want to know should i have to use BAPI or not for saving datas in sales order table.
    (Its purely ABAP programming module)
    2-if Bapi is required could you pls tell what BAPI is required to save in sales table.
    Thanks in advance.
    ambichan.

    Hi Ambichan,
    first of all: don't make changes (/ use exits / BADI) for this task. Only if you need different functionality for sales document creation itself, you might do some enhancements.
    Copy of this transaction doesn't make much sense: to much to delete. Maybe you use screen definition, but the rest you should do on your own.
    Do you need feedback from system?
    Yes: use BAPI_SALESORDER_SIMULATE to get feedback (like delivery days, availability...) and display results in own transaction.
    No: just display the values like an editor (but in corresponding fields and places of VA01).
    If you create only one order at a time, then it's also possible to use a batch input (VA01), started in error mode, to fill all fields. Then your last action is pressing enter (instead of save). Transaction will pop up, because it's not finished -> user is in correct transaction, feedback from system is available, all additional functions (like display customer / article / whatever else data) are at hand...
    Regards,
    Christian

  • Problem regarding BAPI call from a webdynpro applications

    Hi,
      We are trying to call a BAPI in R/3 system from a webdynpro application through the standard method. But we are getting some problems in JCO settings. We already wasted so much time in solving those problems. Is there anyway where i can access BAPI from Webdynpro application.
    Rgrds,
    Anna

    Hello Anna,
      You can do it by using SAP Java Connector API's in the implementation of the Webdynpro application. You can refer to the sample programs for JCO at http://service.sap.com/connectors and download the latest version of SAP JCo in that install those files as per the installation document in the downloaded zip. The downloaded zip contains information about JCo APIs and sample programs.
    Hope this will solve your problem.
    Best Regards,
    Srinivas.

  • Regarding BAPI "BAPI_FUNCLOC_CHANGE" error

    Hi All,
    I have a requirement to update IFLOT table with new 3 custom fields which i have appened in the include CI_IFLOT.
    I have copied standard BAPI "BAPI_FUNCLOC_CHANGE" and created custom Function Module "Y_BAPI_FUNCLOC_CHANGE".
    Now when I activated the same, i got one error like "Type "ILOX_T_IFLOS" is unknown". I am not getting exactly why this error comes out, please tell me how to remove this error who have already worked on this.
    Thanks,
    Jay.

    hello,
    when you copied BAPI it did not copy global objects. Open BAPI via se37 choose attribute tab strip and double click on Program name SAPL( your BAPI's Function group name) you will find it on the right bottom corner and compare include in this program with the standard BAPI's program. Include missing data and you've got the solution.
    P.s. required structure is in top include-> type pool ILOX.
    best regards,
    dez_

  • Regarding BAPI for F-32

    Hi All,
    Can anybody Tell me Available Bapi for F-32( Clear Customer).
    Thanks in Advance,
    Jana

    Hi,
        Welcome To SDN!!.
    Please try one the below bapi.
    BAPI_ACC_PYMNTBLK_UPDATE_POST
    BAPI_ACC_BILLING_POST
    check this links:
    1) Re: BAPI for FB05
    2) Re: F-32 : Clearing Open Items
    Regards
    Kiran Sure

  • Regarding BAPI's

    Hi experts,
           i have one doubt about BAPI's. Here iam using SAP PLM system. I have to search the suitable BAPI to display the list of materials form SAP PLM system.Here the requirement is i have to give this BAPI to the XI people. There they wil use this BAPI to get the structure of the BAPI .
    Here my doubt is for SAP PLM system is there any separate BAPI's or we can use the normal BAPI existed in the sap system.Please let me know which BAPI i can use for this requirement.
    thanks & regards
    babu

    Hi Naga,
    you can try BAPI_MATERIAL_GETLIST this is standard bapi if it is excess to your requirement you need to create customized bapi  like Z_BAPI_MATERIAL_INFO  .
    if you give me your exact requirement i can provide fruitfull answer.  Thank you
    Thanks & Regards
    Ramana

  • Hi Experts..i have a problem regarding BAPI at the time of creating the structure.

    When i create the structure for particular field it will display the message "Field name VBELN does not agree with proposed name SD_DOC for BAPI table".
    Kindly help me.
    Regards,
    Abhishek K.

    Hello Raymond,
    I had problem of creating structure for BAPI Now it is Solved .
    And Yes i have created RFC Function Module.
    But i get some problem during Activation.
    Could you help me on this?
    Code:->
    FUNCTION ZBAPI_DEMO_SD.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(FM_VBELN) TYPE  VBAP-VBELN
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      ZITEMDATA STRUCTURE ZBAPI_TABLE OPTIONAL
      SELECT POSNR
             MATNR
             MATKL
             PSTYV
             MEINS FROM VBAP INTO TABLE ZITEMDATA
        WHERE VBELN = FM_VBELN.
    ENDFUNCTION.
    Error: ->"Report/Program statement Missing or Program type is I (Include)".
    Regards,
    Abhishek K.

  • UR: Regarding BAPI Wrapper

    Hi SDN.
    there is a standard bapi BAPI_PO_GETITEMSREL.
    I created an RFC ZBAPI_PO_GETITEMSREL.... But i want 2 know whether the RFC i created is said to be a BAPI Wrapper or not ???
    because actually i'm in need of BAPI Wrapper.
    here is the code ....
    FUNCTION ZBAPI_PO_GETITEMREL.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_REL_GROUP) LIKE  BAPIMMPARA-REL_GROUP OPTIONAL
    *"     VALUE(I_REL_CODE) LIKE  BAPIMMPARA-REL_CODE OPTIONAL
    *"     VALUE(I_ITEMS_FOR_RELEASE) LIKE  BAPIMMPARA-SELECTION DEFAULT
    *"       'X'
    *"  TABLES
    *"      ET_PO_HEADERS STRUCTURE  BAPIEKKOL
    *"      ET_PO_ITEMS STRUCTURE  BAPIEKPOC
    *"      RETURN STRUCTURE  BAPIRETURN OPTIONAL
    if I_ITEMS_FOR_RELEASE is initial.
    CALL FUNCTION 'BAPI_PO_GETITEMSREL'
    EXPORTING
       REL_GROUP               = I_REL_GROUP
       REL_CODE                = I_REL_CODE
       ITEMS_FOR_RELEASE       = ' '
      TABLES
        po_headers              = ET_PO_HEADERS
        po_items                = ET_PO_ITEMS
       RETURN                  = RETURN      .
    else.
    CALL FUNCTION 'BAPI_PO_GETITEMSREL'
    EXPORTING
       REL_GROUP               = I_REL_GROUP
       REL_CODE                = I_REL_CODE
       ITEMS_FOR_RELEASE       = 'X'
      TABLES
        po_headers              = ET_PO_HEADERS
        po_items                = ET_PO_ITEMS
       RETURN                  = RETURN      .
    ENDIF.
    ENDFUNCTION.

    Hi,
    to use it with MI you need to have:
    GETLIST
    and
    GETDETAIL
    warpper. Check the documentation in MDK to have a better understanding of the complete process. There is a good example for this and you can take the code from there and change it to your needs.
    The single code you send will not help you any further cause it is missing the clear structure between GETLIST and GETDETAIL - that is standard MI behaviour and necessary for correct results. Without this you even can not create any SyncBO in MEREP_SBUILDER.
    Hope this helps to bring you any further.
    Regards,
    Oliver

  • Regarding BAPI calls!

    Dear all,
    I am working in a project where we archive SAP data (outbound documents) and connect some of the documents for SAP R/3 applications from any other resource other than SAP(in bound documents).
    Ours is basically a third party tool which supports SAP R/3 documents as well as BW`s documents, certified by SAP.we maintain our own repository for that purpose.The meta data related to the documents is stored in SAP.our requirement now is to have that metadata available in our repository.we need to extract that meta data available in SAP.
    can any one know here in which table those data is available? all i know is we need to apply BAPI calls to extract that metadata from SAP to our repository.
    is there any method existing other than BAPI to extract that data?if yes what are those and how to go about that type?if not, how to call the BAPI`S from our repository?
    Thanks in advance
    Ravi

    Hello,
    You can find out the metadata for tables in table DD03L. I don't know about the BAPI to read these data.
    But, you can make one program which downloads the data into flat file. Later you can upload that file into your third party software.
    Regards,
    Naimesh

  • Regarding Bapi (BAPI_ACC_document_post)

    Hi,
    While executing  the Bapi
    The return message is showing that invoice document is successfully posted ,but I have checked in the database tables  like bseg,bkpf  is not updated.
    could please tell me what is the problem .
    Regards,
    Venu.

    Hai,
    Use Function Module BAPI_TRANSACTION_COMMIT by exporting parameter WAIT = 'X' after
    calling the BAPI.
    After that, you can call function module DEQUEUE_ALL to release the locks.

  • Regarding BAPI Info

    Hi @ ,
    I have a bapi which i am using in my interface .Now i need to know the tables associated with it and if there are any return parameters .I have chk se37 there is no export parameter present .So the problem ?
    Also i have to chk some test cases created previously by another user for that bapi,how to search for those test cases and verify the table entries
    thx in advance

    Hi
    Go through the doc of BAPI, it will be helpful to solve your issue
    BAPI-step by step
    http://www.sapgenie.com/abap/bapi/example.htm
    list of all bapis
    http://www.planetsap.com/LIST_ALL_BAPIs.htm
    for BAPI's
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sappoint.com/abap/bapiprg.pdf
    http://www.sappoint.com/abap/bapiactx.pdf
    http://www.sappoint.com/abap/bapilst.pdf
    http://www.sappoint.com/abap/bapiexer.pdf
    http://service.sap.com/ale
    http://service.sap.com/bapi
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.planetsap.com/Bapi_main_page.htm
    http://www.topxml.com/sap/sap_idoc_xml.asp
    http://www.sapdevelopment.co.uk/
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    u can check the below the material also
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Example Code
    U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
    U can find these parameters for a particular condition type in table KONV.
    *& Form saveTransactionJOCR
    text
    --> p1 text
    <-- p2 text
    FORM saveTransactionJOCR .
    data: salesdocument like BAPIVBELN-VBELN,
    order_header_inx like bapisdh1x,
    order_header_in like bapisdh1,
    return type standard table of bapiret2 with header line,
    conditions_in type standard table of bapicond with header line,
    conditions_inx type standard table of bapicondx with header line,
    logic_switch like BAPISDLS,
    step_nr like conditions_in-cond_st_no,
    item_nr like conditions_in-itm_number,
    cond_count like conditions_in-cond_count,
    cond_type like conditions_in-cond_type.
    salesdocument = wa_order_information-VBELN.
    LOGIC_SWITCH-COND_HANDL = 'X'.
    order_header_inx-updateflag = 'U'.
    conditions
    clear conditions_in[].
    clear conditions_inx[].
    clear: step_nr,
    item_nr,
    cond_count,
    cond_type.
    step_nr = '710'.
    item_nr = '000000'.
    cond_count = '01'.
    cond_type = 'ZCP2'.
    CONDITIONS_IN-ITM_NUMBER = item_nr.
    conditions_in-cond_st_no = step_nr.
    CONDITIONS_IN-COND_COUNT = cond_count.
    CONDITIONS_IN-COND_TYPE = cond_type.
    CONDITIONS_IN-COND_VALUE = 666.
    CONDITIONS_IN-CURRENCY = 'EUR'.
    append conditions_in.
    CONDITIONS_INX-ITM_NUMBER = item_nr.
    conditions_inx-cond_st_no = step_nr.
    CONDITIONS_INX-COND_COUNT = cond_count.
    CONDITIONS_INX-COND_TYPE = cond_type.
    CONDITIONS_INX-UPDATEFLAG = 'U'.
    CONDITIONS_INX-COND_VALUE = 'X'.
    CONDITIONS_INX-CURRENCY = 'X'.
    append conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = salesdocument
    ORDER_HEADER_IN = order_header_in
    ORDER_HEADER_INX = order_header_inx
    LOGIC_SWITCH = logic_switch
    TABLES
    RETURN = return
    CONDITIONS_IN = conditions_in
    CONDITIONS_INX = conditions_inx
    if return-type ne 'E'.
    commit work and wait.
    endif.
    ENDFORM. " saveTransactionJOCR
    Bdc to Bapi
    The steps to be followed are :
    1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
    [for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
    2. Create a Z program and call the BAPi (same as a Funtion module call).
    2. Now, if you see this BAPi, it has
    -> Importing structures.
    eg: SALESDOCUMENT: this will take the Sales order header data as input.
    -> Tables parameters:
    eg: ORDER_ITEM_IN: this will take the line item data as input.
    Note :
    Only specify fields that should be changed
    Select these fields by entering an X in the checkboxes
    Enter a U in the UPDATEFLAG field
    Always specify key fields when changing the data, including in the checkboxes
    The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
    Maintain quantities and dates in the schedule line data
    Possible UPDATEFLAGS:
    U = change
    D = delete
    I = add
    Example
    1. Delete the whole order
    2. Delete order items
    3. Change the order
    4. Change the configuration
    Notes
    1. Minimum entry:
    You must enter the order number in the SALESDOCUMENT structure.
    You must always enter key fields for changes.
    You must always specify the update indicator in the ORDER_HEADER_INX.
    2. Commit control:
    The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
    For further details... refer to the Function Module documentation for the BAPi.
    Bapi to VB(Visual Basic)
    Long back I had used the following flow structure to acheive the same.
    Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
    my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
    You need to have com4abap.exe
    If com4abap is installed you will find it in sapgui installatin directory , C:\Program Files\SAPpc\sapgui\RFCSDK\com4abap.
    else refer OSS note 419822 for installation of com4abap
    after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
    for setting up com4abap and rfc destination please refer to the documentation for com4abap.
    Invoke NEW DCOM session
    call function 'BEGIN_COM_SESSION'
    exporting
    service_dest = service_dest "(this will be a RFC destination created in SM59)
    importing
    worker_dest = worker_dest
    exceptions
    connect_to_dcom_service_failed = 1
    connect_to_dcom_worker_failed = 2
    others = 3.
    call function 'create_com_instance' destination worker_dest
    exporting
    clsid = g_c_clsid
    typelib = g_c_typelib
    importing
    instid = g_f_oid
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    call function 'com_invoke' destination worker_dest
    exporting
    %instid = g_f_oid
    %method = 'UpdatePDF'
    sntemp = g_v_const_filent
    snsysid = sy-sysid
    snflag = 'N'
    tables
    rssaptable = g_t_pdfdetail1
    %return = g_t_pdfdetail1 "t_test
    exceptions
    communication_failure = 1 message g_f_msg
    system_failure = 2 message g_f_msg
    invalid_instance_id = 3
    others = 4.
    then close the com session , using
    FM delete_com_instance
    FM END_COM_SESSION
    reward if sueful
    regards,
    Anji

  • Regarding BAPI Return Table

    Hi all,
    I am having an issues, when the user enters the correct value into an input field then i am getting the output properly. But if he enters any wrong value a message is populated into the BAPI return table. So how do I check if the BAPI return table is empty or not. If it is empty then it has to open the output table and if it is not empty it has to show the error message as an pop-up or table format.
    Please reply, points will be rewarded.
    Thanks & Regards,
    M.Ramana Murthy

    Hi Ramana,
    If you want to capture the message returning from the BAPI which you are using then do the following:
    1.> Drag the line from the BAPI return port and link it to a form or to a table.
    2.> Then go to the form/table click the UIelement and in properties of that assign the default value which you want to display. It may be a message coming out of the BAPI.Through this way you can capture the values coming out of the BAPI
    Regards,
    Nutan

  • Regarding BAPI for Creat Class Hierarchy

    Hi ,
    Urgently i need a BAPI for to create Class_Hierarchy and also need what are the parameters to pass for that BAPI .
    Please any body help out this is urgent.
    thanks in advance,
    krishna.

    Hi,
    The relavant BAPI is BAPI_OBJCL_CREATE.
    You can read the characteristics by using BAPI: BAPI_OBJCL_GETDETAIL
    Plz check other BAPIs in FuGr: CLBPA which might help you. You can find FM Documentation for most of the BAPIs in this FuGr.
    If this is a one time load, I suggest you to take up this task by LSMW:
    Object               0130   Classification
    Method               0001   Batch input  
    Program name         RCCLBI02            
    Program type         B   Batch input    
    Hope this helps.
    Best Regards, Murugesh AS

  • Regarding BAPI output

    Hi,
       In my application, after giving input "SelectedRole" in one view and clicking submit button, it calls the following method which is in the custom controller.
    public void executeZbapi_Roles_Tcodes_Display_Input( )
        //@@begin executeZbapi_Roles_Tcodes_Display_Input()
         try {
              Zbapi_Roles_Tcodes_Display_Input bapiInput = new Zbapi_Roles_Tcodes_Display_Input();
              wdContext.nodeZbapi_Roles_Tcodes_Display_Input().bind(bapiInput);
              bapiInput.setRole(wdContext.currentContextElement().getSelectedRole());
                        wdContext
                             .currentZbapi_Roles_Tcodes_Display_InputElement()
                             .modelObject()
                             .execute();
                        wdContext.nodeOutput().invalidate();
                   } catch (WDDynamicRFCExecuteException ce) {
                        IWDMessageManager manager = wdComponentAPI.getMessageManager();
                        manager.reportException(ce.getMessage(), false);
        //@@end
    It executes a bapi and retrieves a table which is mapped to a table in another view in webdynpro.
      I am able to get the output for the corresponding input. But what the problem is when I go back to the first view and click submit again with the same input, the table contains all the values twice. Likewise how many times I am submitting, that many times its getting displayed in the table. Actually its getting added to the same table. What I needed is the table should get cleared everytime and then it should display the required output.
    How can I do this??
    Regards,
    Kalai

    Hi Bharath,
       I have done like what u said.  But still the same condition. I dint understand ur point clearly. Also I dint understand the concept of invalidating the Model Node. Can u explain me in detail??
        This is what I did.
    <b>(In FirstView)</b>
    wdThis
                                       .wdGetSampleModelCust0Controller()
                                       .executeZbapi_Roles_Tcodes_Display_Input();
                                  wdThis.wdFirePlugToSecondView();
    <b>(In Custom Controller)</b>
    public void executeZbapi_Roles_Tcodes_Display_Input( )
        //@@begin executeZbapi_Roles_Tcodes_Display_Input()
         try {
              Zbapi_Roles_Tcodes_Display_Input bapiInput = new Zbapi_Roles_Tcodes_Display_Input();
              wdContext.nodeZbapi_Roles_Tcodes_Display_Input().bind(bapiInput);
              bapiInput.setRole(wdContext.currentContextElement().getSelectedRole().toUpperCase());
                        wdContext
                             .currentZbapi_Roles_Tcodes_Display_InputElement()
                             .modelObject()
                             .execute();
                   } catch (WDDynamicRFCExecuteException ce) {
                        IWDMessageManager manager = wdComponentAPI.getMessageManager();
                        manager.reportException(ce.getMessage(), false);
        //@@end
    <b>(In Second View)</b>
    public void onActionBackToR3View(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    Zbapi_Roles_Tcodes_Display_Input bapiInput = new Zbapi_Roles_Tcodes_Display_Input();
                   wdContext.nodeZbapi_Roles_Tcodes_Display_Input1().bind(bapiInput);
                wdContext.nodeZbapi_Roles_Tcodes_Display_Input1().invalidate();
              wdThis.wdFirePlugToFirstView();
    Can u explain me in detail: why we have to bind the node to a new BAPI object?

Maybe you are looking for