SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Programming for Meter change out

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

View solution in original post

11 REPLIES 11

Former Member
0 Kudos

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


Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

You could use this FM ISU_DET_DEVICE_FROM_INST and pass the installation number which should give you back all the devices.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

It's still not working. I'm not too sure if I programmed it correctly.

0 Kudos

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.

0 Kudos

Thanks. I'll try that. I'm not too sure how I can send you the program