FM GN_INVOICE_CREATE

hi,
I have to modify transaction v_nl to accept multiple sold-to-party.On passing multiple customers to FM gn_invoice_create I get the pricing and condition type for  all the materials but ai am not able to determine which material ia selected for which customer.
can anybody tell me the the tie up between
structures KOMFKGN and VBRPVB that are filled by fm gn_invoice_create

based on the condition number u can link these structure data.
Regards
Peram

Similar Messages

  • GN_INVOICE_CREATE - Creates Invoice but not visible (for Report RVAFSS00 )

    Hi,
    I am running GN_INVOICE_CREATE using SE37.  I have supplied the data and stepped through the code.  At the end of the execution - I get a successful message stating that the "Document 9000007 is saved".  If I go into VF03 and try to bring up Billing document 9000007 - I get the error message "Billing document 9000007 does not exist."
    I am not sure if i am supplying all of the input parameters correctly to make sure that the transaction is committed.  I cannot find enough documentation about GN_INVOICE_CREATE parameters.  The only information I did find for the input is under the Billing (SD-BIL)->Billing->The General Billing Interface->Function Module Parameter at  http://help.sap.com/saphelp_46c/helpdata/en/dd/5615db545a11d1a7020000e829fd11/content.htm and http://help.sap.com/saphelp_46c/helpdata/en/dd/5615b4545a11d1a7020000e829fd11/content.htm .  But that does not describes all of the input parameters like (VBSK_I, WITH_POSTING, CALLER_TYPE, I_WITHOUT_REFRESH, ID_NO_ENQUEUE, ID_KVORG, ID_NO_DIALOG, ID_NEW_CANCELLATION)      
    Do I need to create a wrapper RFC and call a BAPI_COMMIT_WORK as in BAPI_SALESORDER_CREATEFROMDAT2?  Or am i passing the parameters incorrectly:
    Here is what I am passing in SE 37:
    DELIVERY_DATE =                   08/14/2006
    INVOICE_DATE =                     08/14/2006
    INVOICE_TYPE =                     FX        
    PRICING_DATE                              
    VBSK_I                                    
    WITH_POSTING =                     A         
    CALLER_TYPE                               
    I_WITHOUT_REFRESH =                X         
    ID_NO_ENQUEUE                             
    ID_KVORG =                         06        
    ID_NO_DIALOG =                     X         
    ID_NEW_CANCELLATION                       
    The XKOMFKGN and XKOMFKKO tables I believe are correct based on the Communication Structure help files.
    Any help in figuring this out is appreciated.  Also, if you can let me know what the following field inputs are -VBSK_I, WITH_POSTING, CALLER_TYPE, I_WITHOUT_REFRESH, ID_NO_ENQUEUE, ID_KVORG, ID_NO_DIALOG, ID_NEW_CANCELLATION. 
    The reason I am going through this RFC is that we are looking at using Report RVAFSS00 to import a file that then runs the GN_INVOICE_CREATE to create billing documents with external transactions as defined in the General Billing interface.
    Regards,
    Jay

    Did not find the documentation for the fm any where, i think best place to look for is OSS.
    Parameter: ID_NO_DIALOG is for suppressing some shipping related screen and ID_NO_ENQUEUE is for locking sales order or delivery doc.
    By using where used list of the function module, some times it's possible to find out the use of other parameters.
    Hope this helps.
    Regards
    Sridhar

  • Mandatory fields for GN_INVOICE_CREATE

    Hi,
    My requirement is for a given material say 'X', I want to know its netprice.
    I mean when I create a sales order with material 'X', I get its netprice.
    I want to know the netprice of this material without creating  a sales order itself.
    I gathered the information that fn. module GN_INVOICE_CREATE suits my requirement.
    But, I dont know the minimum data we should pass to the function module for getting back the 'net price' of the given material.
    Eagerly waiting for your replies,
    Shivaa......

    Hi Siva,
    Go through the following example.You can understand what vlues are mandatory to give.
      CALL FUNCTION 'GN_INVOICE_CREATE'
        EXPORTING
        DELIVERY_DATE             = 0
        INVOICE_DATE              = 0
        INVOICE_TYPE              = '    '
        PRICING_DATE              = 0
          VBSK_I                    = XVBSK
          WITH_POSTING              = 'B'
        CALLER_TYPE               = ' '
        I_WITHOUT_REFRESH         = ' '
        ID_NO_ENQUEUE             = ' '
        ID_KVORG                  = ' '
          ID_NO_DIALOG              = 'X'
        ID_NEW_CANCELLATION       = ' '
        FILTER                    = FILTER
        IMPORTING
          VBSK_E                    = XVBSK
        TABLES
          XKOMFK                    = XKOMFK
          XKOMFKGN                  = XKOMFKGN
          XKOMFKKO                  = XKOMFKKO
        XKOMFKTX                  =
          XKOMV                     = XKOMV
          XTHEAD                    = XTHEAD
          XVBFS                     = YVBFS
          XVBPA                     = XVBPA
          XVBRK                     = XVBRK
          XVBRP                     = XVBRP
          XVBSS                     = YVBSS
        XKOMFKZM                  =
        SUCCESS_DOC_OUT           =
    by
    Prasd gvk.

  • External price not being read in for Item in GN_INVOICE_CREATE and RVAFSS00

    Hi,
    We are trying to create invoices using the RVAFSS00 program which calls the function GN_INVOICE_CREATE.  The billing document is being created.  However, the item price does not bring in the price that we have supplied in the XKOMFKKO-KBETR (Condition amount) field.  In KSCHL XKOMFKKO-KSCHL (Condition type) field we are passing in ZROO which is basically a copy of the pricing condition PR00.
    For ZR00, the condition class is Prices and the calculation type is Quantity.
    We want the item price in the billing document to be the price we supply in XKOMFKKO-KBETR to be multiplied by the XKOMFKGN-KWMENG.  We have left the Rate as blank for ZR00 pricing condition because we want our pricing to override this value.  If we do give a value for the ZR00 pricing condition, then our billing document Net value will multiply the amount by the ZR00 pricing - which we do not want.  We want it to use the XKOMFKKO-KBETR price.
    If you have used this program or function to pass in external prices, your help would be really appreciated.  We have looked through a lot of areas in the IMG for Pricing, Billing, Maintain Copying control of Billing documents.
    Thanks,
    Jay

    Did not find the documentation for the fm any where, i think best place to look for is OSS.
    Parameter: ID_NO_DIALOG is for suppressing some shipping related screen and ID_NO_ENQUEUE is for locking sales order or delivery doc.
    By using where used list of the function module, some times it's possible to find out the use of other parameters.
    Hope this helps.
    Regards
    Sridhar

  • Query related to FM gn_invoice_create

    Hi Experts,
    I need a clarification related to the FM gn_invoice_create.
    As per the requirement, We will get the test data from the Non SAP system. The Third party will place the input file in the application server.
    Our code should process the file and get the inputs from the file and pass the same to the FM gn_invoice_create.
    Now, till this, the development is done. The query is that the test data which we are passing to the FM is from the non-sap system.
    So, when i try to pass the input to this FM, i am getting error like all the input data is not available
    For (eg) : sales order type is not available, document not available.
    But when i read the documentation, i came to know that without any reference, wee can create invoice using this FM.
    Can anybody suggest if i do something wrong in this?.
    Thanks & Regards,
    Prabu

    Hi Karwin,
    The function module "GN_INVOICE_CREATE " has status 'Not released'.
    The release status is visible in the Attributes tab in SE37.
    According to the note
    415983 Modification/customer developments of SAP function
    109533 Use of SAP function modules
    Attributes. Some of the reasons why internally released Function
    modules are not documented are as follows;
    - too much overhead
    - internally released function modules are often changed and updated
    - are designed for specific purposes by the relevant Application
    Developers etc.
    SAP does not support problems that occur if the customer used non-released function modules.
    Many thanks,
    Mohammed Hussain.

  • Wrong pricing condition values when using GN_INVOICE_CREATE

    Hi all,
    I am currently handling a program where I have to display all the materials in a given sales area and some corresponding values that depend on pricing conditions. I am using FM GN_INVOICE_CREATE to extract table komv. However, I am experiencing a problem because the values I am getting are different from those in table konv. I am getting the price conditions without the value of field KNUMV.
    I would like to ask if anybody has any idea on how to go about this or maybe another function module that I can use to get the data I need.
    Thanks a lot..
    Regards,
    jac

    Hi,
    Thanks for your reply. I only have the field AUART for checking on the pricing conditions.
    Here is a the part of my code
      CALL FUNCTION 'GN_INVOICE_CREATE'
           EXPORTING
                vbsk_i           = i_vbsk
                id_kvorg        = ''
                id_no_dialog  = c_exis
                invoice_date  = p_datum
                pricing_date  = p_datum
           IMPORTING
                vbsk_e          = i_vbsk
           TABLES
                xkomfk         = i_komfk
                xkomfkgn      = i_komfkgn
                xkomfkko      = i_komfkko
                xkomv          = i_komv
                xthead         = i_thead
                xvbfs           = i_vbfs
                xvbpa          = i_vbpa
                xvbrk           = i_vbrk
                xvbrp           = i_vbrp
                xvbss          = i_vbss
           EXCEPTIONS
                OTHERS       = 1.
    The only parameters in those that have values are c_exis = X, p_datum = given date, and xkomfkgn. The other parameters are all initial when passed to the function module. I get a resulting komv table however, values are incorrect.
    Thanks again for the help..
    Regards,
    jac

  • GN_INVOICE_CREATE

    Hi All,
    Could anyone tell me if I culd use 'GN_INVOICE_CREATE'  Function Module to Create Invoice for Multiple Sales Order ? Or is this FM Only for Invoice Creation  for one sales Order ?
    Is there any FM for single invoice creation for multiple sales order ..?
    I will definetly reward points for helpful answers.
    Thanks.

    I wonder if it's a configuration issue. What happens if you do this manually?
    Rob

  • BAPI_SALESORDER_SIMULATE vs GN_INVOICE_CREATE

    Hi
    there is a SAP standard program SDNETPR0 that can be used to list Prices for Customer and range of Materials.
    This uses function module GN_INVOICE_CREATE to bring back the Prices.
    I was going to use that program as a base of a new Z program to extend some of the selection criteria.
    Now I am wondering if in my new Report I should be using BAPI_SALESORDER_SIMULATE or GN_INVOICE_CREATE.
    Both seem to do the same result.  But GN_INVOICE_CREATE is much much faster.
    What is your experience on this.
    Should I be using that or the BAPI...?

    Hello,
    When using GN_INVOICE_CREATE and if you are using the user exit to populate the custom fields in pricing communication structure, it has to be implemented in this function call as well.
    However BAPI_SALESORDER_SIMULATE works out of the box.
    Refer : SAP OSS: 536806

  • Why GN_INVOICE_CREATE has no performance improvement even in HANA landscape?

    Hi All,
    We have a pricing update program which is used to update the price for a Material Customer combination(CMC).This update is done using the FM 'GN_INVOICE_CREATE'.
    The logic is designed to loop on customers, wherein this FM will be called passing all the materials valid for that customer.
    This process is taking days(Approx 5 days) to get executed and updated for CMC of 100 million records.
    Hence we are planning to move towards HANA for better improvement in performance.
    We designed the same programs in the HANA landscape and executed it in both systems for 1 customer and 1000 material combination.
    Unfortunately, both the systems gave same runtimes around 27 seconds for execution.
    This is very disappointing thinking the performance improvement we should have on HANA landscape.
    Could anyone throw light on any areas where we are missing out and why no performance improvement was obtained ?
    Also is there any configuration related changes to be done on HANA landscape for better performance.?
    The details regarding both the systems are as below.
    Suite on HANA:
    SAP_BASIS : 740
    SAP_APPL  : 617
    ECC
    SAP_BASIS : 731
    SAP_APPL  : 606
    Also see the below screenshots of the system details.
    HANA:
    ECC:
    Thanks & regards,
    Naseem

    Hi,
    just to fill in on Lars' already exhaustive comments:
    Migrating to HANA gives you lots of options to replace your own functionality (custom ABAP code) wuth HANA artifacts - views or SQLscript procedures. This is where you can really gain on performance. Expecting ABAP code to automatically run faster on HANA may be unrealistic, since it depends on the functionality of the code and how well it "translates" to a HANA environment. The key to really minimize run time is to replace DB calls with specific HANA views or procedures, then call these from your code.
    I wrote a blog on this; you might find it useful as a general introduction:
    A practical example of ABAP on HANA optimization
    When it comes to SAP standard code, like your mentioned FM, it is true that SAP is migrating some of this functionality to HANA-optimized versions, but this doesn't mean everything will be optimized in one go. This particular FM is probably not among those being initially selected for "HANAification", so you basically have to either create your own functionality (which might not be advisable due to the fact that this might violate data integrity) or just be patient.
    But again, the beauty of HANA lies in the brand new options for developers to utilize the new ways of pushing code down to the DB server. Check out the recommendations from Lars and you'll find yourself embarking on a new and exciting journey!
    Also - as a good starting point - check out the HANA developer course on open.sap.com.
    Regards,
    Trond

  • Need info about GN_INVOICE_CREATE

    Hi experts!
    I need to create Credit / Debit memo invoices in my Z program, so I decided to use GN_INVOICE_CREATE for this, but can not find info about parametres of this FM....
    could anyone explaine how to use this FM or maybe someone has a peace of sample code of using this FM?
    Helpful answers and advices will be rewarded.
    Here is this FM:
    CALL FUNCTION 'GN_INVOICE_CREATE'
      EXPORTING
        DELIVERY_DATE           =
        INVOICE_DATE              =
        INVOICE_TYPE              =
        PRICING_DATE              =
        VBSK_I                          =
        WITH_POSTING              =
        CALLER_TYPE               =
        I_WITHOUT_REFRESH    =
        ID_NO_ENQUEUE           =
        ID_KVORG                      =
        ID_NO_DIALOG                =
        ID_NEW_CANCELLATION =
      IMPORTING
        VBSK_E                           =
      TABLES
        XKOMFK                           =
        XKOMFKGN                      =
        XKOMFKKO                      =
      XKOMFKTX                         =
        XKOMV                             =
        XTHEAD                            =
        XVBFS                              =
        XVBPA                              =
        XVBRK                              =
        XVBRP                              =
        XVBSS                              =
      XKOMFKZM                         =
      SUCCESS_DOC_OUT          =          .

    Hi Mindaugas,
    check BAPIinvoice in SE37, e, here u cannt directly make use of GN_invoice_create, Bcos here u dont have condition records data.
    so search in SE37 or Tcode BAPI , here u can get FMs along with Documentations.
    Regards
    Peram

  • Facing issue with GN_INVOICE_CREATE.

    Hi,
       As per my requirement before saving the billing document I need to display the tax amount and net value. For that i am using GN_INVOICE_CREATE function module. It is giving the tax amount and net value. But here my problem is Billing document is getting generated. I don't to generate the billing document. So can anyone kindly suggest me what are all the mandatory fields should i pass for that function module. And please provide the sample code also.
    Thanks & Best Regards,
    Yohan.Kanna

    Hi,
       Now i got the solution for that issue. here is my code. Please check
       CALL FUNCTION 'GN_INVOICE_CREATE'
           EXPORTING
             vbsk_i            = lw_vbsk_in
             with_posting      = 'H'
             i_without_refresh = 'X'
             id_no_enqueue     = 'X'
             id_no_dialog      = 'X'
           IMPORTING
             vbsk_e            = lw_vbsk
           TABLES
             xkomfk            = lt_komfk
             xkomfkgn          = lt_komfkgn_in
             xkomfkko          = lt_xkomfkko
             xkomv             = lt_komv
             xthead            = lt_thead
             xvbfs             = lt_vbfs
             xvbpa             = lt_vbpa
             xvbrk             = lt_vbrk
             xvbrp             = lt_vbrp
             xvbss             = lt_vbss.
    If we pass with_posting as 'H' it won't generate the billing document number. These are the mandatory fields for that(PRSDT,FKDAT,KWMENG,VGBEL,VGPOS,VGTYP,AUBEL and AUPOS)
    Thanks & Best Regards,
    Yohan.Kanna

  • Pricing error in GN_INVOICE_CREATE

    Hi,
    I have to use FM gn_invoice_create to create a billing document based on rebate no.
    After running this FM, I am getting the following error :
    Document & has been saved (pricing error)...
    Can anyone plz tell me why this error is coming up?
    Thanks & Regards,
    Mayur

    Hi,
    I am also facing the same issue.
    For me, when i try to pass the condition type and value, i am getting that error.
    Without that, the invoice is getting created.
    Please share your inputs.
    Thanks & Regards,
    Prabu

  • Third party process:Billing relevance 'B' order related and 122

    I am facing the following problem: in Order related Billing according to order qty, the sales order bills what has been received on the third party PO in MM.
    The following situation occurs: When I order 100, receive 100 and Bill 100: The sales order is fully billed. When I later return a quantity to the vendor in MM with a 122 referring to the PO, the sales order remains fully billed. There is no way I can find out which Sales order needs to be take action on (credit). Can someone help me finding out how I can select these sales orers after a 122?

    Ok, no problem.
    At the client we have a very specific flow where receipts on a third party PO need to be billed daily when they happen and every receipt (better: any goods movement) needs a seperate billing document.
    This is not covered in SAP standard. I wrote a program (functional) how SAP should find the billing relevant movements:
    1) Go to the billing due list daily at 0:00
    2) Check all related third party PO's and the movements
    3) Check the sales flow of the relevant SO. Check which material doc has been billed (via reference field in the billing doc)
    4) For all items not yet billed call function module GN_INVOICE_CREATE. (bill in case of 101 and 123 and credit in case of 102 and 122)
    This works all fine until I found above issue: Fully billed items are removed from the billing due list even if there is a 122 or 102 afterwards on the PO. So I redesigned the program.
    1) at 0:00 Select all movements on the system date for the specific flow (PO type and plant) via Material documet header and segment.
    2) Via the account assignment in the material doc you have the Sales order. Then the same applies:
    3) Check the sales flow of the relevant SO. Check which material doc has been billed (via reference field in the billing doc)
    4) For all items not yet billed call function module GN_INVOICE_CREATE. (bill in case of 101 and 123 and credit in case of 102 and 122)
    Here I am not using the due list and it solved my problem.

  • Get Sales Order price from delivery

    Hi Folks, I need your help.
    I have a smart form to print a ticket that shows the total amount to be paid. Iu2019m using the FM GN_INVOICE_CREATE to simulate the prices and sum the items (Table xvbrp), passing the material and quantity.
    The problem here is when some conditions of discounts are included manually as price conditions in the sales order this function has no considerer those and I get the wrong amount or the amount without those conditions.
    After this issue a decided to change the FM to RV_INVOICE_CREATE (Table xvbrp), which is the FM used by the transaction VF01, this function works perfect but a Post good issue is required to obtain the prices.
    I need a FM to get these prices from the delivery, taking in consideration sales order conditions automatic and manual for the delivery item and delivery quantity. The purpose of this is to print a ticket with the amount to be paid by the customer, before the invoice is created.
    Thank in advance.
    Alexis Ramirez

    I solved the issue using the FM RV_INVOICE_CREATE.
    CALL FUNCTION 'RV_INVOICE_CREATE'
      EXPORTING
        invoice_type   = rv60a-fkart
        invoice_date   = sy-datum
        pricing_date   = rv60a-prsdt
        delivery_date  = rv60a-fbuda
        select_date    = rv60a-seldat
        i_analyze_mode = 'X'
        vbsk_i         = vbsk
        id_no_enqueue  = 'X'
      IMPORTING
        vbsk_e         = vbsk
        od_bad_data    = lv_bad_data
        det_rebate     = rebate_determined
      TABLES
        xkomfk         = w_xkomfk
        xthead         = w_xthead
        xvbfs          = w_xvbfs
        xvbss          = w_xvbss
        xvbrk          = w_xvbrk
        xvbrp          = w_xvbrp
        xvbpa          = w_xvbpa
        xkomv          = w_xkomv.
    I get the price from the table xvbrp.
    Thanks,
    Alexis

  • Func module/bapi  for invoice creation

    Any function module for invoice creation WITH REFERENCE TO A SALEORDER. ??

    Hi,
    check this FM:GN_INVOICE_CREATE or BAPI: BAPI_BILLINGDOC_CREATEMULTIPLE
    check this link also.
    BAPI for creating sales invoice
    Regards
    Appana

Maybe you are looking for