Problems in creating Invoice using BAPI

Hello Friends,
I am using a BAPI BAPI_BILLINGDOC_CREATEMULTIPLE to create invoice from a sales order, but i am not able to change the payer value.
The payer is by default taken from Sales-Order, even if i change it in Payer value passed to BAPI.
Please suggest me a solution.
Sandeep.

To answer your question I would need to know what stack trace comes back with.
I also need to know the set up.. Is the applet running on you personal machine and what operating system are you using.
Lee

Similar Messages

  • How to create invoice using bapi  base on delivery number with example

    hi,
    Pl give me one example to create invoice using bapi base on delivery number (PGI).

    Use this code
    * Pass the delivery no to the FM to create the invoice
          wa_vbsk-smart = u2018Fu2019.
            wa_komfk-vbeln = nast-objky. u201CuF0DF-----delivery number
            APPEND wa_komfk TO it_komfk.
            CLEAR wa_komfk.
    *    To fill the message structure
    *        l_wa_error-vbeln_vl = nast-objky. " Delivery No.
    *        l_wa_error-fkart = wa_ztab-bil_doc_type." Billing Doc type
            CALL FUNCTION 'RV_INVOICE_CREATE'
                    EXPORTING
    *                 delivery_date             = 0
                     invoice_date              = v_date  u201C<- date
    *                 invoice_type              = '    '
    *                 pricing_date              = 0
                     vbsk_i                    = wa_vbsk
                     with_posting              = u2018Du2019
    *                 select_date               = 0
                     i_no_vblog                = ' '
                     i_analyze_mode            = ' '
                     id_utasy                  = ' '
                     id_utswl                  = ' '
                     id_utsnl                  = ' '
                     id_no_enqueue             = ' '
                     id_new_cancellation       = ' '
    **             IMPORTING
    *               VBSK_E                    =
    *               OD_BAD_DATA               =
    *               DET_REBATE                =
                    TABLES
                      xkomfk                    = it_komfk
                      xkomv                     = it_komv
                      xthead                    = it_thead
                      xvbfs                     = it_vbfs
                      xvbpa                     = it_vbpa
                      xvbrk                     = it_xvbrk
                      xvbrp                     = it_vbrp
                      xvbss                     = it_vbss
    *               XKOMFKGN                  =
    *               XKOMFKKO                  =

  • Problem while creating assets using BAPI

    Use table enhancement BAPI_TE_ANLU
    Diagnosis :The BAPIs for creating and changing assets currently support only those customer enhancements that relate to the user fields created using SAP enhancement AIST0002.
    Can anybody give the appropriate solution why this error is coming while creating assets using BAPI.

    Looks like you are trying to transfer custom fields into the asset master data that were not added following the steps in enhancement AIST0002.
    Using EXTENSIONIN parameter, you can transfer user fields from the asset master record. However, it is not possible to transfer fields that are updated in user-defined tables. Only user fields that were defined using SAP enhancement AIST0002 and are automatically updated in table ANLU can be udpated in this way. This means you have to use table extension BAPI_TE_ANLU.
    Enhancement AIST0002 contains function module EXIT_SAPL1022_001 as a component in which user fields can be implemented.
    The documentation ( BAPIPAREX) of the structure that forms the basis for this parameter contains additional information about using this parameter.
    Please check how table ANLU has been enhanced and also go through the documentation of enhancement AIST0002.
    Regards,
    Shyam

  • Problem in Creating Shipment using BAPI

    Hi All,
    I am using the bapi BAPI_SHIPMENT_CREATE for creating shipment for deliveries in my program.
    When I schedule it in the background (i.e.SM37) the job gets cancelled when there is a dynamic credit block (Message type is E).
    When I execute the program in the foreground i.e. using transaction SA38, the shipment gets created successfully.
    It would be great if anyone suggest a way to overcome this issue.
    Thanks.
    Regards, Senthil G.

    hi,
    Try thsi BAPi
    BAPI_CUSTOMER_CREATE
    Regards
    Sandipan

  • Creating PDF using BAPI

    Hi,
    I am trying to create PDF using BAPI. I got one BAPI(Z_MM_EPSP_BAPI_GET_PO_PDF). That bapi returns bytecodes. How can I generate PDF file using this BAPI output in BLS. Give some example
    Thanks & Regards
    Art

    Art,
    Are you familiar with xMII at all? I would like to answer your question but it seems more like a tutoring lesson rather than a technical problem.
    Please post a problem and not how somone can help you do your work. Unless of course you are willing to paypal some money over. :-D

  • Problem while creating PO using BAPI_PO_CREATE1

    HAI TO ALL
    I AM TRYING TO CREATE PO USING BAPI
    ORDER IS SUCCESFULLY GENERATED, BUT THE CONDITIONS WHATEVER I PASS IS ARE REPEATING ,
    EVEN WE CONFIGURED DEFAULT VALUES MAINTAINED IN TRANSCTION 'OMFI" AND MAINTAINED Default Values for Purchasing FOR PARAMETER IN PARAMETER TAB IN USER PROFILE,
    HELP ME...
    REGARDS,
    SN

    Hi Sid.
    I'm having this same problems on creating PO Service. Did you solve it? How did you do that?
    I'm using a PR and the Category is 'Y', and I cant find where is the problem.
    The tables that I'm passing to the BAPI_PO_CREATE1 are:
    POITEM/ POITEMX
    POACCOUNT/ POACCOUNTX
    POSERVICES
    POSRVACCESSVALUES
    Please, if you have any idea, let me know!
    Tks a lot!
    Renata

  • Trying to create Invoice using the API,however i am not able to create the customer accounts in the front end

    when creating invoice using the API AR_INVOICE_AP_PUB.Create_Single_invoice Am Getting the below Error:
    Transaction type is invalid with current transaction date
    invalid transaction type
    either an inventory item description must be provided
    Kindly help me here

    Hi Team,
    I  tried creating the invoice and I got the above errors, however, when updated the batch source ID I am now getting this following error only, i am just left with the following Error only
    Either an inventory item or description must be provided.
    Please help me on this.

  • Problem while creating INVOIC idoc

    Dear All,
    I am facing a error messege while creating INVOIC(using MIRO transaction) idoc through EDI for a partner(vendor).
    In MIRO transaction after selecting one Item I clicked GoTo>Messege>Item
    Then I selected output type (Z output type) , Medium EDI,  Function VN ,Partner number (say 123) language EN.
    After that when I presse enter I am geting a messege "Partner 123 does not exist for partner function LF".
    All the configuration is done including partner profile for 123(partner type is LI).
    Please let me know what is the reason for this error. Do i need to make any changes in configuration?
    Regards
    Arindam

    Go to BD54 and maintain table view for ur partner type  
    hope this helps u..
    Thanks,
    Anil
    Edited by: anil sasidharan on Apr 17, 2009 11:42 AM

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • How to create Invoice using SDK?

    Hi Friends,
    I m creating invoice using SDK functions..
              Company comp           =     new Company();
           comp.Server           =     "CSNSYS026";
           comp.CompanyDB      =     "SBODemo_US";
           comp.UserName      =     "manager";
           comp.Password      =     "manager";
               comp.Connect();
         comp.XmlExportType  =     SAPbobsCOM.BoXmlExportTypes.xet_NodesAsProperties;
         SAPbobsCOM.SBObob oSBObob     =     (SBObob)comp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoBridge);
         Documents inv          =     (Documents)comp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
         inv.ManualNumber     =     "20000";
         inv.DocDate          =     DateTime.Now;
         inv.DocDueDate          =     DateTime.Now;
            inv.CardCode          =     "C40001";
         inv.CardName          =     "EarthshakerCorp.";
         inv.DocCurrency          =     "USD";
         inv.Lines.ItemCode     =     "A00001";
         inv.Lines.Quantity     =     10;
         inv.Lines.Price          =     100;
         inv.DocTotal          =     1000;
         int i                    =     inv.Add();
         MessageBox.Show("Invoice created "+i);
    <b>While i execute the above c# code,Invoice din't created,Wht's missing in the above code</b>..
    Thanks in Advance
    regards
    Sooriyakala.P

    Ho Sooriya,
    what is the returncode from inv.add?
    If you call comp.getLastErrorDescription, you get the errordescription
    you should also set handwritten to true
    Regards
    Ad

  • ERROR IN CREATING PO USING BAPI

    Hi friends,
            My  requirement is to create po using BAPI but i am getting error message .i have entered all the fields but still i am getting This errors.
    E BAPI 001 No instance of object type Purchase Order has been created. External reference:
    E MEPO 000 Purchase order still contains faulty items
    E ME 645 Subcontracting as stock transfer within a company code not possible
    I ME 123 Supplying and receiving plants identical (Please check)
    please help.
    thanks in advance.
    Moderator message: please read message long texts, speak to a functional expert (these are not ABAP related errors), do more research before asking, do not use all capitals in the title.
    Edited by: Thomas Zloch on Nov 30, 2011 1:06 PM

    Hi
    It seems you're creating a transfer order and an item is set for subcontracting, that's not possible, so check the item type
    Max

  • Create material using bapi ' bapi_material_savedata'

    Hi Experts,
    i was tring to create material using bapi ' bapi_material_savedata' but the material is not updating in the table.
    please find the code and suggest me if any modification
    data: la_headdata type BAPIMATHEAD,
    la_clientdata type BAPI_MARA,
    la_CLIENTDATAX type BAPI_MARAX,
    la_return type BAPIRET2.
    data: i_materialdescription type table of BAPI_MAKT,
    wa_materialdescription like line of i_materialdescription.
    *la_headdata-MATERIAL = int_matnum-MATERIAL.
    *LOOP AT int_matnum.
    la_headdata-MATERIAL = int_matnum-MATERIAL.
    write : int_matnum-material.
    *ENDLOOP.
    la_headdata-MATERIAL = '100000518'."int_matnum-MATERIAL.
    la_headdata-IND_SECTOR = p_indsr.
    la_headdata-MATL_TYPE = p_matype.
    la_clientdata-BASE_UOM = 'FT3'.
    la_clientdata-pur_valkey = ' '.
    la_CLIENTDATAX-BASE_UOM = 'X'.
    la_clientdata-MATL_GROUP = '01'.
    la_CLIENTDATAX-MATL_GROUP = 'X'.
    wa_materialdescription = 'TEST'.
    append wa_materialdescription to i_materialdescription.
    clear: wa_materialdescription.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = la_headdata
    CLIENTDATA = la_clientdata
    CLIENTDATAX = la_CLIENTDATAX
    PLANTDATA =
    PLANTDATAX =
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA =
    VALUATIONDATAX =
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA =
    SALESDATAX =
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
    FLAG_ONLINE = ' '
    FLAG_CAD_CALL = ' '
    IMPORTING
    RETURN = la_return
    TABLES
    MATERIALDESCRIPTION = i_materialdescription
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
    Please Help me
    Regards,
    Naresh

    Hi all,
    Now it is asking me for the other fields,
    E ,
    The field MARA-XCHPF/BAPI_MARA-BATCH_MGMT is defined as a required field; it does not contain an entry
    i have passed this val as
    la_clientdata-batch_mgmt = 'X'.
    even though i am getting the same error.
    can you help me to solve the issue.
    Tthanks
    Naresh
    Edited by: naresh.k.dasari on Jan 4, 2011 10:36 AM

  • Account assignment while creating reservation using bapi

    Hi , I am creating reservation using BAPI  (BAPI_RESERVATION_CREATE1), but when I seeing the open reservation account assignment field is blank, could any on ehelp me on this, i.e what parameter I am missing in BAPI for account assignment.
    best regards
    pankaj

    Hi,
    there is not field to assign the account assignment in Bapi..
    you need to assignt he account manaually.
    Assign account assignment category.
        SELECT * FROM eban INTO TABLE lt_eban WHERE banfn = w_banfn .
        IF sy-subrc = 0.                                     
          LOOP AT lt_eban .                 
            lt_eban-knttp = 'J'.    "assign your own account categeory
            MODIFY eban FROM lt_eban.
            COMMIT WORK AND WAIT.                            
          ENDLOOP.
    endif.
    Regards,
    Prabhudas

  • Error while creating BOM using BAPI 'BAPI_BOM_UPLOAD_SAVE'

    Hi All,
    We are getting an error as 'Data is incomplete' while trying to create BoM using the bapi 'BAPI_BOM_UPLOAD_SAVE', if the item contains Item category as 'T'. But for other item category like 'L' or 'N', the bapi is sucessfull.
    The values that we pass to fill the item category 'T' are operation, item_cat, bom_itm_no, COMPON_QTY, FIXED_QTY as 'X', UNMEAS as 'ST', ITEM_TEXT1 and ITEM_TEXT2.
    Anyone who has faced same problem or has a solution to the problem, kindly provide a solution.
    Regards,
    Vijay

    The error you receive is because of different config for different Item Categories. Find out from the functional team what fields have they kept mandatory for the item category 'T'. You may not be passing one of those fields in the BAPI.
    Try creating a BOM manually for item category 'T' and you may figure our which field you are missing.

  • Creating Material Using BAPI

    Hi Friends,
    I want to create a material using BAPI, can anyone give me some sample program or can any one give me links which earlier posted this problem.
    Points for sure for sample program.
    thanks and regards
    Vijaya

    hi
    good
    go through this REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    thanks
    mrutyun^

