Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ISU_DET_DEVICE_FROM_INST error

Former Member
0 Kudos

I implemented ISU_DET_DEVICE_FROM_INST in the program to read all of the meters that are linked to the BP. The customer accounts coordinator wants to have the report to read all of the meters readings from the BP and from the old meters that have been changed out.

Error analysis

    An exception occurred that is explained in detail below.

    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

     not caught in procedure "GRID_DISPLAY" "(FORM)", nor was it propagated by a RAISING clause.

    Since the caller of the procedure could not have anticipated that the

    exception would occur, the current program is terminated.

    The reason for the exception is:

    The call to the function module "ISU_DET_DEVICE_FROM_INST" is incorrect:

    The function module interface allows you to specify only

    fields of a particular type under "X_KEYDATE".

    The field "'01/01/1900'" specified here is a different

    field type

I used this in the program and after this it's been giving me errors. Thanks.

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.

1 ACCEPTED SOLUTION

kathryn_mcgallicher
Active Participant
0 Kudos

I thought at one point you mentioned you are new to SAP CCS.  Here's some basic info that might help you figure out what's going on...

If you know the installation that had a meter change, you can look at table EASTL to see the time slices relative to the activity.  Using the logical device number from EASTL, go to table EGERH to get the associated equipment numbers.  Notice that the time slices are the same.  The equipment number is unique to the device.  Using the equipment number and installation, you can go to tables EABL and EABLG to get the meter reading data.

Keep in mind that a meter removed from one installation is probably eventually installed on another installation (different premise) later, so you have to be careful with the time slices to ensure you are getting the right data.  This means that any given equipment/device number can have data for more than one installation over its lifetime.

Here are some of the table relationships:

EANL->EASTL->EGERH->EZUZ/EZUG/EGERS->EQUI

EANL->EASTS->ETDZ->EASTI

EANL->EABLG->EABL

EABL->ETDZ

ETDZ->EZUZ

It might help to look at the contents of these tables to see how the data looks in its raw form.  If you run SE16 on table EASTL for a bis <> 12/31/9999, you should be able to find installations that have had meter replacements.  Find an installation, go back to the beginning and re-search using the installation.  That will show you the various logical device numbers involved that can then be used in the other tables to work your way through to the meter reading data.  After this, use some of those specific data examples to manually run the function modules you are using in your report in SE37 to see what data comes back and how it looks.  Hopefully that will reveal where it's not matching up.

K--

20 REPLIES 20

0 Kudos

Hi.

I think your date Format is wrong. You have to use the internal Format '19000101' (YYYYMMDD).

Regards, Peer.

0 Kudos

I changed the date format but I'm still not able to retrieve the older meters with the BP. I'm able to get the results in EL31 but not in the custom report. The customer accounts employees wants to get the older readings from the meter change out. Currently the report is only getting the current device with the BP but not retrieving the old meter readings. Thanks.

0 Kudos

I have no idea where I can put that portion of the programming in the ABAP program

0 Kudos

Hello,

It appears in your screenshot that the parameter x_only_keydate is set to a lower-case x?  It should be upper-case since characters are case-sensitive and the code is matching against the constant co_flag_marked.

Regards,

K--

0 Kudos

I changed it to X_Only_Keydate = 'x' but I'm still getting the same results. What needs to be completed is to be able to get all of the meter readings from the Contract Account even when the meter is changed out and a AMI meter is installed. Thanks.

0 Kudos

Yes, but is it an upper-case (capital) X?

0 Kudos

X_Only_Keydate = 'X'

That's correct it is upper-case now but still getting the same results. Thanks.

0 Kudos

I'm still getting "0" reading from in the report.

0 Kudos

Based on your screen shot, it appears you are picking up the meter change.  Where are you trying to get the meter read data from?

K--

0 Kudos

This is the Meter Reading parameters but I was trying to select the meters using the Installation. EVER-ANLAGE.

0 Kudos

I think you got the meters.  Now you can use the meter number, or its associated equipment number, to get the reads.

Your SQL looks basically correct.  Run debug and confirm that table i_egerh has the equipment number populated and the format is the same as it is in table eabl.

0 Kudos

I ran the debug but there was nothing that was being selected. I might be doing something wrong here. The report is not picking up correct device number and meter readings for the old device that was changed out.

kathryn_mcgallicher
Active Participant
0 Kudos

I thought at one point you mentioned you are new to SAP CCS.  Here's some basic info that might help you figure out what's going on...

