2012 Apr 07 1:10 PM
Hello,
i know the meter reads, which have been used for creating are invoice can be found within the billing document. I am however not so technical involved in such scenario and looking for somebody, who has explored the way how to get the specific piece of information?
There are various questions related to it
1) I only have the invoice ID, so how i need to access specific tables to find the information? Any ABAP example code very welcomed!
2) Is it possible, that you have a invoice document, but no more the related billing document?
3) Is there anything else, which could be problematic?
Thank you in advanced for sharing your experience!
Cheers,
Andreas
2012 Apr 07 9:50 PM
Hi Andreas,
I hope I understood your question properly.
To help you on your first question the database table DBERDLB maps invoice items to billing items. With the billing ID you need to read the table DBERCHZ2 the field ABLBELNR contains the meter reading document ID. You can also use the function module ISU_DB_BUF_PRINT_DOC_SINGLE to read the invoice document. The exporting structure Y_PRINT_DOC contains the table T_ERDZ which contains the invoice items.
If you actually just want the consumption that was invoiced it's probably easiest to read that from the invoice items.
I seriously doubt that the billing document gets archived at a different time than the invoice document. That said I have never had that problem all the utilities companies I worked for didn't archive.
When working with invoice items never assume that the item you re looking for only appears once. There are so many cases where a time slice is created...Always LOOP and add the values. There are probably a few more problems, but they'll be pretty specific. If more problems come up. Ask another question.
Cheers
Adi
2012 Apr 07 9:50 PM
Hi Andreas,
I hope I understood your question properly.
To help you on your first question the database table DBERDLB maps invoice items to billing items. With the billing ID you need to read the table DBERCHZ2 the field ABLBELNR contains the meter reading document ID. You can also use the function module ISU_DB_BUF_PRINT_DOC_SINGLE to read the invoice document. The exporting structure Y_PRINT_DOC contains the table T_ERDZ which contains the invoice items.
If you actually just want the consumption that was invoiced it's probably easiest to read that from the invoice items.
I seriously doubt that the billing document gets archived at a different time than the invoice document. That said I have never had that problem all the utilities companies I worked for didn't archive.
When working with invoice items never assume that the item you re looking for only appears once. There are so many cases where a time slice is created...Always LOOP and add the values. There are probably a few more problems, but they'll be pretty specific. If more problems come up. Ask another question.
Cheers
Adi
2012 Apr 09 7:14 AM
Hi Andreas,
See if the below steps helps you:-
1) Go to table ERDK, give the Invoice document number and get the contract account number from it
2) Use this contract account number in table EVER, and get the Installation number
3) Use this Installation number in Table EABLG, and get the Int Mr Doc ID Number.
4) Use this Int Mr doc ID No in table EABL as input and you can get details of Meter Read for this particular BP/Device related to the INV Doc you looking for.
I hope it will help you in some way.
Regards
Sachin
2012 Apr 10 5:59 PM
Hi,
@Adi I will explore your option, sounds reasonable
@Sachin
I miss somehow the logical link between invoice & meter read?
As I understand, you try to map somehow a meter read document to a invoice document, but your approach does not sound so logically?
I try to comment the steps in the same order as you proposed
1) -
2) THere could be logically more as one installation and in parallel also outdated installations. This
3) Which meter read doc-id should be taken, if there are multiple entries? As I know, there would beno indicator, that a meter read was taken for billing
3) -
Furthermore i actually expect, that meter reads are stored as installation act (EABL). This is not the case for all scenarios as e.g. IS-U Companies store their interval oder smart meter reads somewhere else. Furthermore I am not sure, if the meter read itself does indicate which consumption actually was charged in the document. Some system do e.g. estimate the consumption and hence different values are used.
The best chance I had in mind was, that I figure out how to access the details of the billing document. In such document should be the actual consumption amount stored.
2012 Apr 11 7:15 PM
Hi Andreas,
The best chance I had in mind was, that I figure out how to access the details of the billing document. In such document should be the actual consumption amount stored.
The invoice document in end effect is nothing more than a mapping of billing doc items to an invoice document plus invoice document header ( table ERDK). The ERDLB database table holds that mapping and just points to the billing document items.
Cheers
Adi
2012 Apr 12 6:03 AM
Hi,
@Adi- Excellent-- good thinking.
@ Andreas- In addition to the way suggested by Adi.
The consumption can be determined by from the table 'DBERCHZ" which is of Billing document lines.
The MR results are stored in the field predecimal places, which are available in the DBERCHZ table.
The difference between the MR results of specific two months will give the consumption of a particular month. From all above discussion this way looks simple. may be you can take help of a ABAPer to link all this data.
Thanks to Adi again for knowledge addition and to Andreas for putting such a vaulable question.
Best Regards
Sachin