Get invoice list

Hi all
        I have come accross an anomaly while testing invoice list. The following is my code for getting the invoice list. The problem its that when i test it with customer no 1000 it displays invoice list of 1050 too. This happens ONLY for cutomer no 1000, testing with other entries gives the desired result. Is there anything that i am doing wrong w.r.to the coding part? Thanks
FORM get_invoice_list  TABLES   pt_customer_list
                                    TYPE /artec/msf_tab_cust_list
                                pet_invoice_list
                                    TYPE /artec/msf_tab_invoice_list
                                pet_return
                                    TYPE bapiret2_t
                         USING pv_open_invoice
                                    TYPE /artec/msf_dte_flag
                               pv_close_invoice
                                    TYPE /artec/msf_dte_flag.
  TYPES:BEGIN OF ty_cus_name,
    cus_no TYPE kunnr,
    cus_name TYPE name1_gp,
    END OF ty_cus_name.
*-- Declaring internal table
  DATA:
        r_fkdat   TYPE TABLE OF ty_fkdat,
        lt_vrkpa  TYPE TABLE OF ty_vrkpa.
*Declare a date range table.
*  DATA: r_rfbsk TYPE TABLE OF ty_rfbsk. "#EC NEEDED
*-- Declaring workarea
   DATA:  lw_fkdat     TYPE ty_fkdat,
*         lw_vbrk      TYPE ty_vbrk, "#EC NEEDED
         lw_vrkpa     TYPE ty_vrkpa,
*         lw_rfbsk     TYPE ty_rfbsk,
*         lw_cust_list TYPE /artec/msf_str_cust_list, "#EC NEEDED
         lw_invoice_list TYPE /artec/msf_str_invoice_list,
         lw_datcfg        TYPE /artec/msfdatcfg.
*-- Clearing export table
  CLEAR: pet_invoice_list[], pet_return[] .
*-- Get closed invoices within the date range.
  IF  pv_close_invoice IS INITIAL AND
      pv_open_invoice IS NOT INITIAL.
*-- Get open invoices within the date range.
  ELSEIF pv_close_invoice IS NOT INITIAL AND
         pv_open_invoice IS INITIAL.
    SELECT SINGLE * FROM /artec/msfdatcfg "#EC *
           INTO lw_datcfg
           WHERE type = /artec/msf_cl_common=>gc_price_list ."'PRICE_LIST'.
    lw_fkdat-sign = /artec/msf_cl_common=>gc_sign_i.
    lw_fkdat-option = /artec/msf_cl_common=>gc_option_bt.
    lw_fkdat-low =  sy-datum - lw_datcfg-retain_day .
    lw_fkdat-high = sy-datum.
    APPEND lw_fkdat TO r_fkdat.
    CLEAR lw_fkdat.
*--Fetch both the open and closed invoices
  ELSEIF pv_close_invoice IS NOT INITIAL AND
         pv_open_invoice  IS NOT INITIAL.
  ELSEIF pv_close_invoice IS INITIAL AND
         pv_close_invoice IS INITIAL.
  ENDIF.
* Select required entries from the database view /artec/msf_v_inv
  SELECT kunde
         parvw
         vkorg
         fkdat
         vtweg
         fkart
         kunnr
         kunag
         vbtyp
         ernam
         vbeln
         netwr
         waerk
  FROM /artec/msf_v_inv "Database view of vrkpa and vbrk
      INTO TABLE lt_vrkpa
      FOR ALL ENTRIES IN pt_customer_list
      WHERE kunde = pt_customer_list-customer_no
      AND fkdat IN r_fkdat AND
      rfbsk = /artec/msf_cl_common=>gc_close_invoice.
  LOOP AT lt_vrkpa INTO lw_vrkpa.
    lw_invoice_list-cust_no      = lw_vrkpa-kunnr.
    lw_invoice_list-invoice_no   = lw_vrkpa-vbeln.
    APPEND lw_invoice_list TO pet_invoice_list.
    CLEAR:lw_invoice_list.
  ENDLOOP.
Sort pet_invoice_list by cust_no invoice_no.
Delete Adjacent Duplicates From pet_invoice_list  comparing all fields.
  IF pet_invoice_list[] IS NOT INITIAL.
    DELETE pet_invoice_list WHERE invoice_date BETWEEN '19900101' AND '20090101'.
  ENDIF.
ENDFORM.

