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: 

How to check Meter reading posted is implausible

murtuza_chhatariya
Active Participant
0 Kudos

Hi,

I have function module which is linked with Service order IDoc. When IDoc is recived, the meter reading for the installation is posted in the system with help of BAPI_MTRREADDOC_UPLOAD. The meter reading is posted with reason 02.

How to check after posting that reading is implausible or not ?

Is there any FM which gives this detail ?

Thanks in advance.

1 ACCEPTED SOLUTION

vikrant_guptarya
Participant
0 Kudos

Hi Murtaza,

Just check if the meter reading status equals to 2 ( Locked by system ) in table EABL against the Meter read doc id. If yes then it is implausible & locked by the system

View solution in original post

6 REPLIES 6

Former Member
0 Kudos

Hi,

Use the tcode EL27. I think it will help you.

Regards,

Godadhar

murtuza_chhatariya
Active Participant
0 Kudos

Actually I want to check it in program

0 Kudos

hi u can check that if meter reading is implausible or not but for that u have to go through many function modules not just 1...

I am Sending u the Code..

CALL FUNCTION 'ISU_ENTRY_PRESELECTION'
    EXPORTING
      X_ACTION       = '01'
      X_ABLESGR      = '01'
      X_NO_DIALOG    = 'X'
    TABLES
      YT_SELDATA     = LT_SELDATA
      YT_EABL        = LT_EABL
    CHANGING
      XY_WMODE       = L_XY_MODE
      XY_VERTRAG     = WA_EVER-VERTRAG
      XY_ADATSOLL    = L_ADATSOLL
    EXCEPTIONS
      NOT_AUTHORIZED = 1
      NO_MRRELEV_REG = 2
      CANCELLED      = 3
      OTHERS         = 99.


  READ TABLE LT_EABL INTO  WA_EABL INDEX 1.
  IF SY-SUBRC = 0.
    READ TABLE IT_EVER INTO WA_EVER INDEX 1.
    IF SY-SUBRC = 0.
      CALL FUNCTION 'ISU_O_METERREAD_OPEN' " to fill OBJ data aka contract data
        EXPORTING
         X_VERTRAG                       = WA_EVER-VERTRAG
         X_ADATSOLL                      = WA_EABL-ADATSOLL
         X_ADAT                          = WA_EABL-ADAT
         X_ABLBELNR                      = WA_EABL-ABLBELNR
         X_SELECT2                       = '1'
          X_WMODE                         = '2'
          X_ACTION                        =  '1'
         X_NO_DIALOG                     = 'X'
         X_AUTO                          = L_AUTO
         X_NO_OTHER                      = 'X'
       IMPORTING
         Y_OBJ                           = L_Y_OBJ
      EXCEPTIONS
       NOT_FOUND                       = 1
       FOREIGN_LOCK                    = 2
       INTERNAL_ERROR                  = 3
       INPUT_ERROR                     = 4
       EXISTING                        = 5
       NUMBER_ERROR                    = 6
       GENERAL_FAULT                   = 7
       SYSTEM_ERROR                    = 8
       MANUAL_ABORT                    = 9
       GASDAT_NOT_FOUND                = 10
       NO_MRREL_REGISTERS              = 11
       INTERNAL_WARNING                = 12
       NOT_AUTHORIZED                  = 13
       NOT_QUALIFIED                   = 14
       ANPSTORNO_NOT_ALLOWED           = 15
       ALREADY_BILLED                  = 16
       DEV_ALREADY_PREP                = 17
       OTHERS                          = 18
                .
      IF SY-SUBRC <> 0.
        CONCATENATE 'No Open Meter Reading Order Found For Customer'  VKONT INTO L_ERR_MSG.
        PERFORM ERROR_RESPONSE_XML CHANGING MESSAGE.
        EXIT.
      ENDIF.


      CALL FUNCTION 'ISU_O_METERREAD_OPEN_SUBOBJ' " to fill OBJ data aka contract data
       EXPORTING
         X_ACTION                   = '5'
        CHANGING
          XY_OBJ                     = L_Y_OBJ
 EXCEPTIONS
   NOT_FOUND                  = 1
   FOREIGN_LOCK               = 2
   INTERNAL_ERROR             = 3
   INPUT_ERROR                = 4
   EXISTING                   = 5
   NUMBER_ERROR               = 6
   GENERAL_FAULT              = 7
   SYSTEM_ERROR               = 8
   MANUAL_ABORT               = 9
   OTHERS                     = 10
                .
      IF SY-SUBRC <> 0.
      ENDIF.

      READ TABLE  L_Y_OBJ-I_REABLD INTO WA_REABLD WITH KEY ABLBELNR = WA_EABL-ABLBELNR.
      IF SY-SUBRC = 0.
        WA_REABLD-ZWSTAND = CURR_READING.
        MODIFY L_Y_OBJ-I_REABLD FROM WA_REABLD INDEX SY-TABIX TRANSPORTING ZWSTAND . " Current Reading validation
      ENDIF.

      CALL FUNCTION 'ISU_O_METERREAD_INPUT_GENERAL' " Validating current reading
       EXPORTING
         X_MSG_ACTIV                = 'X'
       IMPORTING
         YT_MSG                     = WA_MSG_ERR
        CHANGING
          XY_OBJ                     = L_Y_OBJ
       EXCEPTIONS
         INPUT_ERROR                = 1
         NOT_VALID                  = 2
         PLAUSI_ERROR               = 3
         PLAUSI_ERROR_NOCOR         = 4
         SYSTEM_ERROR               = 5
         NOT_COMPLETE               = 6
         INDEP_IMPLAUSIBLE          = 7
         NOT_AUTHORIZED             = 8
         OTHERS                     = 9 .
    ENDIF.

vikrant_guptarya
Participant
0 Kudos

Hi Murtaza,

Just check if the meter reading status equals to 2 ( Locked by system ) in table EABL against the Meter read doc id. If yes then it is implausible & locked by the system

0 Kudos

dear vikram , by checking the EABL table is a good way but the problem is if you want to Show user before Saving meter reading u have to call the seriese of function module which i described above.

0 Kudos

Thanks Dhruvin and Vikrant