Create billing document from IDOC INVOIC01

Hi Experts,
I created a function module to extend IDOC_INPUT_INVOIC_MRM. After created successfully the invoice from this inbound idoc, I tried to create a billing document by code below:
get sale order number from purchase order *****************************
    CALL FUNCTION 'BAPI_PO_GETDETAIL'
      EXPORTING
        PURCHASEORDER                    = lw_tfrseg-ebeln
        ACCOUNT_ASSIGNMENT               = 'X'
     TABLES
        PO_ITEM_ACCOUNT_ASSIGNMENT       = lt_acc_***
****get sale order details*******************************************************
     CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
      EXPORTING
        I_BAPI_VIEW                   = lw_order_view
      I_MEMORY_READ                 =
      TABLES
        SALES_DOCUMENTS               = lt_sales_key
        ORDER_HEADERS_OUT             = lt_ord_headers
        ORDER_ITEMS_OUT               = lt_ord_items
        ORDER_SCHEDULES_OUT           = lt_ord_schedules
        ORDER_BUSINESS_OUT            = lt_ord_business
        ORDER_PARTNERS_OUT            = lt_ord_partners
        ORDER_ADDRESS_OUT             = lt_ord_address
      ORDER_STATUSHEADERS_OUT       =
      ORDER_STATUSITEMS_OUT         =
        ORDER_CONDITIONS_OUT          = lt_ord_cond
****Fill billing data in*******************************************************
           lt_bill_data-SALESORG = lt_ord_headers-sales_org.
         lt_bill_data-DISTR_CHAN = lt_ord_headers-DISTR_CHAN.
         lt_bill_data-DIVISION   = lt_ord_headers-DIVISION.
         lt_bill_data-DOC_TYPE   = lt_ord_headers-DOC_TYPE.
         lt_bill_data-ORDBILLTYP    = lt_ord_headers-ORDBILLTYP.
         lt_bill_data-BILL_DATE    = lt_ord_business-bill_date.
         lt_bill_data-SOLD_TO    = lt_ord_headers-SOLD_TO.
         lt_bill_data-ITEM_CATEG    = lt_ord_items-ITEM_CATEG.
         lt_bill_data-ACCTASGNMT    = lt_ord_business-ACCNT_ASGN.
         lt_bill_data-PRICE_DATE    = lt_ord_business-PRICE_DATE.
         lt_bill_data-COUNTRY    = 'US'.
         lt_bill_data-PLANT    = lt_ord_items-PLANT.
         lt_bill_data-BILL_TO    = lw_partner_bp-customer.
         lt_bill_data-PAYER    = lw_partner_py-customer.
         lt_bill_data-SHIP_TO    = lw_partner_sh-customer.
        REF_DOC    = lt_sales_orders-DIVISION.
         lt_bill_data-MATERIAL    = lt_ord_items-material.
         lt_bill_data-REQ_QTY    = lt_ord_items-req_qty.
         lt_bill_data-CURRENCY    = lt_ord_items-currency.
         lt_bill_data-SHORT_TEXT    = lt_ord_items-short_text.
         lt_bill_data-TAXCL_1MAT    = lt_ord_items-TAX_CLASS1.
        REF_ITEM    = lt_sales_orders-DIVISION.
        STAT_GROUP    = lt_sales_orders-DIVISION.
         lt_bill_data-NO_MATMAST    = 'X'.
         lt_bill_data-ADDR_NO    = lt_ord_address-ADDRESS.
        lt_bill_data-TITLE    = lt_ord_address-DIVISION.
         lt_bill_data-NAME    = lt_ord_address-NAME  .
         lt_bill_data-NAME_2    = lt_ord_address-NAME_2.
         lt_bill_data-POSTL_CODE    = lt_ord_address-POSTL_CODE.
         lt_bill_data-CONSUMCTRY    = lt_ord_address-COUNTRY.
         lt_bill_data-CITY    = lt_ord_address-CITY.
         lt_bill_data-DISTRICT    = lt_ord_address-DISTRICT.
         lt_bill_data-STREET    = lt_ord_address-STREET.
         lt_bill_data-REGION    = lt_ord_address-REGION.
         lt_bill_data-PROD_HIER    = lt_ord_items-PROD_HIER.
         lt_bill_data-SALES_UNIT    = lt_ord_items-SALES_UNIT.
         lt_bill_data-PROFIT_CTR    = lt_ord_items-PROFIT_CTR.
        TAXJURCODE    = lt_sales_orders-DIVISION.
         lt_bill_data-PURCH_ORD    = lt_ord_headers-PURCH_NO.
         lt_bill_data-DOC_NUMBER    = lt_ord_items-DOC_NUMBER.
         lt_bill_data-ITM_NUMBER    = lt_ord_items-ITM_NUMBER.
        ORIGINDOC    = lt_sales_orders-DIVISION.
        lt_bill_data-ITEM    = lt_sales_orders-DIVISION.
         lt_bill_data-CREATED_BY   = sy-uname.
        MATERIAL_EXTERNAL = lt_sales_orders-DIVISION.
        MATERIAL_GUID = lt_sales_orders-DIVISION.
        MATERIAL_VERSION = lt_sales_orders-DIVISION.
         lt_bill_data-INCOTERMS1  = lt_ord_business-INCOTERMS1.
         lt_bill_data-INCOTERMS2  = lt_ord_business-INCOTERMS2.
         lt_bill_data-EXCHANGE_RATE = lt_ord_business-EXCHG_RATE.
         lt_bill_data-PAYMENT_TERMS  = lt_ord_business-PMNTTRMS.
         lt_bill_data-HG_LV_ITEM   = lt_ord_items-HG_LV_ITEM .
