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: 

ISU_S_METERREAD_CHANGE

Former Member
0 Kudos
854

I need to change meter reading results automatically but with validation (like sap-transaction el29). I tried FM ISU_S_METERREAD_CHANGE with action 5 but ist doesn´t work. I tried with x_auto and with auto set in x_obj - no success.

Does anybody know how to fill the parameters for this action correctly?

Thanks in advance

Sabine

1 ACCEPTED SOLUTION

Former Member
0 Kudos
280

Hi,

I think single call to FM : ISU_S_METERREAD_CHANGE wont solve the purpose.

You also need to call following simultaneously.

ISU_O_METERREAD_OPEN

ISU_O_METERREAD_ACTION

ISU_O_METERREAD_CHANGE

ISU_O_METERREAD_CLOSE

Hope this helps.

regards

Sagar

View solution in original post

5 REPLIES 5

Former Member
0 Kudos
281

Hi,

I think single call to FM : ISU_S_METERREAD_CHANGE wont solve the purpose.

You also need to call following simultaneously.

ISU_O_METERREAD_OPEN

ISU_O_METERREAD_ACTION

ISU_O_METERREAD_CHANGE

ISU_O_METERREAD_CLOSE

Hope this helps.

regards

Sagar

0 Kudos
280

Hi,

I called ISU_O_METERREAD_OPEN before to fill x_obj for FM ISU_S_METERREAD_CHANGE. I think you need more calls with FM ISU_O_METERREAD_ACTION with different X_OKCODE (first correction, second prep_save, third save).

Do you have an example for the parameters?

Regards

Sabine

0 Kudos
280

I´ve found a solution:

working with obj, ignoring auto

1. FM ISU_O_METERREAD_OPEN with action '5', wmode '2' and select2 '2'

2. FM ISU_O_METERREAD_OPEN_SUBOBJ with action '5'. It`s necessary for filling i_reabld.

3. modify i_reabld, compare SAP transaction EL29

4. FM ISU_O_METERREAD_INPUT_GENERAL for validation

5. FM ISU_O_METERREAD_ACTION with okcode PSAV for last input-checks

6. FM ISU_O_METERREAD_ACTION with okcode SAVE

7. FM ISU_O_METERREAD_CLOSE

regards

Sabine

0 Kudos
280

Sabine,

Hi! Could you provide a sample code for this solution?

We have a similar requirement and we don't want to use batch input for EL29.

Thanks!!!

Cristian

280

Hi Cristian,

here it is:

DATA: l_obj TYPE isu17_meterread,

lv_ablbelnr TYPE ablbelnr.

FIELD-SYMBOLS: TYPE reabld.

  • open object

CALL FUNCTION 'ISU_O_METERREAD_OPEN'

EXPORTING

x_ablbelnr = lv_ablbelnr

x_select2 = '2'

x_wmode = '2'

x_action = '5'

x_no_dialog = co_true

x_no_other = co_true

IMPORTING

y_obj = l_obj

EXCEPTIONS

not_found = 1

foreign_lock = 2

not_authorized = 3

not_qualified = 4

already_billed = 5

OTHERS = 99.

IF sy-subrc <> 0.

..........

EXIT.

ENDIF.

  • important: open subobject

CALL FUNCTION 'ISU_O_METERREAD_OPEN_SUBOBJ'

EXPORTING

x_action = '5'

CHANGING

xy_obj = l_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.

........

PERFORM meterread_close CHANGING l_obj.

EXIT.

ENDIF.

  • Änderungen

READ TABLE l_obj-i_reabld ASSIGNING

  • Input-Checks incl. validation

CALL FUNCTION 'ISU_O_METERREAD_INPUT_GENERAL'

CHANGING

xy_obj = l_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.

IF sy-subrc <> 0.

..........

PERFORM meterread_close CHANGING l_obj.

EXIT.

ENDIF.

  • Update prepare

CALL FUNCTION 'ISU_O_METERREAD_ACTION'

EXPORTING

x_okcode = 'PSAV'

CHANGING

xy_obj = l_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.

.....

PERFORM meterread_close CHANGING l_obj.

EXIT.

ENDIF.

  • Update

CALL FUNCTION 'ISU_O_METERREAD_ACTION'

EXPORTING

x_okcode = 'SAVE'

CHANGING

xy_obj = l_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.

COMMIT WORK AND WAIT.

.......

ELSE.

ROLLBACK WORK.

.......

ENDIF.

PERFORM meterread_close CHANGING l_obj.

-

-


FORM meterread_close CHANGING xy_obj TYPE isu17_meterread.

CALL FUNCTION 'ISU_O_METERREAD_CLOSE'

CHANGING

xy_obj = xy_obj

EXCEPTIONS

not_customized = 1

failed = 2

general_fault = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,

Sabine