If you know the installation that had a meter change, you can look at table EASTL to see the time slices relative to the activity.  Using the logical device number from EASTL, go to table EGERH to get the associated equipment numbers.  Notice that the time slices are the same.  The equipment number is unique to the device.  Using the equipment number and installation, you can go to tables EABL and EABLG to get the meter reading data.

Keep in mind that a meter removed from one installation is probably eventually installed on another installation (different premise) later, so you have to be careful with the time slices to ensure you are getting the right data.  This means that any given equipment/device number can have data for more than one installation over its lifetime.

Here are some of the table relationships:

EANL->EASTL->EGERH->EZUZ/EZUG/EGERS->EQUI

EANL->EASTS->ETDZ->EASTI

EANL->EABLG->EABL

EABL->ETDZ

ETDZ->EZUZ

It might help to look at the contents of these tables to see how the data looks in its raw form.  If you run SE16 on table EASTL for a bis <> 12/31/9999, you should be able to find installations that have had meter replacements.  Find an installation, go back to the beginning and re-search using the installation.  That will show you the various logical device numbers involved that can then be used in the other tables to work your way through to the meter reading data.  After this, use some of those specific data examples to manually run the function modules you are using in your report in SE37 to see what data comes back and how it looks.  Hopefully that will reveal where it's not matching up.

K--

0 Kudos

I looked at the meter and this is what I found. I also am noticing that the program isn't going to the call function when I performed the debugging on the program. I am puzzled as to what is going wrong here. I did look at the tables that you provided.

0 Kudos

For the debug, set several debug stops at decision points in the code that leads up to the function module call to see why it skips it.  Run for a single customer if possible to make it easier to follow.

For the screenshots you provided, here's what it looks like to me.  Since I don't know your system, this is a best guess:

EASTL - Instl 40049258 had one device from 09/29/2001 - 12/27/2003.  It was replaced on 12/29/2003.  A second device was added on 6/28/2013. Both devices were replaced effective 10/13/2015. 

EABLG - On 10/13/2015, meter reading documents were created for the technical and billing installs of the new devices.  Notice the meter read document number is the same, so it applied to both.  In addition, there was a periodic meter reading document for a scheduled date of 10/28/2015.

EABL - The entry for 10/13/2015 has no read.  The device was newly installed to this location effective this date so a starting read of 0 is reasonable.  The periodic read on 10/28/2015 has a value of 41.  Ignore the entry for 04/30/2015 because it belongs to whatever installation the device was on previously.

Taking the easy route, if the BP has been the only customer for installation 40049258, then it seems you would take all of the logical device numbers in EASTL, identify the equipment number for each one, and then get all of the associated meter read records from EABL.

Getting more complex, if the BP has NOT been the only customer for the installation, you would need to identify the appropriate time frame based on the partner's contracts and filter the meter reads accordingly.

Transaction EL31 will show you the history you're trying to build in the report.

0 Kudos

I ran the debug and notice that it goes to the CALL FUNCTION 'ISU_DET_DEVICE_FROM_INST' after I exit the program. After all of the data is imported to the report. This is in the development server.

This is in the quality server. The date format in development is X_KEYDATE      = '19000101' and in quality it is X_KEYDATE      = '99991231'. Could this be a problem in the date format?

It goes to the call function after I exit the program.

0 Kudos

In your dev screenshot, the ISU call is following the ALV grid call.  That is too late.  In other words, the report is looking for more data after it has already been presented in the grid.  The ISU call should be located somewhere earlier in the process.

In your Q/A screenshot, the ALV grid call is commented out so it would depend on what is happening in the code above the screenshot.

For the dates, the formats are okay but the two different values would likely give you different results based on the installation's activity.

K-

0 Kudos

Attached is the screen shot of the ALV grid in QER and DER. I'm still trying to be able to get all of the readings from the contract account. I know it's simple but I can't figure it out.

0 Kudos

If this report is something that is run and the results presented at the end in the ALV grid, then the call to ISU_DET_DEVICE_FROM_INST is happening too late.  The grid is displaying the data contained in itab_output.  The meter read details you need in the report will have to be gathered and placed into itab_output before the ALV call.  Since the ISU call is by installation, it needs to be placed somewhere that each installation will go to it.  Depending on how the report is structured, if the list of accounts is gathered into an internal table and then the table is looped to gather the details, the ISU call should be placed somewhere within that loop.

0 Kudos

I moved the CALL FUNCTION 'ISU_DET_DEVICE_FROM_INST' to the installation is taking place but still no luck in getting all of the readings. I am still trying to figure this out on top of my other projects. Thanks.