******call bapi function to create billing document********************
  CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
   EXPORTING
     CREATORDATAIN         = lw_creator
     TESTRUN               = lc_testrun
     POSTING               = lc_posting
    TABLES
      BILLINGDATAIN         = lt_bill_data
    CONDITIONDATAIN       =
    CCARDDATAIN           =
    TEXTDATAIN            =
      ERRORS                = lt_bill_errs
      RETURN                = lt_bill_retu
      SUCCESS               = lt_bill_succ
A return message in the table lt_bill_retu:
"This item is not relevant for billing!"
Anyone can tell me why? I think this problem be generated from the step "fill billing data" but I don't know where.
Pls help me!!!
Thanks,
Gy

Hi,
In the condition data, I want to add new condition type as below:
<<  Add new condition type
    CLEAR: lt_cond_data.
    lt_cond_data-COND_TYPE = 'ZHD0'.
    lt_cond_data-COND_VALUE = mrm_ship_charge-summe.  " amount of shipping charge
    lt_cond_data-COND_CURR = mrm_ship_charge-waerq. " USD
    append lt_cond_data.
*>>
But I created successfully billing document, this condition type is not appear in the billing view by transaction VF03.
Could you help me to find out the fault?
Thanks,
Gy

Similar Messages

  • Cannot create billing document from sales document

    Hi,
    i am trying to create billing document from the created sales document.
    But the billing document is not generated. I was getting  the error - ' Document is blocked from billing'.
    SO, i changed the billing block and left it blank, and when  I tried to create the document again, I got another error " Create billing document" not allowed (uSER STATUS   ST01, Object VB006000071200000).
    Please help me out,

    Dear Priyam,
    Attached are the screen shots, go through them.
    I believe you need to change the status in the Sales order status(Object status).
    click on Object status
    Regards
    Shaik

  • Hi , I am not able to create billing document from the delivery document .

    Hi,
    I am facing one problem i am trying to create billing document from delivery document but it is giving error " Payer" and Sold to party not found ".
    in my Delivery Document field partner tab is showing only ship to party it should show payer and sold to party also .
    Although it is maintained in customer AG.
    can any one help in this ????
    thanks !!!!!!!!!!

    Hi Payal,
    1.u check whether u have maintained[entering actual number] payer and bill to party in sales order[ which is copied from customer master].
    2.and check partner determination procedure for delivery document.
    more important is u wouldnot have maintained partner determination procedure for delivery header.[spro->sales and distribution->basic function->partner determination->partner determination for delivery]
    Regards
    Sharad

  • Create Billing Document from Sales Order (Without Delivery)

    Dear Experts,
    Pls note, presently we are creating Billing Document (VF01) from Outbound Delivery Number after Post Good Issue. All sales Document like Billing Document, Output Type, Invoice Type has been configured for this process and we are doing this without any error. Fyki, we have configured lots of Z Order, Billing & Delivery type to do this processes.
    But for one of this order type we need not do any delivery. We want to create Billing Documents from sales order directly (without doing any Outbound Delivery).
    So, would u pls advise the steps how can we configure and assign Order Type, Billing Type or any other type  to meet above requirement.
    Thanks in advance.
    Best Regards.
    Ripon

    Hi
    There are two most important configuration:-
    1) In VOV8 for your Order Type maintain the Order Related Billing Document
    2) Maintain the Copy control setting in VTFA betwwen your Order Type and billing Type.
    Also note that if your line item is not require to be delivered then for your Item category maintain (in VOV7) not relevant for delivery and not relevant for scedule line.
    Regards
    Amitesh Anand
    Edited by: Amitesh Anand on May 24, 2010 5:09 PM

  • Changing billing document date while creating billing document from vf01

    Hi gurus,
    I have requirement to change billing doc date while creating billing document from VF01.
    here I have to consider goods issue date eq billing date.
    caluculating billing date = Goods Issue + Goods in Transit duration time.
    I have done everu thing but I cant update the caluculated date, iam using the following enhancement
    Enhancement:SDVFX001
    Function Module:EXIT_SAPLV60B_001
    Include:ZXVVFU01 which are part vf01.
    here iam sending the calculated date to VBRK-FKDAT
    move cal_date to vbrk-fkdat.
    need help how to update the calculated date to VBRK-fkdat i.e billing document date
    Regards
    Bhaskar

    Hi
    No! That exit is not good for your issue
    U can use the user-exit USEREXIT_NUMBER_RANGE_INV_DATE  defined in RV60AFZC
    Max

  • Change in document type while creating billing document from sales order

    While creating billing document from Sales order it is creating with document type RV which is standerd one but i want to change Document type.
    How can i change it?
    Regards
    Raj

    Hi
    If you use another existing document type, check that it has a number range suitable to you.  Else create a new 'z' type and assign an entirely new number range, not used in the other doc types.
    It is useful to make the FI document number the same number.  If I understand from the forums, the FI number range must be external.  Search the forum for this.  It is very useful for the Finance people.
    Kind regards
    Dawn
    Edited by: Dawn Verrell on Sep 9, 2010 4:10 PM

  • Creating billing document from billing request PO number

    Hello All,
    I am creating Billing document ( Debit Memo) from BiCS Billing Reqeust ( kind of Sales order) , that time the PO of BR is getting updated on BIlling documents's Screen ( at item level---> on PO data tab) butsometimes  it is not getting updated in VBRK table fields is BSTNK_VF .
    Thanks  in advance.
    Edited by: busam nandana on Sep 8, 2010 10:20 AM

    did you try using BAPI,
    BAPI_BILLINGDOC_CREATEMULTIPLE.
    also read Function Module Documentation on this BAPI's usage.

  • Create Billing Document From Sales Order

    I have used a program from this form to create a sales order - works great. Now, all I want to do is add some code to create a Billing Document in this program right after I have create the sales order. Can anyone help.

    check this thread.
    Re: BAPI for creating sales invoice

  • Please help with this bapi for creating billing document

    I want to create a billing document using the bapi:  BAPI_BILLINGDOC_CREATEMULTIPLE from a delivery number and NOT A SALES ORDER.
    Please tell me what  details to be passed to table  BILLINGDATAIN . Please don't provide me function module documentation because it does n't help me create billing document from delivery. A sample source code or suggestion to what to pass would be really great!
    Thanks,
    Krishen
    P.S. Points assured for helpful answers and thanks for your time.

    Hi,
    Try this..
    DATA: s_vbap TYPE vbap.
    TABLES: vbak,vbap,likp, lips.
    DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.
    DATA: t_conditions TYPE STANDARD TABLE OF bapikomv WITH HEADER LINE.
    DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.
    DATA: t_ccard  TYPE STANDARD TABLE OF bapiccard_vf WITH HEADER LINE.
    DATA: t_errors TYPE STANDARD TABLE OF bapivbrkerrors WITH HEADER LINE.
    DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE
    PARAMETERS: p_vbeln TYPE vbeln.
    select single * from likp
                    where vbeln = p_vbeln.
    SELECT SINGLE * from lips where
                    vbeln = likp-vbeln.
      t_billing-salesorg   = likp-vkorg.
      t_billing-ref_doc     = likp-vbeln.
      t_billing-ref_item    = lips-posnr.
      t_billing-doc_number     = p_vbeln.
      t_billing-itm_number    = lips-posnr.
      t_billing-ordbilltyp  = 'ZINV'.
      t_billing-price_date = sy-datum.
      t_billing-ref_doc_ca  = likp-vbtyp.
      t_billing-material    = lips-matnr.
      t_billing-plant       = lips-werks.
      APPEND t_billing.
    CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
      TABLES
        billingdatain         = t_billing
        return                = t_return
        success               = t_success
    commit work.
    Thanks,
    Naren

  • Can we create multiple billing document from delivery with single line item

    can we create multiple billing document from delivery with single line item

    Hi
    Please check the link
    [can v create multiple billing document from delivery with single line item]
    and as Lakshmi said, check the forum before posting an issue.
    Regards
    AA

  • Can v create multiple billing document from delivery with single line item

    can v create multiple billing document from delivery with single line item

    Dear Sandesh
    Go to VOV7, select your item category.  In this maintain K  for Billing Relevance
    Now go to VF01, give the delivery number and do not press Enter.  Instead click on Selection list on the next screen, select the items you want to bill and click copy and continue if necessary
    thanks
    G. Lakshmipathi

  • Create SD Billing document from Vistex Claim Request or Billback document

    Is there a way to create SD Billing document(VF01) from Vistex Claim request or Billback document. Our business is requesting that they do NOT want to settle the billback in Vistex instead want to create a SD Billing document.
    I found a check box 'create billing document' in Vistex Claim request document type configuration - but that does not seem to do anything at all.  What is this for? does anyone know? 
    Is there another way Vistex allows to create SD billing document ?
    Please help.
    thanks
    Suren

    Hi,
    The sole purpose of Vistex is to create chargeback/billlback documents with reference to a Billing document in SD.
    After create the CB/BB docs in Vistex, settlements can be done only in Vistex and cannot be brought back to SAP.
    Other option is to create a Credit/Debit memo as applicable instead of doing the settlements in Vistex, however tracking the document flow and reporting will turn out to be more complex.
    In any case, take the help of an ABAP per who would suggest if any workaround in the form of a dewvelopment is possible or not.
    Regards,
    Amit

  • Error while creating billing documents

    Hi,
      While creating billing documents I am getting error message as 
    Maintain customizing for excise and series group determination
    Message no. 8I619
    I have check the setting for CIN it is OK excise and series group are maintain properly so what can be the proble,
    regards,
    zafar

    Hi,
    Check once again customizing
    Maintain Series Group - In this IMG activity, you define the different excise series groups within your company. Series groups allow you to maintain multiple number ranges for the outgoing excise documents. Based on excise regulations and exemptions from the authorities you can maintain multiple number series for outgoing documents. But each of these series has to be declared to the excise authorities.
    - Define excise series groups based on type of outgoing document
    - Assign series group to excise registration ID
    - If no financial postings are required for an Excise invoice in this seris group then you tick the 'No utilization' indicator.
    - If the CENVAT has to be paid immediately and you need not wait for the Fort nightly payment then mark the 'Immediate Utilization' Iindicator. Example - You could define two series groups, group 001 for excise invoices, and group 002 for 57 F4 documents.
    - No account postings for CENVAT in sales cycle
    - No utilization Flag
    If you do not need any CENVAT utilization for an excise invoice but would like to just generate an excise invoice then you need to mark this indicator.
    If the flag is checked then system will create an Excise invoice in the given Series group but there will not be any account postings or Part2 postings.
    Immediate Utilization of CENVAT - Specifies that when you create an excise invoice, the system immediately pays the amount from CENVAT and creates the Part II entry. Such invoices will not be listed for fortnightly utilization.
    If you have both fortnightly and immediate utilization for the same excise group, the account determination within CIN IMG should point to the ED interim account.
    Thanks
    Chidambaram

  • 'update was terminated' while creating billing document VF01

    Hi all,
             i need a solution urgently ..except for paticular document no all documents that i post using VF01 create successfully document no.
    but for a paticular document no(may be it is of some type that i am unable to) while creaing billing document no it gives a message 'document created successfully' ,but when i try to click any button after that e.g BACK it shows a messge 'Update was terminated  for author ....' in my inbox. and vf03 shows the documentdoesn't exist.
    in st22 i checked one dump . when i gave a break point at that point the cursor never reached the code.
    I also checked SM13 and it showed all fms as init. and one fm 'RV_MESSAGE_UPDATE ' as error . i aws unable find the fm in the main program .
    one more thing when i create bill document for other document type it shows messge 'Document saved ....(no accounting document created)' but for this one i am getting messge 'document saved.......' .
    I asked one collegue he told me might be some OSS notes required for it . i am working on a unicoded system ECC 6.0  version.but he is not sure .
    Has any body faced the same problem..and what was the soln....if oss notes are required than how could i find it..and what was the no...........
    THANKS IN ADVANCE ...................

    THANKS  for the reply.
    i am new to sap .can u tell me in detail where actually i can check for number range of the document . one more when i checked the sm13 and  started debugging it gave me for a certain character set  (may be in chineses) present in the table ,the transfer command gives a dump. now the problem is it is too long 132 and don't no forwhich character it gives an  dump.how can i check the characters maintained in the system. it gives a dump   CX_SY_CONVERSION_CODEPAGE   ,At the conversion of a text from codepage '4102' to codepage '4110':      
    i am not sure this causes the mesages 'Updation was terminated' . what u people think.
    thanks ..

  • Creation of Multiple billing documents from a Single sales order

    Hi Experts,
    How can we create many billing documents from a Single sales order.
    Will it be possible we create a Sales order with bigger quantity and then keep on creating partial billing documents based on the billing quantities and dates.
    Request you all for a solution.
    Thanks
    Montee

    Hi ,
    1. If Qty is one number - based on value of the order - it is possible to create different billing doc.'s based on billing date and value using billing plan , again these are periodic billing or milestone billing
    2. Using Contract process- create material /qty contract- release partial qty  by creating release document and create billing document w.r.t to contract or release document (sales order)
    thanks
    Chidambaram

