BAPI for VK11 ?

Hi,
Can anybody tell me the BAPI name with simple coding to update Condition types for different material, plant, region etc for tcode VK11.
thanks
n kumar

HI
VK11,
vk11 bapi
Regards
Pavan

Similar Messages

  • BAPI for VK11,VK12,MEK1,MEK2

    Hi,
    1) Is there a BAPI or standard function module for MEK1 and MEK2?
    2) I searched and found for VK11 and VK12 we have the following function modules
    BAPI_PRICE_CONDITIONS
    RV_KONDITION_SICHERN
    RV_KONDITION_SICHERN_V13A
    Please share if you has used the above

    Got it to work. With the sequence :
      <b>1.</b> RV_CONDITION_COPY
      <b>2.</b> RV_CONDITION_SAVE
      <b>3.</b> RV_CONDITION_RESET
      <b>4.</b> commit
    * At least the key fields of the conditiontable
    * (here 800) must be filled in structure ls_komg.
    ls_komg-vbeln = '1234567890'.  " document number
    ls_komg-posnr = '000010'.      " item number
    clear wt_komv.
    ls_komv-kappl = 'V '.        " Application V = Sales
    ls_komv-kschl = lc_kschl.    " Condition type
    ls_komv-waers = 'EUR'.       " Currency
    ls_komv-kmein = 'ST'.        " Unit of measurement
    ls_komv-kpein = '1'. 
    ls_komv-krech = 'M'.         " calculation type;
                                  "M = Quantity - monthy price
    ls_komv-kbetr = '1234.56'.   " new condition value
    append ls_komv to lt_komv.
    call function 'RV_CONDITION_COPY'
      exporting
        application              = 'V'
        condition_table          = '800'      " cond. table
        condition_type           = lc_kschl   " cond. type
        date_from                = '20061101' " valid on
        date_to                  = '20061130' " valid to
        enqueue                  = 'X'        " lock entry
        i_komk                   = ls_komk
        i_komp                   = ls_komp
        key_fields               = ls_komg    " key fields
        maintain_mode            = 'A'        " A= create
                                              " B= change,
                                              " C= display
                                              " D= create
      with reference
        no_authority_check       = 'X'
        keep_old_records         = 'X'
        overlap_confirmed        = 'X'
        no_db_update             = space
      importing
        e_komk                   = ls_komk
        e_komp                   = ls_komp
        new_record               = lv_new_record
      tables
        copy_records             = lt_komv
      exceptions
    call function 'RV_CONDITION_SAVE'.
    call function 'RV_CONDITION_RESET'.
    * necessary to write data
    commit work.
    Check data with transaction VK12
    Thank you for your support
    Thomas

  • Bapi for VK11 & VK12

    i have created a BDC program for uploading data into VK11 & VK12 .what it does that it compares the valid from and valid to dates from the flat files
    and if they already exist then for that condiotn type it goes to vk 12 and changes the prices and scalling quantity according to the falt file
    and if the date range is not present then it oes to VK11 and creates the same from the flat file
    now i want a bapi that works the same manner..
    if any body can hel;p me
    thanks in advance

    I am using the RV_condition_copy function the way it is described in this post, I am able to update the date but not the price in Vk12 / vk13 . I am using option D for maintain_mode (create with reference) - > this is essentially what I want to do, as we already ahve the pricing in vk13, we want to change it for year 2008.
    Please advise what I must be doing wrong. I do not get any errors while running the following code. Also I am doing commit. Thanks.
    Pranav
    Do I have to pass any values to I_komk I_komp, i do not have anything to pass.??!$#?
    ls_komg-kunnr = '0001000008'.  " Cust number
    ls_komg-matnr = 'PP500P3'.      " Mat number
    ls_komg-VKORG = 'PPC1'.
    ls_komg-vtweg = 'BB'.
    clear: Lt_komv,LS_KOMV.
    ls_komv-kappl = 'V '.        " Application V = Sales
    ls_komv-kschl = 'PR00'.    " Condition type
    ls_komv-waers = 'USD'.       " Currency
    ls_komv-kmein = 'EA'.        " Unit of measurement
    ls_komv-kpein = '100'.
    ls_komv-krech = 'C'.         " calculation type;
                                  "M = Quantity - monthy price
    LS_KOMV-KAWRT = '251.00'.
    ls_komv-kbetr = '121.50'.   " new condition value
    *LS_KOMV-KWERT_K = '251.10'.
    *LS_KOMV-KNUMV ='0000008911'
    append ls_komv to lt_komv.
    CLEAR LT_KOMV.
    call function 'RV_CONDITION_COPY'
      exporting
        application              = 'V'
        condition_table          = '005'      " cond. table
        condition_type           = 'PR00'   " cond. type
        date_from                = '20070108' " valid on
        date_to                  = '99991231' " valid to
        enqueue                  = 'X'        " lock entry
       i_komk                   = ls_komk
       i_komp                   = ls_komp
        key_fields               = ls_komg    " key fields
        maintain_mode            = 'D'        " A= create
                                              " B= change,
                                              " C= display
                                              " D= create with reference
    with reference
        no_authority_check       = 'X'
        keep_old_records         = 'X'
        overlap_confirmed        = 'X'
        no_db_update             = space
      importing
       e_komk                   = ls_komk
    e_komp                   = ls_komp
        new_record               = lv_new_record
      tables
        copy_records             = lS_komv
             EXCEPTIONS
                ENQUEUE_ON_RECORD        = 1
                INVALID_APPLICATION      = 2
                INVALID_CONDITION_NUMBER = 3
                INVALID_CONDITION_TYPE   = 4
                NO_SELECTION             = 5
                TABLE_NOT_VALID          = 6
                NO_AUTHORITY_EKORG       = 7
                NO_AUTHORITY_KSCHL       = 8.
    call function 'RV_CONDITION_SAVE'.
    call function 'RV_CONDITION_RESET'.
    necessary to write data
    commit work.
    Message was edited by:
            pranav kulkarni

  • BAPI for T.Code: VK11

    How to find the BAPI for transfering data to VK11 T.code.
    Sunil.

    Refer this one -
    BAPI_PRICES_CONDITIONS
    Sample code -
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Regards,
    Amit
    Reward all helpful replies.

  • 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

  • Bdc for vk11/vk12

    hi!
    can anybody plz tell  me how to do bdc for vk11 and vk12.
    the scene is that i have zpogram which displays the data and from there i have to add one button and whenever that button is triggred bdc had to be performed for vk11 and vk12 only for those fields which are diaplayed by my z program.
    kindly help me out.
    regards
    anjali

    Hi Anjali
    It is not advicable to create BDC for transactions like VK11, MEK1 ... which we use to create condition records. The reason is for each condition type, the options we see might vary when ever there is change in access sequences and their precedence. So if we create BDC, our program needs to modified everytime there is change in the access sequences and condition tables.
    I would recommed you to either use the program that i have provided or use some BAPI's to upload/change condition records.
    As you are saying, you have the data in your internal table. Download the data to a file in the format RV14BTCI needs and SUBMIT the program.
    For understanding on the structure for this program, use transaction SXDB.
    Kind Regards
    Eswar

  • BAPI for Purchasing Contract

    Hi  All,
    Can anybody suggest some BAPI for uploading pricing conditions in a purchasing contract.
    Thanks,
    Arun

    Hi Arun,
      refer to the link for BAPI's:
    http://www.sapbapi.com/bapi-list/
      Also refer to the link:
    Re: VK11,
    With luck,
    Pritam.

  • Data load for VK11

    Hi All,
    can anyone suggest me about data load for VK11, I mean which method will be easier?
    appreciate if you can send me the developed custom code
    thanks.

    Hi Kiran,
    You can also use BAPI BAPI_PRICES_CONDITIONS.
    Please check this link for sample codes.
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Hope this will help.
    Regards,
    Ferry Lianto

  • BAPI for Open production orders

    Hi All,
    Any BAPI for open production orders?.... Using BAPI i want to upload open production orders informatiomations.... Please help
    Thanks & Regards
    Santhosh

    Hi,
       Please check the following BAPI,
    Goto BAPI tcode, select hierarchical tab
      Production orders,ProductionOrder ,ProdOrdConfirmation , RCVPRORDCF and check the BAPIs

  • Bapi for open PO

    Hi!
    Can anyone let me know where to find the bapi for open po and how to use it in my report program.
    Thanks in advance.
    Note: Mr Anji Reddy vangala has answered me for which iam very much thankful to him, but i need to know about the concerned bapi.
    Regards,
    Parwez.

    Hi,
    Refer the sample code below which creats PO using BAPI_PO_CREATE1.
    Hope this helps your querry.
    *& Report  YDM_PO_CREATE                                               *
    REPORT  ydm_po_create.
    *-- Input File Declaration
    TYPES: BEGIN OF ty_input_file,
           column1 TYPE char50,
           column2 TYPE char50,
           column3 TYPE char50,
           column4 TYPE char50,
           column5 TYPE char50,
           column6 TYPE char50,
           column7 TYPE char50,
           column8 TYPE char50,
           column9 TYPE char50,
           column10 TYPE char50,
           column11 TYPE char50,
           column12 TYPE char50,
           column13 TYPE char50,
           column14 TYPE char50,
           column15 TYPE char50,
           column16 TYPE char50,
           column17 TYPE char50,
           column18 TYPE char50,
    END OF ty_input_file.
    DATA: i_input_file  TYPE STANDARD TABLE OF ty_input_file,
          wa_input_file TYPE ty_input_file.
    CONSTANTS: c_path     TYPE char20 VALUE 'C:\',
               c_mask     TYPE char9  VALUE ',*.*,*.*.',
               c_mode     TYPE char1  VALUE 'O',
               c_filetype TYPE char10 VALUE 'ASC',
               c_x        TYPE char01 VALUE 'X'.
    PARAMETERS : p_fname   LIKE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    *-- Browse Presentation Server
      PERFORM f4_presentation_file.
    START-OF-SELECTION..
    *-- Read presentation server file
      PERFORM f1003_upload_file.
      IF NOT i_input_file[] IS INITIAL.
        PERFORM split_data.
      ENDIF.
    *&                  Form  f4_presentation_file
    *&                F4 Help for presentation server
    FORM f4_presentation_file .
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_path         = c_path
          mask             = c_mask
          mode             = c_mode
          title            = text-001
        IMPORTING
          filename         = p_fname
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " f4_presentation_file
    *&                      Form  f1003_upload_file
    *&                         Upload File
    FORM f1003_upload_file .
      DATA: lcl_filename TYPE string.
      lcl_filename = p_fname.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = lcl_filename
          filetype                = c_filetype
          has_field_separator     = c_x
        TABLES
          data_tab                = i_input_file
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
    ENDFORM.                    " f1003_upload_file
    *&      Form  split_data
          Collect data for creating Purchase Order
    FORM split_data .
      DATA: i_poitem        TYPE STANDARD TABLE OF bapimepoitem,
            i_poitemx       TYPE STANDARD TABLE OF bapimepoitemx,
            i_poitem_sch    TYPE STANDARD TABLE OF bapimeposchedule,
            i_poitem_schx   TYPE STANDARD TABLE OF bapimeposchedulx,
            i_acct_***      TYPE STANDARD TABLE OF bapimepoaccount,
            i_acct_assx     TYPE STANDARD TABLE OF bapimepoaccountx,
            i_services      TYPE STANDARD TABLE OF bapiesllc ,
            i_srvacc        TYPE STANDARD TABLE OF bapiesklc,
            i_return        TYPE STANDARD TABLE OF bapiret2,
            wa_header       TYPE bapimepoheader,
            wa_headerx      TYPE bapimepoheaderx,
            wa_poitem       TYPE bapimepoitem,
            wa_poitemx      TYPE bapimepoitemx,
            wa_poitem_sch   TYPE bapimeposchedule,
            wa_poitem_schx  TYPE bapimeposchedulx,
            wa_acct_***     TYPE bapimepoaccount,
            wa_acct_assx    TYPE bapimepoaccountx,
            wa_services     TYPE bapiesllc,
            wa_srvacc       TYPE bapiesklc,
            wa_return       TYPE bapiret2,
            ws_po           TYPE bapimepoheader-po_number.
      break gbpra8.
      wa_services-pckg_no = 10.
      wa_services-line_no = 1.
      wa_services-outl_no = '0'.
      wa_services-outl_ind = c_x.
      wa_services-subpckg_no = 20.
      APPEND wa_services TO i_services.
      wa_srvacc-pckg_no = 10.
      wa_srvacc-line_no = 1.
      wa_srvacc-serno_line = 01.
      wa_srvacc-serial_no = 01.
      wa_srvacc-percentage = 100.
      APPEND wa_srvacc TO i_srvacc.
      LOOP AT i_input_file INTO wa_input_file.
        IF wa_input_file-column2 EQ 'HD'.
          wa_header-doc_type = wa_input_file-column3.
          wa_header-creat_date = sy-datum.
          wa_header-created_by = sy-uname.
          wa_header-vendor = wa_input_file-column4.
          PERFORM conversion_output USING wa_header-vendor
                                    CHANGING wa_header-vendor.
          wa_header-comp_code = 'DE03'.
          wa_header-purch_org = 'DE03'.
          wa_header-pur_group = 'DE1'.
          wa_header-vper_start = wa_input_file-column9.
          wa_header-vper_end = wa_input_file-column10.
          wa_headerx-comp_code = c_x.
          wa_headerx-doc_type = c_x.
          wa_headerx-creat_date = c_x.
          wa_headerx-created_by = c_x.
          wa_headerx-vendor = c_x.
          wa_headerx-purch_org = c_x.
          wa_headerx-pur_group = c_x.
          wa_headerx-vper_start = c_x.
          wa_headerx-vper_end = c_x.
        ENDIF.
        IF wa_input_file-column2 EQ 'IT'.
          wa_poitem-po_item = wa_input_file-column3.
          wa_poitem-short_text = wa_input_file-column6.
          wa_poitem-plant = wa_input_file-column8.
          wa_poitem-quantity = '1'.
          wa_poitem-tax_code = 'V0'.
          wa_poitem-item_cat = 'D'.
          wa_poitem-acctasscat = 'K'.
          wa_poitem-matl_group = wa_input_file-column7.
          wa_poitem-pckg_no = '10'.
          APPEND wa_poitem TO i_poitem .
          wa_poitemx-po_item = wa_input_file-column3.
          wa_poitemx-po_itemx = c_x.
          wa_poitemx-short_text = c_x.
          wa_poitemx-plant = c_x.
          wa_poitemx-quantity = c_x.
          wa_poitemx-tax_code = c_x.
          wa_poitemx-item_cat = c_x.
          wa_poitemx-acctasscat = c_x.
          wa_poitemx-matl_group = c_x.
          wa_poitemx-pckg_no = c_x.
          APPEND wa_poitemx TO i_poitemx.
          wa_poitem_sch-po_item = wa_input_file-column3.
          wa_poitem_sch-delivery_date = sy-datum.
          APPEND wa_poitem_sch TO i_poitem_sch.
          wa_poitem_schx-po_item = wa_input_file-column3.
          wa_poitem_schx-po_itemx = c_x.
          wa_poitem_schx-delivery_date = c_x.
          APPEND wa_poitem_schx TO i_poitem_schx.
          wa_acct_***-po_item = 10.
          wa_acct_***-serial_no = 01.
          wa_acct_***-gl_account = '0006360100'.
          wa_acct_***-co_area  = '1000'.
          wa_acct_***-costcenter = 'KC010000'.
          APPEND wa_acct_*** TO i_acct_***.
          wa_acct_***-po_item = 10.
          wa_acct_***-serial_no = 02.
          wa_acct_***-gl_account = '0006360100'.
          wa_acct_***-co_area  = '1000'.
          wa_acct_***-costcenter = 'KC010000'.
          APPEND wa_acct_*** TO i_acct_***.
          wa_acct_assx-po_item = 10.
          wa_acct_assx-serial_no = 01.
          wa_acct_assx-po_itemx = c_x.
          wa_acct_assx-serial_nox = c_x.
          wa_acct_assx-gl_account = c_x.
          wa_acct_assx-co_area  = c_x.
          wa_acct_assx-costcenter = c_x.
          APPEND wa_acct_assx TO i_acct_assx.
          wa_acct_assx-po_item = 10.
          wa_acct_assx-serial_no = 02.
          wa_acct_assx-po_itemx = c_x.
          wa_acct_assx-serial_nox = c_x.
          wa_acct_assx-gl_account = c_x.
          wa_acct_assx-co_area  = c_x.
          wa_acct_assx-costcenter = c_x.
          APPEND wa_acct_assx TO i_acct_assx.
          wa_services-pckg_no = 20.
          wa_services-line_no = 2.
          wa_services-service = wa_input_file-column9.
          wa_services-quantity = '100'.
          wa_services-gr_price = '100'.
          wa_services-userf1_txt = wa_input_file-column13.
          APPEND wa_services TO i_services.
          wa_srvacc-pckg_no = 20.
          wa_srvacc-line_no = 1.
          wa_srvacc-serno_line = 02.
          wa_srvacc-serial_no = 02.
          wa_srvacc-percentage = 100.
          APPEND wa_srvacc TO i_srvacc.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader                     = wa_header
          poheaderx                    = wa_headerx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
       IMPORTING
         exppurchaseorder             = ws_po
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
       TABLES
         return                       = i_return
         poitem                       = i_poitem
         poitemx                      = i_poitemx
      POADDRDELIVERY               =
         poschedule                   = i_poitem_sch
         poschedulex                  = i_poitem_schx
         poaccount                    = i_acct_***
      POACCOUNTPROFITSEGMENT       =
         poaccountx                   = i_acct_assx
      POCONDHEADER                 =
      POCONDHEADERX                =
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
         poservices                   = i_services
         posrvaccessvalues            = i_srvacc
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      break gbpra8.
      LOOP AT i_return INTO wa_return.
      ENDLOOP.
    ENDFORM.                    " split_data
    *&      Form  conversion_output
          Conversion exit input
    FORM conversion_output  USING    p_ip
                            CHANGING p_op.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = p_ip
        IMPORTING
          output = p_op.
    ENDFORM.                    " conversion_output
    <b>Reward points if this helps.
    Manish</b>

  • BAPI for Open Sales Order

    Experts,
    I need a BAPI for list of Sales order against which the invoice has not been generated.  I need to pass date and bapi shall return list of sales order that are not invoiced.
    Thanks
    Harsh

    Hi Frederic
    Sure it does.
    Actually I want to send data from SAP to some .net application. I thought using BAPI would make the job easier.
    Anyways thanks.
    Regards
    Harsh

  • PS: BAPI For Planned Progress and Actual Progress

    Dear All,
                  Is there any BAPI available for Planned Progress and Actual Progress for PS Project.
    Regards,
    Sohail

    Hi,
    Try using this report s_alr_87013532.
    Also for planned and actual progress the table is rpsqt. Could not find any bapi for the progress
    Regards
    Hiren K.Chitalia

  • BAPIs for Vendor Balances

    Hi!
    I need a BAPI for extract the Vendor Balances and other for load the Vendor Balances.
    Do they exist?

    try to search in Se37
    BAPI_AP_ACC_GETBALANCEDITEMS   Vendor Account Clearing Transactions in a given Period
    BAPI_AP_ACC_GETCURRENTBALANCE  Vendor Account Closing Balance in Current Fiscal Year
    BAPI_AP_ACC_GETKEYDATEBALANCE  Vendor Account Balance at Key Date
    BAPI_AP_ACC_GETPERIODBALANCES  Posting Period Balances per Vendor Account in Current Fiscal Year
    regards
    Prabhu

  • Function modules or BAPI for posting plan costs for WBS Element

    Hi all,
    Does anyone know, whether there exists a function module or BAPI for posting plan costs to a WBS Element? K_COSTS_PLAN_PS does not work, because RKP1 is not allowed.
    Greetings

    check
    BAPI_COSTACTPLN_POSTACTINPUT   Activity Input Planning: Posting                
    BAPI_COSTACTPLN_POSTACTOUTPUT  Activity/Price Planning: Posting                
    BAPI_COSTACTPLN_POSTKEYFIGURE  Stat. Key Figure Planning: Postings             
    BAPI_COSTACTPLN_POSTPRIMCOST   Primary Cost Planning: Postings                 
    BAPI_PDTRANSCO_POSTPRIMCOST    Transfer of Planning Data: Post Primary Costs   
    K40C                           CO Actual Postings, Manual                      
    BAPI_ACC_PRIMARY_COSTS_POST    Accounting: Post Primary Costs                  
    BAPI_COPAACTUALS_POSTCOSTDATA  BAPI Operating Concern: Post Costing-Based Actua
    BAPI_PRIM_COST_CHECK_AND_POST  Primary Costs: Formal Parameter Check           
    S@meer

  • IDOC/BAPI for Production order creation from Legacy system

    Hi all
    We are using an interface to create Production orders from legacy to SAP. Would you recommend an IDOC or a BAPI to create Production orders. If IDOC or BAPI then could you please mention which one?
    thanks a bunch

    Hi John,
    For your purposes, please use BAPI for production order creation from legacy system. There is no standard inbound IDoc available to use. SAP has an IDoc for outbound interface only (message type LOIPRO).
    If there is an inbound IDoc available, I would recommend to use an IDoc.
    IDoc technology has excellent error handling and will allow you to reprocess an error (if any).
    BAPI is also good approach to use and fast in term of  processing.
    For BAPI approach, you can use BAPI BAPI_PRODORD_CREATE.
    Hope this will help.
    Regards,
    Ferry Lianto

Maybe you are looking for