Maybe you are looking for

  • "500   Internal Server Error" recieved.

    hello. I've installed solution manager 4.0 and dedicated this server as our central SLD.  It was configured and working fine until our consultant patched it from SP 9 to 11.  In the beginning, dispatcher and server would come up but none of applicati

  • Itunes not completing sync with Iphone 4! Help!!!

    Have an HP laptop running Windows 7. Using Itunes to sync Iphone 4. Last week I connected the Iphone 4 to computer and Itunes updated my phone to IOS 4.3.5. After the update to the Iphone 4, Itunes started syncing with my phone. Now, it gets to step

  • Project Center – "An unknown error has occurred"

    I have the error in Project center and I can´t access any project after SP2 upgrade I have error in log file: [OWSTIMER] [PublishedDatabaseSequence] [INFO] [04/02/2014 14:37:15]: ProjectSite Name=d1f5ce6e-a924-40b9-8a83-e3a8357ec007 [OWSTIMER] [Publi

  • InDesign table/textbox problem

    I have a table inside a textbox. Whenever I move the textbox to the lower left side of my document, a couple of the rows inside the document automatically split leaving an unwanted horizontal space in my table. Oddly, when I move the textbox (with a

  • How do i recover messages for iPod 5 touch?

    My iPod 5 touch shut down and the messages disappeared.. like i deleted them or something how would i get them back ?