Maybe you are looking for

  • Cant find HPC6280 IP address

    I'm trying to find my printers IP address so that I can figure out how to get my phone to print to it, and I've been reading how to do so but nothing  I've tried has worked. I tried printing a Network Config Page but no where on there is an IP addres

  • Jar not running is sarge and apache-ant  shows error of package not found

    Hello, First of all I am not a java programmer. I work in C/C++/C#. Currently I am dealing a game written in java (1.5) using netbeans 5.5.0 under windows xp. My target is to compile in my development machine and run in the clients machine. everythin

  • Is there a way to fade video to black and keep audio going?

    I'm using iMovie 09. What I'm attempting to do is have a long fade to black transition at the end of the project that will obscure the last couple of seconds of video, yet keep the audio going during the fade till it ends. To put it another way, I'm

  • Just about had it with N97 GPS

    I've tried just about everything to get the GPS on my phone working, without success. Even had my phone in repair for 3 weeks, it worked after that. Using 'location' I could get a fix quite fast and pretty precise. But when I restored the data from m

  • Problems uploading files across all browsers and wifi connections?

    Hello I've been having a bit of a strange issue with my MacBook Pro lately, it seems to have problems with uploading images/files onto certain websites. Two recent occasions have been failure to upload image content when signed into the admin area of