hard to read the code, but did you check to see if FOR ALL ENTRIES IN pt_customer_list  has rows in the PT_customer_list?  If you didn't I'd suggest a review of documentation of FOR ALL ENTRIES.  If you did make sure pt_customer_list isn't empty, then disregard.

Similar Messages

  • Base on invoice list document no. how to get MATKL field

    my question is regardsing, based on the provided invoice list document number, how to get MATKL (merchadise category) field from MARA table or other table. Thanks

    In the invoice document if you have the material number, MATNR, then take that and using that you can get the MATKL from the MARA table.
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • Any option to get the list of Invoice with respect to Sales Area

    Dear All,
    Is there any option to check the list of Invoices with respect to the Sales area.
    Because, in VF05, we are getting the list either for a Payer or a Material.
    I want to see the list of Invoices for a Sales area. I mean, it should be similar to VA05, where we can get the list of Sales Orders even without providing the Customer and Material information.
    Reagrds,
    Mullairaja

    HI
    Use the T code VF05N and select the option Bill documents in Fi
    Here you can get the list of invoices
    Try with MC+2
    regards
    Prashanth
    Edited by: Prashanth@SD on Nov 11, 2010 9:44 AM

  • Buss.Area not getting transferred to invoice list

    Hi Gurus,
    hope u all r doin good outhere, i have an issue with bussiness area not getting populated or transferrred for Invoice list that are released to accounting .
    the scenario here is: in the accounting overview under the Billing Invoice(VF03) we are able to see the buss area against the customer acct line item and the GL acctline item, but when we go into the Accounting overview under Invoice List (VF23), the Buss area is not getting populated against the Customer lineitem..., we are not able to figure out what is missing...is it in the configuration...,
    we are on 4.6 , and we have an OSS note 69499 (given below) on this issue which says
    Summary
    Symptom
    Business areas are not transferred for invoice lists that are released to financial accounting.
    Additional key words
    GSBER TVTA VF21 SAPMV62S factoring discount
    Cause and prerequisites
    This was not programmed
    Solution
    A solution is only available in the standard system as of Release 3.0D.
    You can make the attached advance correction that uses a user exit.
    In this solution, the business area is copied from the sales area table (TVTA) for the sales area of the invoice list header. A business area determination on plant/division level (T134G) is not possible because the item information of the individual billing documents is no longer available in the invoice list.
    Source code corrections
    and we have contacted SAP , some one from SAP side told that the program is existing in that userexit already with our 4.6c,
    someone has suggested that in OB65 the check box is not activated against the comp code i use, but i have found that to be the check mark for the financial statements at the buss area level..will that make any diff to my issue... is it something with the FI part or SD part which do you think is incorrect ....any kind of suggestions pertaining to this issue .here would be helpful.
    some body please throw some light on it, i would be very much grateful.
    Thanks in advance
    Jay

    Hi Laxmipathi sir,
    as you said i went in the bussiness area account assignment and checked it and foound that the Sales area, distributin channel and division are assiogned to rule called 003 -Buss Area Det.from sales org/dist.channel item div.
    but there are other two.which were not assigned.
    001-buss area det.from plant/dividion(T134G)
    002-buss area det.from Sales area (TVTA).
    so do you think this is the reason it is not picking it up in the invoice list,
    i have discussed with one of the SD person here he said even though you don't assign them it shoudn't bother because the buss area is getting picked in invoice
    so could you please tell me what should i ask that person or what i have to tell them about this.
    thanks
    Jay

  • SAP MM - Table name to get RG23Part1&2 Invoices Lists

    Dear Experts
    Can Anybody please give me the table name for Excise Invoices RG23Part1&2 to get the all excise invoices list
    Thanks in Advance

    HI,
    U Can try in following Tables
    J_1IPART1
    J_1IPART2
    J_1IRGSUM
    Hope Help U !
    REgards,
    Pardeep Malik

  • Requirement of invoice list in case of a proforma invoice generation.

    Dear Experts,
    I have a case where the customer is indulged with the export sales & he had delivered the excisable goods to his customer (or we can also consider it under STO as one of the above case) & wants to arise a proforma invoice in context to this transaction with the delivery document being taken as the reference document in the billing screen VF01; where, as I have already mentioned that the PGI has been done. Now the problem is this that the billing document is not getting generated with an information log that, '_The invoice list cannot be determined_'. Now I am not able to understand that why this is happening? This was the delivery related with a single line item.
    I went for changing the billing relevance field at VOV7 from 'A' to 'J' & even tried by changing the copying requirement from '010' to '311' at VTFL, from LF to F8 (as this is normally followed during the issue of free samples & subseqyent free of charge deliveries); but was not able to get the required output.
    What to do? Kindly assist.
    With regards,
    M.S.Kumar.
    Edited by: M.Santosh.Kumar on Jan 28, 2011 7:25 AM

    1) The document flow is like this that between the two plants for e.g. 1000 & 1100 under the same company code  the stock transfer needs to take place.
    2) Plant 1000 is devoid of the required amount of stock, hence it raised an enquiry for the aforesaid amount of stock with plant 1100
    3) Plant 1100 confirmed the availability of stock
    4) Plant 1000 raised a purchase order with plant 1100
    5) Plant 1100 raised the sales order for the required quantity of stock with plant 1000, & has done the PGI under delivery.
    6) Now the plant 1100 wants to raise one proforma invoice with respect to the delivery of goods being done to the corresponding plant 1000 & one commercial invoice for the payments to be made.
    7) The processing from raising the purchase order to the delivery of the goods to the respective plant has already being performed.
    8) At the moment of creating the proforma invoice with billing type F8, the system is throwing an error message that it is not able to generate the billing document because of the reason that the invoice list date cannot be determined.
    or else in the other way, in simple manner what needs to be done when simply the billing document is not getting generated in context to a delivery document because of the reason that the invoice list date could not be determined. Does this have to do anything with the POD time frame or the pricing conditions being defined under the pricing procedure which has not been followed upon while processing the sales order?
    With regards,
    M.S.Kumar.

  • Vf21 - invoices list - RV

    hi,
    when I try to post invoice list in accounting I get an error from the system warning me that it can't find document type RV!
    I checked it and I figured out that I really miss this document...so:
    1) should I create it ??? and how???
    2) should I set a different parameter in VOFA for invoice type LR in the field document type?
    thank you in advance
    mauro

    RV is an SAP Delivered standard. How come its not on your list? You will not find it in VOFA, you will find it in OBA7.
    For Billing Type LR, the Document Type field is Blank and none of my billing doc postings have errors. If nothing else works, try speaking to an SD consultant... cheeky!
    Cheers.

  • Invoice List - Shipping Point (ShPt) VF24

    Good day, I run a invoice list t-code VF24, I get the results and because I need to process invoices for a same plant. So when I process the invoices into 1 invoice, everything works fine. When I cancel the invoice that I have just created, the ShPt(shipping point) does not show on the Invoice list (VF24). Can you advise me urgently on what needs to be done.

    The reason for this is that the invoice list has
    no item data. Please look at VBRP for any invoice list using transaction
    SE16.You will see there is no data, there is only header data recorded
    (VBRK).
    So as no item data was copied from the invoice to the invoice list
    (via item copy control), the shipping point data (an item field) is
    not copied across.  This is standard.
    So when you then cancel the invoice list, there is no shipping point
    data to write back to VKDFS.
    Please run the report RVV05IVB to resolve this

  • Proforma invoice list

    Hi,
    where we can get the list of all the proforma invoice that generated for a particular period ?
    In vf05 i am giving the billing type f5 but no data are coming.
    Thankx in advance.
    Regards,
    Satya

    Dear Satya
    You cant generate proformas in VF05.  You have to run SE16, input Table VBRK for Header related datas and VBRP for Item related datas and execute.
    If this is going to be the permanent requirement, you can develop a zee report with the help of ABAPer fulfilling the requirement.
    thanks
    G. Lakshmipathi

  • How to include old invoices in the invoice list

    How to Include old billing documents in the invoice list.
    TO be more clear:-
    I created 20 invoices in the monthof JAN
    I maintained the factory calender in the payer master in the month of Feb 1st and created 10 more invoices in this month.
    So the system is considering only the invocies which were generated after I maintained the factory calender (Only feb invoices).
    Is there any process to include the previous invoicies (Jan invoices)  also to get include in the invoice list.
    Help me in this regards.
    Regards,
    Mallesh.

    It is not possible.
    Regards,
    Rajesh Banka

  • Finding out Idoc number of the Invoice List

    Hi!
    how to find out Idoc numberr if I have number of Invoice List?
    For example, I have number of Invoice List for checking it in tcode VF22, but how to get Idoc number of the Invoice List in order to check it in WE02?
    Will reward,
    Mindaugas

    Hi,
         Use NAST with the invoice to get the latest record for that output type..
    use the table CMFP to get the IDOC number..The combination is
    NAST-CMFPNR = CMFP-NR..
    Then in the column CMFP-MSGV1 you can find the idoc number
    <b>Reward points</b>
    Regards

  • Regarding Invoice list dates.

    Hi Experts,
    I have one requirement where i need to get the next invoice list date based on invoive list dates-profile(KNVV-PERRL) of the invoice list sold-to-customer(VKDFS-KUNNR) and I need to update the updated date to VKDFS-FKDAT.
    Please provide me with ideas or some Function modules to get the invoice list date and the FM for updating VKDFS-FKDAT.

    the payer is not equil to the sold to party and bill to party
    There is no such standard report to meet this requirement.  You have to develop the logic considering VF05
    thanks
    G. Lakshmipathi

  • Excise Invoice List-Pending for ARE document creation

    Dear All,
    Is there any standard Tcode for getting the list of excise invoice which are pending for ARE documents creation or with the status of ARE documents.
    Thanks & Regards,
    Antima

    Hi,
    No there is no standard report available for this requirement.  You may need to develop a Z report.
    J1ARE_AGE gives u the status after creation of ARE1.
    Thanks
    Krishna.

  • Report : invoice list

    hi
    In my function specs
    1) pass vbeln to vbpa, partner role = 'WE' & 'RG' and get the ship-to-party and payer (kunnr) from vbpa table for each billing document from the first line item of the invoice. if ship-to-party code is entered in selection screen the retain records where ship to party = ship to party in selection screen.
    2) if radio button is :
    "invoice list is generated " then
    check if invoice list is generated by passing vbeln to vbrl table where vbeln=vbrl-vbelen_vf.
    retain records which are not found in vbrl table.
    i already declared radio button i want coding for the above two points.
    thanks

    You may have to refer the following table -
    EKBE (Field - PO number, Material document field will give GR / IR number both with PO history category field with value E & Q, Posting date of Invoice, Material)
    You may have to use table EKPO/MARA for bringing the material group.
    You may have to use table EKKO for bringing the vandor field.
    I hope it clarifies your requirement.
    If it gices you valuable input...i would appreciate if you reward the answer with appropriate points.

  • Invoice list based on sold to party not

    Hi all,
    As per my client requirement, Sold to party is one only but there will be different bill to party & Payer.
    Only one main sold to party is paying all bills generated on behalf of different payer. The reason to make payer is, client wants accountability on payer wise. So sold to party is one & different payer.
    Now Ii require to raise a invoice list based on sold to party wise not payer or bill to party wise.
    Invoice list getting spillted because of different partner.
    How to do that.
    Please suggest me as soon as possible.
    Thanks
    Shobhit

    Hi Shobhit
    To meet your requirement  you need to go with a enhancement then your requirement will be fulfilled. So you need to discuss with your Technical team also regarding this issue
    Thanks and Regards
    Srinath

Maybe you are looking for

  • Roaming and 2.4 vs 5.0 on 1250 series AP design help

    Hello, I will be upfront and honest and state that although I am familiar with some wireless technologies, most of this stuff is a mystery to me. I have done some homework and have researched quite a bit, but have ind of hit a wall. I have been hande

  • Character encoding again

    Hi, i havent got any answer so i try to ask again... I have created a page from Data Controls. I have created parameter form. And table. Detail is showed at the bottom of page (there is shown current row through #bindings. . . Everything works fine w

  • Mavericks Finder icons out of sync

    So since installing Mavericks, I'm noticing that the Finder's Cover Flow isn't keeping up with me when I move or delete a file. In Cover Flow, it shows the removed file's icon as still being there, and when I scroll through the remaining files, Cover

  • HT1171 forward delete button

    where is the forward delete button? I don't have it on my wireless bluetooth keyboard?

  • I can't change my iCloud ID and password to match my Apple ID and password

    iPad with iOS 8.0.2 Problem:  My original ID was my email talk21 and was the same for iCloud and Apple.  Talk21 is no longer available and I have changed my Apple ID to hotmail.  However, my iCloud ID will not change from talk21 and I am constantly b