BAPI create

Hi all,
We are looking into using bapi "bapi_lead_createmulti" to create lead documents from a file.  The lead is getting created, however the Partner data is not being filled.  If I was to create each of these leads manually, the partner determination rule would run and fill in Employee Responsible.  Is anyone currently using this BAPI successfully and if so, did you have to do anything to the BAPI to determine partners.
thanks in advance,
shrihari

Hello Winson,
I've looked through the source of 'BAPI_CUSTOMER_CREATEFROMDATA1' and it seems that it obtains account group from reference customer.

Similar Messages

  • BAPI: Create INQUIRY/QUOTATION/SALESORDER- (from data2)

    Hi ALL...
    We can create
    INQUIRY/QUOTATION/SALESORDER
    using BAPI (Create from data2)........
    there are some stuctures/tables as parameters like:
    ORDER_HEADER_INX
    ORDER_ITEMS_INX
    ORDER_SCHEDULES_INX
    ORDER_CONDITIONS_INX
    what is use of these structures/tables and what is effect?...
    and where i can get detailed documentation of all these Structures/tables

    Go to Documentation in the Function module. You will see the description of all the paramters there, and how they would need to be filled.
    On the segments you asked, those denote the change indicator
    The following entries are available:
    ' ':   Create a new sales document item
    I:     Create a new sales document item
    U:     Change an existing sales document item
    D:     Delete an existing sales document item

  • BAPI Create delivery from scheduling agreement

    Hello,
    Does anyone have code to create a delivery referencing a scheduling agreement?  
    Thanks,
    Evan

    I dont think there is a BAPI to create delivery from the schedule lines .
    You can get the details of schedule lines from the VBEP  table and use the FM BAPI_OUTB_DELIVERY_CREATE_SLS.
    This becomes very cumbersome in case there are partial deliveries per schedule line.

  • Creating service PO using BAPI - Created PO doesnot exist!!!

    Hi,
    I am creating service PO using   BAPI_PO_create. BAPI returns a PO number at the completion of excution. But when i check in ME23N Po does not exist. Niether does it Exist in EKKO/EKPO tables.
    also there is a structure BAPIESKLC in this  BAPI.  Though i know htis a link for account assignment i am not very clear on the fields. Specially  the percenatge field.
    Can someone guid me on This?
    Thanks on advance,
    Shwetha

    Please do check if there are any dumps in the system, after the commit work command.
    For this, you should check transaction code ST22.
    Any dumps ?
    Edited by: Lior Tabib on Jul 13, 2011 9:35 AM
    Edited by: Lior Tabib on Jul 13, 2011 9:35 AM

  • BAPI: Create Sales order with reference to Quotation

    Hi ...
    I am using bapi BAPI_SALESOREDER_CREATEFROMDATA2  and
    i want to create sales order with reference Quotation... All quotation data like Materials prices and conditions must be copied from reference quotaion which is allready created .....
    ..Thanks..
    ..Ashish

    Hello,
    nice to see that this has already been solved.
    But it actually doesnt work in my scenario. Do you have an example coding which will explain your solution.
    Mine looks like this:
    * Update Flag
      ls_header_inx-updateflag = 'I'.
    * Angebotskopf einlesen
      SELECT SINGLE * FROM vbak INTO ls_vbak
        WHERE vbeln = iv_vbeln
          AND vbtyp = lc_vbtyp.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    * Auftragskopf setzen
      ls_header_in-doc_type      =  ls_vbak-auart.
      ls_header_in-sales_org     = ls_vbak-vkorg.
      ls_header_in-distr_chan    = ls_vbak-vtweg.
      ls_header_in-division         = ls_vbak-spart.
      ls_header_in-req_date_h   = ls_vbak-VDATU.
      ls_header_in-ref_doc        = ls_vbak-vbeln.
      ls_header_in-refdoc_cat   = 'B'.
    * Angebots-Partner einlesen (Nur AG und WE)
    * Auftrag anlegen
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
    *   SALESDOCUMENTIN               =
          order_header_in               =  ls_header_in
    *      order_header_inx              = ls_header_inx
    *   SENDER                        =
    *   BINARY_RELATIONSHIPTYPE       =
    *   INT_NUMBER_ASSIGNMENT         =
    *   BEHAVE_WHEN_ERROR             =
    *   LOGIC_SWITCH                  =
    *   testrun                       = 'X'
    *   CONVERT                       = ' '
       IMPORTING
          salesdocument                 = ev_vbeln
        TABLES
          return                        = et_return
    *      order_items_in                = lt_items_in
    *      order_items_inx               = lt_items_inx
          order_partners                = lt_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              =  .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    Unfortunatly this just makes the reference to the quotation but does not takeover ALL data from header and pos level.
    Thanks and regards
    Markus Armbruster

  • Reg : BAPI create GL account

    Hi ,
    I need to create the GL (Company code data thro FSS1 transaction) .Data is available in Excel file . Is there any BAPI to create GL for this transaction?....
    Regards,
    Krishna.

    Hi
    This is a small BDC program which is enough to upload this GL accounts
    see the sample code
    ABAP Name   :   ZFI_GL_FSS0
    Description :   This Program is used to Upload the
                     GL Account Master using Transaction FSS0.
    REPORT zfi_gl_fss0
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_gl OCCURS 0,
            saknr(010),            " GL Account
            bukrs(004),            " Company Code
            waers(005),            " Currency
            xsalh(001),            " BAl Local Curr Ind
            mwskz(002),            " Tax Category
           xopvw(001),            " Open Item Ind
           xkres(001),            " Line Item Ind
            zuawa(003),            " Sort Key
            fstag(004),            " Field Category
          END OF i_gl.
    Data Variables & Constants
    CONSTANTS : c_x             VALUE 'X',  " Flag
                c_tax           VALUE '0'.  " Tax Category
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_gl
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Upload the Data from Internal Table
      LOOP AT i_gl.
    Initial Screen
        PERFORM bdc_dynpro      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN'
                                         '2001'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ACC_CRE'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_KEY-SAKNR'.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                      i_gl-saknr.
        PERFORM bdc_field       USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                      i_gl-bukrs.
        perform bdc_dynpro      using
                           'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=TAB02'.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                      i_gl-WAERS.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                      i_gl-XSALH.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                      i_gl-MWSKZ.
        perform bdc_field       using 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
       perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                     i_gl-XOPVW.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                      c_x."i_gl-XKRES.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                      i_gl-ZUAWA.
        perform bdc_dynpro      using
                             'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=SAVE'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'GLACCOUNT_SCREEN_CCODE-FSTAG'.
        perform bdc_field       using 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                      i_gl-FSTAG.
    Call The Transaction
        PERFORM bdc_transaction USING 'FSS0'.
      ENDLOOP.
    Close the BDC Session
      PERFORM close_group.
    Regards
    Anji

  • BAPI Create Contract Account in Module PSCD

    Hi all,
    I have a requirement create Contract Account (TCode CAA1) in module PSCD by BAPI.
    I use BAPI : BAPI_CTRACCONTRACTACCOUNT_CR1.
    I set value for some required parameters and Perform BAPI, i receive 2 error messages in RETURN parameter :
    - Enter a value in field Account Determ. ID
    - Enter a value in field Payment Terms
    I don't know where to set value for Account Determ.ID and Payment Terms in BAPI.
    I searched description of BAPI parameters but there is no BAPI parameter suitable.
    I also searched on this forum but no topic found.
    Pls help,
    Thank.
    nvsinh.

    Hi all,
    The problem is solved.
    The proplem comes from release version of ECC6.
    Thanks all,
    Sinhto

  • BAPI creating incorrect Item Texts

    Hi all
    I've got a problem where sales orders and credit notes get created via BAPIs but sometimes an item text from the previously created record appears on the following record.
    Background
    The process is as follows:
    1. XI creates a bunch of IDocs containing a mixture of sales order and credit memo doc types
    2. These are all processed in one go within a custom function module
    3. For Credit notes the BAPI 'BAPI_SALESDOCU_CREATEFROMDATA' is used, if this is successful then the item texts are processed which basically involves adding an item text to the last item. This is done using the SAVE_TEXT function. If there is more than one item the first to penultimate items do not have texts.
    4. For other doc types (standard orders, forward orders, paid), function 'SD_SALESDOCUMENT_CREATE' is run in test mode so that a credit check can be performed in advance of creating the document - the sales_text table is populated. If the credit check passes then the order is created using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'. The texts are created vai the BAPI by populating the order_text table.
    5. The next Idoc is then processed.
    Five times since this went live (about 18 months ago) a Credit Note has been created where the first item on it has the item text from the previous sales order
    What I've done so far
    1. I've reviewed the code to make sure variables are being cleared - they are
    2. I've run data through the system and stepped through it in debug mode - it works fine
    3. Our QAS box was restored from PRD recently so contains some of these incorrect documents. I've re-run the exact same batch that casued the incorrect documents - they are all created correctly
    4. I've trawled through SAP Notes and this forum
    The fact that the problem is not replicable suggests to me that both the data coming in and the bespoke function module are OK. I'm not sure why the different methods have been used for the different doc types but I wonder if this is what's causing the problem, maybe memory is not being cleared or something.
    Any pointers, thoughts, solutions or other genreal musings would be greatly appreciated!
    Thanks
    Andy

    Hi Andy
    Although you have mentioned that, you have checked whether variables are cleared, but from the issue it looks like there must be some variable that does not gets cleared.....i would suggest you to debug once again and check this out.....it might help.
    regards
    Lokesh

  • Capturing Idocs created by BAPI Created Documents

    Hi guys,
    I have a big problem that i could really need some help, i use a BAPI:
    BAPI_ACC_DOCUMENT_POST to create documents, in same cases depending on the accounts used there are some CO documents created and their equivalent idocs.
    I searched everywhere but i didn't find any way to get the number of the idoc generated by the CO document that is created, does anyone have any suggestions on what to do ???
    In regular Documents i use this Function:
    SREL_GET_NEXT_RELATIONS
    but in this case it doesn't work even after many trials !
    I would really aprecciate the help !

    Hi
    If you are trying to find the idoc number that created a document, there is a way you can find it out.
    Note down the important field details of the document that would help you identify the idoc that created it.
    Go to transaction WE05. Using the date range the document got posted, pull up a list of idocs.
    Then click on the List Specific segment, put in the segment name of the idoc and click continue.
    It will bring up a table of table. You can find the row that contains the field information you have and by that approach find the idoc that created the document.
    Hope this helps
    Deepa

  • BAPI Create Service Request N1BA

    Good morning,
    Somebody knows what is the BAPI to create a Service Request, simulating the transaction N1BA, I have been debugging the transaction but I haven't found more than single like ISHMED_FILL_ANFO but that functions modules are just few part of the full program to create the service Request ..
    Thanks a lot,
    Hernán Restrepo C.

    Dear Hernán,
    I wondering why you plan to use the service request application. In fact this one is deprecated and the clinical order function does offer many more functions including option to interface with third party system.
    Also I can confirm that there is no BAPI available for the service request.
    Kind regards,
    Axel Biernat
    Siemens AG Healthcare
    Product Commercialize

  • BAPI create quotation - conditon record problem

    Dear experts,
    Plz help. Many thanks.
    Background:
    Due to special request, condtion type z replaces Z-table, i.e. for record value & used for calculation. Let's say condition record for Z is 0.12USD.
    When creating quotation via BAPI, the value of condtion type z will automatically pick 0.12USD once the output value of condtion type z is less than 0.01USD. Actually, the final value of condtion type z is 0.12 x ABC (one value). Let's say the final value is 0.003.
    Problem: In quoation, condition type z shows value 0.12USD but not 0.003USD.
    Request: How to make condition type z picks the final value, say 0.003USD via BAPI?

    Any advice?

  • Bapi: create sales order with reference to Invoice.

    HI ,
    i am trying to create sales order(credit memo request) with respect to invoice.
    What  BAPI to use. also, please provide with sample code.
    I have passed invoice to BAPI_SALESDOCU_CREATEFROMDATA1 at header level(ref_doc).
    and i am  passing other details correctly. the pricing procedure attched to original invoice is not getting triggered for th newly creating sales order.
    Please help me with this.

    use   BAPI_SALESORDER_CREATEFROMDAT2
    search the forum for sample program

  • BAPI:Create sales order from an existing open sales order for open items

    Dear All,
    Could any one suggest me any BAPI that can create sales order from an existing OPEN sales order for OPEN items. since we are closing all open orders and creating new orders with reference to existing open orders.   please suggest, its would be great help.
    Regards,
    Reddy

    hi suresh,
    we are changing tax procedure from formula to condition based, so this is the reason we have close all the open orders and recreate in TAXINN procedure, it is going to be large number of records( open orders), so....
    Regards,
    Reddy

  • BAPI  - Create Web Services

    I am on ECC 6.0. In my BAPI Explorer (transaction code BAPI) I don't see the "Create Web Services" button. I see all the other five viz. "Business Object Builder" to "Create BAPI List". Do I have to do activate something to get this button. All help is  appreciated  and will be suitably rewarded.
    Thanks

    Hi,
    The problem is because the security setting Adobe (the cross domain policy file) has more control over who has access to your data from a SWF.
    To solve this problem we add our swf in this page:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
    But we want to solve this problem without add each swf to this global security settings.
    We need to know where we can put our crossdomain.xml in the SAP application server?

  • BAPI create invoice

    I use BAPI_ACC_INVOICE_RECEIPT_CHECK to create automatically an invoice but I don't know how to add parameters to tables to create an invoice with 3 positions: for example with amount 200 , -195, -5
    How many there will be positions with:
    IT_ACCOUNTPAYABLE--ITEMNO_ACC
    IT_CURRENCYAMOUNT-ITEMNO_ACC
    IT_ACCOUNTGL-ITEMNO_ACC
    Every position have an own account number

    hi,
    Please find the below links.
    http://www.sapdev.co.uk/java/jco/bapi_jco.pdf
    http://sapabaplive.blogspot.com/search/label/BAPI
    Sample code:
    Invoice data is sent by the vendors in a text file and an inbound
    interface is required to create Vendor Invoices in SAP.
    The file contains the Purchase Order information, material quantity
    received from vendor along with the amount.
    Here the requirement becomes a little complex as there might be
    several ocuurences of same Purchase Order item in one invoice.
    Only a incomplete sample coding is given here and it can only be used
    as a base for writing a program.
    Populate internal Table I_ITAB from the data uploaded
    from text data file.
    Populate Item Table from item data in data file
    Processing for header records of data file.
    set up header data for BAPI call.
    Check whwther it's an Incoice or Credit Memo.
    And populate Invoice indicator accordingly.
    IF I_ITAB-TRANS EQ '-'.
    I_HEADER-INVOICE_IND = C_X.
    ELSE.
    CLEAR I_HEADER-INVOICE_IND.
    ENDIF.
    I_HEADER-PSTNG_DATE = I_ITAB-BUDAT.
    I_HEADER-DOC_DATE = I_ITAB-BLDAT.
    I_HEADER-CURRENCY = W_WAERS.
    I_HEADER-GROSS_AMOUNT = I_ITAB-DMBTR.
    I_HEADER-COMP_CODE = I_ITAB-BUKRS.
    I_HEADER-HEADER_TXT = I_ITAB-SGTXT.
    I_HEADER-REF_DOC_NO = I_ITAB-XBLNR.
    IF NOT I_ITAB-INV_REC_DATE IS INITIAL.
    I_HEADER-INV_REC_DATE = I_ITAB-INV_REC_DATE.
    ELSE.
    I_HEADER-INV_REC_DATE = I_ITAB-BLDAT.
    ENDIF.
    I_HEADER-PYMT_METH = I_ITAB-ZLSCH.
    APPEND I_HEADER.
    Populate Item Table from item data in data file
    lv_count = 0.
    LOOP AT I_ITAB.
    Processing for header records of data file.
    lv_count = lv_count + 1.
    Item Data
    I_ITEM-INVOICE_DOC_ITEM = lv_COUNT.
    I_ITEM-PO_NUMBER = I_ITAB-EBELN.
    I_ITEM-PO_ITEM = I_ITAB-EBELP.
    I_ITEM-TAX_CODE = I_ITAB-MWSKZ2.
    I_ITEM-ITEM_AMOUNT = I_ITAB-NETWR.
    Populate quantities if not a blanket order
    IF I_ITAB-BLANKET EQ SPACE.
    I_ITEM-QUANTITY = I_ITAB-MENGE.
    PERFORM GET_MEINS USING I_ITAB-EBELN " Use table EKPO
    I_ITAB-EBELP
    CHANGING I_ITEM-PO_UNIT.
    I_ACCOUNTINGDATA-PO_UNIT = I_ITEM-PO_UNIT.
    IF I_ITEM-QUANTITY EQ 0.
    I_ITEM-PO_UNIT = SPACE.
    ENDIF.
    ENDIF.
    Item Text
    I_ITEM-ITEM_TEXT = I_ITAB-ITEM_TEXT.
    APPEND I_ITEM.
    Populate Accounting Data
    IF I_ITAB-BLANKET EQ SPACE.
    I_ACCOUNTINGDATA-INVOICE_DOC_ITEM = lv_COUNT.
    I_ACCOUNTINGDATA-SERIAL_NO = '01'.
    I_ACCOUNTINGDATA-TAX_CODE = I_ITAB-MWSKZ2.
    I_ACCOUNTINGDATA-ITEM_AMOUNT = I_ITAB-NETWR.
    SELECT SINGLE SAKTO KOSTL VBELN VBELP ANLN1 ANLN2 DABRZ
    FISTL GEBER GRANT_NBR GSBER IMKEY KOKRS KSTRG PAOBJNR
    PRCTR PS_PSP_PNR AUFNR MENGE
    FROM EKKN
    INTO (I_ACCOUNTINGDATA-GL_ACCOUNT, I_ACCOUNTINGDATA-COSTCENTER,
    I_ACCOUNTINGDATA-SD_DOC, I_ACCOUNTINGDATA-SDOC_ITEM,
    I_ACCOUNTINGDATA-ASSET_NO, I_ACCOUNTINGDATA-SUB_NUMBER,
    I_ACCOUNTINGDATA-REF_DATE, I_ACCOUNTINGDATA-FUNDS_CTR,
    I_ACCOUNTINGDATA-FUND, I_ACCOUNTINGDATA-GRANT_NBR,
    I_ACCOUNTINGDATA-BUS_AREA, I_ACCOUNTINGDATA-RL_EST_KEY,
    I_ACCOUNTINGDATA-CO_AREA, I_ACCOUNTINGDATA-COSTOBJECT,
    I_ACCOUNTINGDATA-PROFIT_SEGM_NO, I_ACCOUNTINGDATA-PROFIT_CTR,
    I_ACCOUNTINGDATA-WBS_ELEM, I_ACCOUNTINGDATA-ORDERID,
    I_ACCOUNTINGDATA-QUANTITY)
    WHERE EBELN EQ I_ITAB-EBELN
    AND EBELP EQ I_ITAB-EBELP
    AND ZEKKN EQ '01'.
    IF EKKO-BSART NE 'LTV'.
    CLEAR I_ACCOUNTINGDATA-QUANTITY.
    CLEAR I_ACCOUNTINGDATA-PO_UNIT.
    ENDIF.
    APPEND I_ACCOUNTINGDATA.
    ENDIF.
    ENDLOOP.
    The following coding is to solve the problem
    mentioned in OSS Note 518338.
    Same PO item within several invoice items.
    SORT I_ITEM BY PO_NUMBER PO_ITEM.
    LOOP AT I_ITEM.
    ON CHANGE OF I_ITEM-PO_NUMBER OR I_ITEM-PO_ITEM.
    W_COUNTER = 1.
    LOOP AT I_ITEM WHERE PO_NUMBER = I_ITEM-PO_NUMBER
    AND PO_ITEM = I_ITEM-PO_ITEM.
    IF W_COUNTER EQ 1.
    I_ACCOUNTINGDATA-SERIAL_NO = '01'.
    I_ACCOUNTINGDATA-XUNPL = ' '.
    ELSE.
    I_ACCOUNTINGDATA-SERIAL_NO = ' '.
    I_ACCOUNTINGDATA-XUNPL = 'X'.
    ENDIF.
    MODIFY I_ACCOUNTINGDATA
    TRANSPORTING SERIAL_NO XUNPL
    WHERE INVOICE_DOC_ITEM = I_ITEM-INVOICE_DOC_ITEM.
    W_COUNTER = W_COUNTER + 1.
    ENDLOOP.
    To solve the repetition of PO item in subsequent invoices.
    ELSEIF SY-TABIX EQ 1.
    W_COUNTER = 1.
    LOOP AT I_ITEM WHERE PO_NUMBER = I_ITEM-PO_NUMBER
    AND PO_ITEM = I_ITEM-PO_ITEM.
    IF W_COUNTER EQ 1.
    I_ACCOUNTINGDATA-SERIAL_NO = '01'.
    I_ACCOUNTINGDATA-XUNPL = ' '.
    ELSE.
    I_ACCOUNTINGDATA-SERIAL_NO = ' '.
    I_ACCOUNTINGDATA-XUNPL = 'X'.
    ENDIF.
    MODIFY I_ACCOUNTINGDATA
    TRANSPORTING SERIAL_NO XUNPL
    WHERE INVOICE_DOC_ITEM = I_ITEM-INVOICE_DOC_ITEM.
    W_COUNTER = W_COUNTER + 1.
    ENDLOOP.
    ENDON.
    ENDLOOP.
    Changes over for OSS Note 518338.
    SORT I_ITEM BY INVOICE_DOC_ITEM PO_NUMBER PO_ITEM.
    CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
    EXPORTING
    HEADERDATA = I_HEADER
    IMPORTING
    INVOICEDOCNUMBER = W_BELNR
    FISCALYEAR = W_GJAHR
    TABLES
    ITEMDATA = I_ITEM
    ACCOUNTINGDATA = I_ACCOUNTINGDATA
    TAXDATA = I_TAX
    RETURN = I_RETURN.
    if sy-subrc 0.
    message e999(re) with 'Problem occured'.
    else.
    loop at return.
    if not return is initial.
    clear bapi_retn_info.
    move-corresponding return to bapi_retn_info.
    if return-type = 'A' or return-type = 'E'.
    error_flag = 'X'.
    endif.
    append bapi_retn_info.
    endif.
    endloop.
    if error_flag = 'X'.
    message e999(re) with 'Problem occured'.
    rollback work.
    else.
    Return Table from BAPI call is empty
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = I_RETURN.
    endif.
    endif.
    hope this helps.
    regs,
    hema.

Maybe you are looking for

  • Modifying Dynamic selection in standard logical database

    Hello guys, I have a requirement to add a field to a dymamic selection of standard programs. The standard programs used the logical database KDF. I have created a custom selection view and included the required field which is from table BKPF. But thi

  • Error in sending mail (mail exception error)

    HI guys, I used smtp method to send mail in the java application. If i am trying through outlook it's working. but if i used in the application it's throwing this error. can anyone help me? I am using SMTP (org.springframework.mail.javamail) method t

  • Class ? = new class

    Hi, I am trying to model a simple employee record system for a friend. One feature of this is that from the GUI you can add a new employee. I am having trouble implementing this. I need to create a new instance of the class employee as the program is

  • Error in LSMW for routing,.

    i am getting ths error whiled assigning materials to operations, for Routing PP. You cannot edit the task list object with activity type. i am using direct input  to upload routing material assignment to operation and this is my structure. my source

  • IDVD '06 Crashes Every Time

    Just upgraded to iLife '06... Everytime I start up iDVD, it loads a previous project (says it's updating it); and if I try to do anything on that project, or start a new project, iDVD simply quits. I tried trashing prefs, reinstalling, upgrading to 6