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 upload meter reading using BAPI without any manual intervention

former_member199650
Participant
0 Kudos
1,247

Hi,

Please guide me how can we upload meter readings using BAPI without any manual intervention.

Thanks and Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos
541

Try Function Module ALE_MTRREADDOC_UPLOAD.

View solution in original post

5 REPLIES 5

Former Member
0 Kudos
541

Not sure about BAPI

there is one FM "ISU_S_CS_METERREAD_SM_CHANGE" which can be used

You may refer to MOVEINDOC object type method "MeterReadingServiceInitiate"

Thanks,

Prajakta

Former Member
0 Kudos
541

Please try with this function module : BAPI_MTRREADDOC_UPLOAD

Regards,

Siva

Former Member
0 Kudos
541

siva is correct in mentioning the BAPI: BAPI_MTRREADDOC_UPLOAD to upload the meter readings, you need to provide the details like meter read document number, reads, read dates , read reasons etc.

A snipet of the code is below :

Part 1 : Filling the internal table to pass to BAPI

 Move
        WA_MRUDATA-GERNR      to WA_BAPI_UPD-SERIALNO,
        WA_MRUDATA-ZWNUMMER   to WA_BAPI_UPD-REGISTER,
        WA_MRUDATA-ABLESGR    to WA_BAPI_UPD-MRREASON,
        WA_MRUDATA-ABLBELNR   to WA_BAPI_UPD-MRIDNUMBER,
        WA_MRUDATA-U_READING  to WA_BAPI_UPD-READINGRESULT,
        LV_NOTES              to WA_BAPI_UPD-METERREADINGNOTE,
        WA_MRUDATA-U_M_READER to WA_BAPI_UPD-METERREADER,
        WA_MRUDATA-U_ACT_DATE to WA_BAPI_UPD-ACTUALMRDATE,
        WA_MRUDATA-U_READ_TIME to WA_BAPI_UPD-ACTUALMRTIME.
  append WA_BAPI_UPD to IT_BAPI_UPD.

Part 2 : Call the BAPI

call function 'BAPI_MTRREADDOC_UPLOAD'
    tables
      METERREADINGRESUPDATE = IT_BAPI_UPD
      RETURN                = IT_BAPI_RETURN.
  if not IT_BAPI_RETURN is initial.
    loop at IT_BAPI_RETURN into WA_BAPI_RETURN .

      if ( WA_BAPI_RETURN-TYPE eq 'E' or
           WA_BAPI_RETURN-TYPE eq 'A' ).

        LV_ERR_FLAG = 1.                       " Errornous record

      endif.

    endloop.

Edited by: M Amin F on May 20, 2009 6:24 AM

Former Member
0 Kudos
542

Try Function Module ALE_MTRREADDOC_UPLOAD.

Former Member
0 Kudos
541

Hi MP Vashishth,

There are two upload scenarios:

...

  1.  Meter reading orders were already created and downloaded in IS-U.

Meter readings are assigned to IS-U orders via the document number when they are uploaded. In this case you do not have to maintain the following fields:

○  Article Number

○  Device serial number

○  Register Number

○  Meter Reading Reason

  2.  There are no meter reading orders in IS-U/CCS

In this case you have to specify the serial number and the register number to identify the device for which readings are to be entered in IS-U/CCS.

If the serial number is not unique, you also have to provide the material number and device category. You also have to supply the meter reading reason, a meter reading date and a meter reading.

Hope this will help you...!!

Regards

Vipin KV