Skip to Content
author's profile photo Former Member
Former Member

How to reverse a meter reading in a program

I am trying to reverse a meter reading in a similar way as:

T-code EL37

--> Writing installation --> Executing

--> Selecting reading --> Reversing

but instead of using the transaction, doing it directly in a program.

I made some research and found these FMs:

ISU_METERREAD_CANCEL, ISU_O_METERREAD_OPEN

but I haven't been successful in reversing the meter reading using these FMs.

Does anybody knows what to pass to these FMs or any other FM to reverse a meter reading, or how to reverse a meter reading (in code)?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 31, 2010 at 01:28 PM

    Hi,

    Check this code:

    CALL FUNCTION 'ISU_O_METERREAD_OPEN'
        EXPORTING
          x_anlage              = l_anlage
          x_adatsoll            = l_adatsoll
          x_ablbelnr            = l_ablbelnr
          x_ablesgr             = l_ablesgr
          x_select2             = '2'
         x_wmode               = '6'
          x_upd_online          = space
          x_no_dialog           = 'X'
          x_aufruf              = '01'
          x_karenzprfg          = 'X'
        IMPORTIN
          y_obj                 = ls_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
          OTHERS                = 17.
    
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        l_error = 'X'.
      ELSE.
        ls_obj-contr-no_change = space.
        ls_obj-contr-no_other = space.
        ls_obj-contr-enq_done = 'X'.
    
    
        CALL FUNCTION 'ISU_O_METERREAD_ACTION'
             EXPORTING
                  x_okcode             = 'PSAV'
             CHANGING
                  xy_obj               = ls_obj
             EXCEPTIONS
                  cancelled            = 1
                  failed               = 2
                  action_not_supported = 3
                  system_error         = 4
                  input_error          = 5
                  not_allowed          = 6
                  not_customized       = 7
                  reestimation_failed  = 8
                  path_invalid         = 9
                  date_invalid         = 10
                  internal_error       = 11
                  general_fault        = 12
                  OTHERS               = 13.
    
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          l_error = 'X'.
        ELSE.
    
          CLEAR tb_eabl.
          REFRESH tb_eabl.
    
          CALL FUNCTION 'ISU_O_METERREAD_ACTION'
            EXPORTING
              x_okcode             = 'SAVE'
            TABLES
              yt_eabl_delete       = tb_eabl
            CHANGING
              xy_obj               = ls_obj
            EXCEPTIONS
              cancelled            = 1
              failed               = 2
              action_not_supported = 3
              system_error         = 4
              input_error          = 5
              not_allowed          = 6
              not_customized       = 7
              reestimation_failed  = 8
              path_invalid         = 9
              date_invalid         = 10
              internal_error       = 11
              general_fault        = 12
              OTHERS               = 13.
    
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            l_error = 'X'.
          ENDIF.
        ENDIF.
      ENDIF.
    
      IF l_error IS INITIAL.
        COMMIT WORK AND WAIT.
      ENDIF.

    Edited by: xavier kerouanton on Mar 31, 2010 3:28 PM

    Edited by: xavier kerouanton on Mar 31, 2010 3:31 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.