2015 Aug 13 9:40 PM
The company that I work for has created a report for the employees to run a report to get the detail usage and sales report by busArea and the report is getting the current meter associated with the business partner. How can I get the report to get the old meter after being changed out in the report? I am very new to ABAP programming. Both the old and new meter can be seen using tcode EL31 but I want to get the same results in the custom report with the meter usage as well. Thanks.
2015 Aug 17 11:11 AM
Hi Shawn,
To get the information of devices which are installed to a particular Installation you can use the below select query.
I am assuming that the code to get the Installation either from Contract Account or Contract is already in place.
1>Pass Installation number (ANLAGE) to EASTL table and get the Logical device number.
2>Get all the Logical device numbers from above step and passed this to EGERH table to get the equipment numbers(EQUNR), this contains the time slice for devices installed to the same Installation.
3>Pass the equipment numbers(EQUNR) to EQUI table to get the field (SERNR), which represent device serial number.
Hope this will help you to fetch the devices and display it in report.
FYI, EL31 represent only the meter read information.
Thanks,
Mohammad.Q
2015 Aug 14 10:03 AM
Hi Shawn,
Check view V_EGER.
With the new equipment number get the device location. Now in the same view with the device location and 1 day before the current slice check for the old equipment number.
Rest all data for the old equipment (meter usage) should work with the code you already have.
Hope this helps.
Cheers,
Rakesh..
sapisurdg.wordpress.com
2015 Aug 17 11:11 AM
Hi Shawn,
To get the information of devices which are installed to a particular Installation you can use the below select query.
I am assuming that the code to get the Installation either from Contract Account or Contract is already in place.
1>Pass Installation number (ANLAGE) to EASTL table and get the Logical device number.
2>Get all the Logical device numbers from above step and passed this to EGERH table to get the equipment numbers(EQUNR), this contains the time slice for devices installed to the same Installation.
3>Pass the equipment numbers(EQUNR) to EQUI table to get the field (SERNR), which represent device serial number.
Hope this will help you to fetch the devices and display it in report.
FYI, EL31 represent only the meter read information.
Thanks,
Mohammad.Q
2015 Aug 18 5:25 PM
Thanks. Like I mentioned, I'm new to SAP. The customer accounts coordinator wants to have all of the readings from the old meter after the change out to the new ami meter. The report is not picking up correct device number and meter readings for the old device that was changed out. She wants to know if the report can be modified to correct the problem. Thanks.
2015 Aug 18 9:53 PM
Shawn:
You need to look at the report logic to see where you are getting the data. Then adjust the logic based on the feedback given. If you have trouble with that, then maybe you should check with someone who knows ABAP or look into some training for that.
regards,
bill.
2015 Aug 17 6:07 PM
You could use this FM ISU_DET_DEVICE_FROM_INST and pass the installation number which should give you back all the devices.
2015 Aug 21 6:47 PM
Use this?
CALL FUNCTION 'ISU_DB_EASTL_SELECT'
EXPORTING
X_ANLAGE = X_ANLAGE
X_AB = X_KEYDATE
X_BIS = CO_DATE_INFINITE
IMPORTING
Y_COUNT = COUNT
TABLES
T_EASTL = T_EASTL
EXCEPTIONS
NOT_FOUND = 1
SYSTEM_ERROR = 2
NOT_QUALIFIED = 3
OTHERS = 99.
2015 Aug 21 7:24 PM
You can use that FM ISU_DB_EASTL_SELECT, however ISU_DET_DEVICE_FROM_INST has much more details about the device than the EASTL select. Its up to you which FM you would want to use, either one should work.
DATA: xy_lt_ger TYPE isu07_twd_gertab_t.
CALL FUNCTION 'ISU_DET_DEVICE_FROM_INST'
EXPORTING
x_anlage = x_anlage
x_keydate = sy-datum
CHANGING
xy_t_ger = xy_lt_ger
EXCEPTIONS
not_found = 1
internal_error = 2
system_error = 3
OTHERS = 4.
2015 Aug 21 9:57 PM
DATA: xy_lt_ger TYPE isu07_twd_gertab_t.
CALL FUNCTION 'ISU_DET_DEVICE_FROM_INST'
EXPORTING
x_anlage = eastl-anlage
x_keydate = sy-datum
CHANGING
xy_t_ger = xy_lt_ger
EXCEPTIONS
not_found = 1
internal_error = 2
system_error = 3
OTHERS = 4.
2015 Aug 25 3:03 PM
It's still not working. I'm not too sure if I programmed it correctly.
2015 Aug 25 3:20 PM
DATA: xy_lt_ger TYPE isu07_twd_gertab_t.
CALL FUNCTION 'ISU_DET_DEVICE_FROM_INST'
EXPORTING
x_anlage = eastl-anlage
x_keydate = '01/01/1900'
X_ONLY_KEYDATE = 'X'
CHANGING
xy_t_ger = xy_lt_ger
EXCEPTIONS
not_found = 1
internal_error = 2
system_error = 3
OTHERS = 4.
If you want all the old devices on the installation then you should pass the key data as 01/01/1900 and the only keydate set to X as above.
Without knowing your entire code it might be hard to fix the issues, but I just tried to help with the little I know about your requirements.
2015 Aug 25 3:29 PM
Thanks. I'll try that. I'm not too sure how I can send you the program