cancel
Showing results for 
Search instead for 
Did you mean: 

Function / BAdI / class to import meter readings?

Former Member
0 Kudos

Hi,

I have various meters linked to rental spaces and pool spaces with SAP RE-FX. Now I want to write a program to import meter readings from a csv file, which is generated by a different system.

Does anyone know what functions / BAdI / class I could use in order to get the import started?

Thank you in advance

Norbert

Accepted Solutions (1)

Accepted Solutions (1)

yeong-chul_jeong
Active Participant
0 Kudos

Dear Norbert Preis.

Your questions is for the "How can you migrate various measurements of each rental/pooled space".

It that right? In this cases, you can use the "LSMW with BAPI".

A) Function (BAPI) :

   1) Function module : BAPI_RE_RO_CREATE

   2) Table Parameter : MEASUREMENT

B) LSMW >>

   1) Import Method    : Business Object Method (BAPI)

   2) Business Object : BUS1504

   3) Method              : Create

   4) Message Type    : BUS1504_CREATE

Regards,

Jeong, Yeong-Chul

Former Member
0 Kudos


Dear Yeong-Chul,

my question went the direction of having a program to regularily import the meter reading data to the meters. But I also will keep the LSMW BAPI in mind. This also provides me an entry point for the readings.

Thank you

Norbert

Answers (3)

Answers (3)

former_member196871
Active Participant
0 Kudos

Hi Norbert,

I am not sure, how you are using the functionality, If you are not using measurements to update your meter reading and have created measuring points instead, then you may try using the tcode FO8V and use collective entry.

Regds,

Hardik Sharma

Former Member
0 Kudos

Dear Robert,

first I would use either OPEN and READ DATASET (when file from server) or function 'GUI_UPLOAD' to get your csv data in the correct internal table.

After that use function 'API_RE_RO_CHANGE' to change your rental objects with the imported measurements.

Regards
Michael

Former Member
0 Kudos

Dear Norbert,

There is an RFC call "MEASUREM_DOCUM_RFC_SINGLE_001" which you could use within a loop to import the meter readings (measurement documents).

     CALL FUNCTION 'MEASUREM_DOCUM_RFC_SINGLE_001'
          EXPORTING
             measurement_point           = p_point
             reading_date                     = p_meas_date
             reading_time                     = sy-uzeit
             reader                              = sy-uname
             origin_indicator                 = 'A'
             recorded_value                 = p_cntr_rdg
             prepare_update                = 'X'
             commit_work                   = ''
             wait_after_commit            = ''
             notification_type              = 'M2'
          IMPORTING
             measurement_document  = lv_docno
          EXCEPTIONS
             no_authority                    = 1
             point_not_found               = 2
             index_not_unique            = 3
             type_not_found               = 4
             point_locked                   = 5
             point_inactive                 = 6
             timestamp_in_future       = 7
             timestamp_duprec          = 8
             unit_unfit                        = 9
             value_not_fltp                 = 10
             value_overflow                = 11
             value_unfit                     = 12
             value_missing                = 13
             code_not_found             = 14
             notif_type_not_found      = 15
             notif_prio_not_found       = 16
             notif_gener_problem       = 17
             update_failed                 = 18
             invalid_time                   = 19
             invalid_date                   = 20
*      OTHERS                            = 21.


Thanks and Regards,


Amitava