Creating GetList Bapi Wrapper for Sales Order

Hi All,
I am not at all into CRM, but there is some problem I have which is related to it.
In the Sales-TeleSales transactions, I create a sales Order.
Now there is much data that is there which is linked to this Sales Order like
1)     Telesales
2)     Item
3)     Sold-to-party
4)     Product
5)     Quantity
6)     Req-del-date
7)     Currency
8)     Region
9)     Country
10)     Net Value
11)     Discount
12)     Tax amount
13)     Gross Value
14)     Partner
I need to create a BAPI Wrapper to get all the Header and Detail data.
I am thinking of finding a BAPI or a Function Module which does this job and calling it in my BAPI Wrapper.
Now I want you people to tell me the Appropriate BAPIs or FMs which will do this job for me.
I need almost all these fields to be returned by my Bapi Wrapper.
Please ask for Clarifications...
Lookin forward to responses...
Ankur

Hi Ankur,
       You can Call the FM : CRM_ORDER_MAINTAIN within your BAPI wrapper.
For testing purpose there is a Standard Report on this FM , Report name : 'CRM_TEST_ORDER_MAINTAIN'.
Hope this will be helpful to you
Regards,
Anand.

Similar Messages

  • To create BAPI Wrapper for Sales Order Creation

    Hi Experts,
    I'm working upon MI 7.1 to create mobile application for creation of sales order.
    I've to create Sales Order BAPI Wrapper (Getlist, Get Detail & Create) using Standard BAPI's (BAPI_SALESORDER_GETLIST & BAPI_SALESORDER_CREATEFROMDAT2).
    Kindly guide me for how to proceed with the above. Which all other BAPI's do I require except above?
    PS: I was trying to call standard BAPI's but while executing the BAPI Wrapper it asks about Customer No. & Sales Org. then only I'll get the output.
    my requirement is I should get list of all the sales order's existing in the Back-end, once I execute the BAPI Wrapper.
    Romi

    Hi,
    if it comes to bapis on the backend, there are not so many changes from MI7.0 to MI7.1 as in the UI for example. So you still need the backend adapters like GETLIST/GETDETAIL/CREATE as they where necessary in 7.0.
    If you need an example on how these should look like - do you have a full blown backend available? Have a look if you can find the following BADIS in SE37 in the backend: MAM30_050_GETLIST. If you can find this one, have a look how it is working. That one should help you to get an idea on how the replication is working and how the complete stuff works. The create should be straight forward development then.
    You furthermore can have a look into the URL mentioned aboveand as well in the complete MI7.0 dokumentation if you take it just to get a general idea on how the stuff works. But the URL mentioned above should be enough in a normal case.
    Regards,
    Oliver

  • Function module which uses both BAPI's for sales order create and change

    Please name the function module which uses both BAPI's for sales order create and change.
    BAPI_SALESORDER_CREATEFORMDAT2
    BAPI_SALESORDERCHANGE

    Yup.
    you must write a piece of code for this.
    with if else condition.first check if SO is exsist than use second FM to change it else create new SO from first FM.
    logic somethig like this.
    Amit.

  • BAPI/RFC for Sales Order or Warehouse Order that retrives VBAK,VBAP,VBEP

    Hi,
       Is there any BAPI/RFC for Sales Order or Warehouse Order that retrives VBAK,VBAP,VBEP and VBPA tables for specified inputs.
       The BAPI or RFC should return the Sales Order details with tables VBAK,VBAP,VBEP and VBPA.
       Rewards if useful.
    Thanks,
    Mich

    Try creating an RFC calling FM: SD_SALES_DOCUMENT_PREFETCH with required details for Header, Item, Schedule and Partners.
    Below code can give you idea in handling the FM.
    PARAMETERS: p_vbeln TYPE vbeln_vl OBLIGATORY.
    CONSTANTS: c_x TYPE char01 VALUE 'X'.
    DATA: st_view TYPE order_view,
          i_vbak_key TYPE TABLE OF sales_key,
          i_vbak TYPE TABLE OF vbak,
          i_vbap TYPE TABLE OF vbapvb,
          i_vbep TYPE TABLE OF vbepvb,
          i_vbpa TYPE TABLE OF vbpavb.
    START-OF-SELECTION.
      MOVE c_x TO : st_view-header,
                    st_view-item,
                    st_view-sdschedule,
                    st_view-partner.
      APPEND p_vbeln TO i_vbak_key.
      CALL FUNCTION 'SD_SALES_DOCUMENT_PREFETCH'
        EXPORTING
          i_sales_view  = st_view
          i_memory_read = 'A'
        TABLES
          i_vbak_keytab = i_vbak_key " List of Sales Orders to extract
          fxvbak        = i_vbak     " Header
          fxvbap        = i_vbap     " Item
          fxvbep        = i_vbep     " Schedule Lines
          fxvbpa        = i_vbpa.    " Partners

  • How to create a daily report for sales order

    hi
    how to create a daily report for sales order. what fields it must consists of. what are the tables it need?

    Hi
    You have to use the sales order tables VBAK,VBAP and VBEP
    So keep date field on selection screen
    and treat this date as Order creation data audat field in VBAK.
    based on this fetch the data from VBAK and VBAP  with the following fields like
    VBELN, KUNNR,NETWR,POSNR, MATNR,ARKTX,KWMENG,WAERS  etc and display in the report
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • GETLIST BAPI Wrapper for Purchase Requisiton

    HI All,
    I want to know the GETLIST BAPI Wrapper for Purchase Requisition in ECC 6.0 . I am able to find GETDETAIL but not GETLIST.
    It would be nice if anyone could help me out in this.
    Regards,
    Madhu.
    Edited by: madhu kv on Jul 8, 2008 10:53 AM

    In that case you could just write your own custom function module to do it.  All you need to do is write a simple select statement to return a table of document numbers.  It shouldn't take more than an hour to have it all up and running.  You could add a parameter to the interface so that it either returns just a list of document numbers or if the parameter is set, it calls GET_DETAIL for each document and returns the full data.
    Good luck

  • FM/BAPI/Method for Sales Order Costing

    Hi,
    I need the FM/BAPI/Method for Sales Order Costing.
    Which is calculating at run time while process of Sales Order Costing
    Can any one please help me out.
    Thanks
    Chinni
    Edited by: Tirumula Rao Chinni on Mar 10, 2010 3:04 PM
    Edited by: Tirumula Rao Chinni on Mar 10, 2010 3:35 PM

    Vinraaj, thank you very much for your advice and the time you've spent for the ask.
    I am searching for whether there is any SAP offered FM. Therefore, I did not think to check the background (code side) of the process by debugging.
    There is not any documentation about the FM that you have offered, in the system.
    So , I can not be sure about the usage of it, too.
    Thank you very much.

  • How to create a sap script for sales order header items?

    Hi friends i am totally new to scripts i have got a task where i have to create a sap script for sales order header items details, the clue that i have got is to create using MEDRUCK but i have got no idea please can any body help me with this task with any sample sap script?
    Points will be rwwared with out fail Thks in advance.

    Hi,
    The Standard Form NAme is RVORDER01
    Regards
    Sandipan

  • Create and Change functionality for Sales order

    Hii All,
                Can any one please suggest me any Standard program or BAPI or IDOC for Sales order, it should cover create as well as change fuctionality of Sales order.
    this is very urgent to me.
    Suitable Answer will be Rewarded.
    Thankyou,
    Shobha.

    For change you can use:
    BAPI_SALESORDER_CHANGE         Sales order: Change Sales Order
    For create you have the following choices:
    BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
    BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
    BAPI_SALESDOCU_CREATEFROMDATA with business object 'BUS2032'
    The difference between the create ones is the functionality you get e.g. create_from_data2 is the 'most powerful' but you also have to provide the most data. It just depends on what you want it to do.
    In terms of IDOCS:
    message type:
    SALESORDER_CREATEFROMDAT201 or
    SALESORDER_CREATEFROMDAT202 or
    ORDERS05
    Hope that helps,
    Michael
    Here is an example we use, you might want to populate additional fields or leave fields out in case you want different data to be transferred to the IDOC - however some fields are mandatory.
    create the order header structure
      ls_header-doc_type   = ls_screen-order_type.
      ls_header-sales_org  = gc_vkorg_aa01.
      ls_header-distr_chan = gc_distr_aa.
      ls_header-division   = gc_divis_aa.
      ls_header-purch_no   = ls_screen-po_num.
      ls_header-po_method  = ls_screen-po_source.
      ls_header-ship_cond  = ls_screen-ship_cond.
    create partner input table (sold to)
      ls_partner-partn_role = gc_role_sold.
      ls_partner-partn_numb = ls_screen-sold_to.
      APPEND ls_partner TO lt_partner.
    create partner input table (ship to)
      ls_partner-partn_role = gc_role_ship.
      ls_partner-partn_numb = ls_screen-ship_to.
      APPEND ls_partner TO lt_partner.
    items are added by looping at a table
        ls_item-material = <fs_upload>-matnr.
        ls_item-req_qty  = <fs_upload>-quantity.
      process the quantity, it needs to be three decimals, because it
      will be moved into a string in the BAPI and divided by 1000 before
      it is moved back into a number field (1.500 => 001500 => 1.5)
        ls_item-req_qty = ls_item-req_qty * 1000.
      truncate remaining decimal places if exist (1.2525 => 1252.5 => 1252 => 1.252)
        ls_item-req_qty = trunc( ls_item-req_qty ).
        price is taken from the file
          ls_item-cond_type = gc_cond_so_upld_price.
          ls_item-cond_val1 = <fs_upload>-price.
        condition one (price) is multiplied by 10 in the BAPI
          ls_item-cond_val1 = ls_item-cond_val1 / 10.
        no discount
          ls_item-cd_type2   = gc_cond_so_upld_disc.
          ls_item-cd_value2  = 0.
        ls_item-item_categ = ls_screen-item_cat.
          APPEND ls_item TO lt_item.
    then BAPI is called
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA'
        EXPORTING
          order_header_in           = ls_header
          business_object           = gc_bus_obj
        IMPORTING
          SALESDOCUMENT             = lv_vbeln
          RETURN                    = ls_return
        tables
          order_items_in            = lt_item
          order_partners            = lt_partner.
      IF ls_return-type NE gc_msgty_error AND
         ls_return-type NE gc_msgty_abend.
      No errors where found
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ELSE.
      There was an error or abend
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.

  • To create BAPI Wrappers for Sales Order Creation

    Hi Experts,
    I'm working upon MI 7.1 to create mobile application for creation of sales order.
    I've to create Sales Order BAPI Wrapper (Getlist, Get Detail & Create) using Standard BAPI's (BAPI_SALESORDER_GETLIST & BAPI_SALESORDER_CREATEFROMDAT2).
    Kindly guide me for how to proceed with the above. Which all other BAPI's do I require except above?
    PS: I was trying to call standard BAPI's but while executing the BAPI Wrapper it asks about Customer No. & Sales Org. then only I'll get the output.
    my requirement is I should get list of all the sales order's existing in the Back-end, once I execute the BAPI Wrapper.
    Romi

    Hi,
    if it comes to bapis on the backend, there are not so many changes from MI7.0 to MI7.1 as in the UI for example. So you still need the backend adapters like GETLIST/GETDETAIL/CREATE as they where necessary in 7.0.
    If you need an example on how these should look like - do you have a full blown backend available? Have a look if you can find the following BADIS in SE37 in the backend: MAM30_050_GETLIST. If you can find this one, have a look how it is working. That one should help you to get an idea on how the replication is working and how the complete stuff works. The create should be straight forward development then.
    You furthermore can have a look into the URL mentioned aboveand as well in the complete MI7.0 dokumentation if you take it just to get a general idea on how the stuff works. But the URL mentioned above should be enough in a normal case.
    Regards,
    Oliver

  • Creating Billing Plan data for sales order using BAPI

    Hello,
    Someone ones if there is any way to create a sales order (BAPI) and then create a billing plan (by means of another BAPI)?
    Or is there any way to create both at the same time?
    Kind Regards.

    Hi David and Nisha here is the code for creating sales order with bapi
    *& Report  YOBJ_BAPI_SALESORDER
    *& REPORT : CREATING SALES ORDER USING STANDARD BAPI
    *& AUTHOR : S.PAVAN KUMAR INUMARTHY
    REPORT  YOBJ_BAPI_SALESORDER.
    DATA : ORDER_HEADER_IN LIKE STANDARD TABLE OF BAPISDHD1 WITH HEADER LINE.
    DATA : ORDER_ITEMS_IN LIKE STANDARD TABLE OF BAPISDITM WITH HEADER LINE.
    DATA : ORDER_PARTNERS LIKE STANDARD TABLE OF BAPIPARNR WITH HEADER LINE.
    DATA : RETURN TYPE STANDARD TABLE OF BAPIRET2 WITH HEADER LINE.
    DATA : SALESDOCUMENT LIKE BAPIVBELN-VBELN.
    *APPENDING VALUES FOR HEADER.
    ORDER_HEADER_IN-DOC_TYPE = 'TA'.
    ORDER_HEADER_IN-SALES_ORG = '1000'.
    ORDER_HEADER_IN-DISTR_CHAN = '10'.
    ORDER_HEADER_IN-DIVISION = '00'.
    ORDER_HEADER_IN-SALES_GRP = '130'.
    ORDER_HEADER_IN-SALES_OFF = '1030'.
    APPEND ORDER_HEADER_IN.
    *APPENDING VALUES FOR ITEM
    ORDER_ITEMS_IN-MATERIAL = 'M-13'.
    ORDER_ITEMS_IN-PLANT = '1000'.
    ORDER_ITEMS_IN-SALES_UNIT = 'ST'.
    ORDER_ITEMS_IN-DIVISION = '07'.
    ORDER_ITEMS_IN-GROSS_WGHT = '28000'.
    ORDER_ITEMS_IN-NET_WEIGHT = '28000'.
    ORDER_ITEMS_IN-UNTOF_WGHT = 'KG'.
    ORDER_ITEMS_IN-VOLUME = '0.780'.
    ORDER_ITEMS_IN-VOLUNIT = 'M3'.
    APPEND ORDER_ITEMS_IN.
    *APPENDING VALUES FOR PARTNER
    ORDER_PARTNERS-PARTN_ROLE = 'AG'.
    ORDER_PARTNERS-PARTN_NUMB = '0000001000'.
    ORDER_PARTNERS-COUNTRY = 'DE'.
    ORDER_PARTNERS-TRANSPZONE = 'D000080000'.
    APPEND ORDER_PARTNERS.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
    *   SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = ORDER_HEADER_IN
    *   ORDER_HEADER_INX              =
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   TESTRUN                       =
    *   CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = SALESDOCUMENT
      TABLES
       RETURN                         = RETURN
       ORDER_ITEMS_IN                 = ORDER_ITEMS_IN
    *   ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = ORDER_PARTNERS
    *   ORDER_SCHEDULES_IN            =
    *   ORDER_SCHEDULES_INX           =
    *   ORDER_CONDITIONS_IN           =
    *   ORDER_CONDITIONS_INX          =
    *   ORDER_CFGS_REF                =
    *   ORDER_CFGS_INST               =
    *   ORDER_CFGS_PART_OF            =
    *   ORDER_CFGS_VALUE              =
    *   ORDER_CFGS_BLOB               =
    *   ORDER_CFGS_VK                 =
    *   ORDER_CFGS_REFINST            =
    *   ORDER_CCARD                   =
    *   ORDER_TEXT                    =
    *   ORDER_KEYS                    =
    *   EXTENSIONIN                   =
    *   PARTNERADDRESSES              =
              IF SY-SUBRC = 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *           EXPORTING
    *             WAIT          =
    *           IMPORTING
    *             RETURN        =
               ENDIF.
    WRITE : 'SALES ORDER IS :', SALESDOCUMENT.
    I have tested and go it.
    please go through it

  • Creating Billing Plan data for sales order using BAPI_SALESORDER_CREATEFROM

    Hi All,
    We are using BAPI_SALESORDER_CREATEFROMDAT2 to create the sales order.We are unable to get the fields for billing plan tab in this BAPI.
    Kindly let me know the fileds in BAPI that corresponds to the fileds of billing plan in sales order.
    Thanks in Advance,
    Kiran I.

    Hi kiran
    hi Dhanapal
    i ahve the same problem which u posted..
    My scenarion is to create billing plan while creation of order using the BAPI_SALESORDER_CREATEFROMDAT2 but could not find any structure to pass billing plan details
    pls can u let me know if u found any solution for this if so can u send me detailed mail..
    i want to populate in both way header level and item level (by removing check header plan in the billing plan tab)
    Pls let me know ASAP..
    Thanks
    anil

  • Is there any BAPI available for sales order creation with reference?

    Hi Experts,
    My requirement is to create sales order with reference for order type.
    Now my billing document number already contains the two items
    one is correct and another is zero quantity.
    I want to create order with reference of billing document but not with zero quantity item.
    Which BAPI I should use and what to pass to ignore zero quantity item?
    Regards,
    RH

    Hi Ronny,
    Try using BAPI_SALESORDER_CREATEFROMDAT2
    Regards,
    Shraddha

  • Function Module to create AFS Outbound delivery for sales order

    Guys,
    I am looking for a function module to create deliveries for a sales order IN IS-AFS.
    I cannot make BAPI_DELIVERYPROCESSING_EXEC work. Also, if I use the IDOC type /AFS/DELVRY03 via message type WHSCON and function module IDOC_INPUT_DELVRY it doesn' work either.
    Does anyone know which function module I could use? I need to select specific AFS schedule lines though, but at this point I am not able to make any work.
    Thanks
    Leonardo

    This will not help .
    Edited by: Amit Khare on Aug 7, 2008 3:49 AM

  • Problem creating CR doc type for sales order

    Hello Gurus:
       I have been trying to use a bapi to create a sales order. So far I have tested
    BAPI_SALESORDER_CREATEFROMDATA
    BAPI_SALESORDER_CREATEFROMDAT1
    BAPI_SALESORDER_CREATEFROMDAT2
    All of them works fine with SO type, But I am trying to create credit request. And they all return with error message saying the doc_type is invalid or not allowed. So far I have only found a function module SD_Salesdocument_create. But is there any standard BAPI that currently calling this? To make my life a little easier!
    Cheers _

    Hi
    Check these BAPI's
    BAPI_SALESDOCU_CREATEFROMDATA1
    BAPI_SALESDOCU_CREATEWITHDIA  
    Regards
    Anji

Maybe you are looking for