cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_RE_RO_CHANGE not unlocking master data for rental objects

Former Member
0 Kudos

Hi Experts,

We are using this BAPI to lock and unlock rental object master data. We are able to lock master data using this BAPI, however we are unable to unlock the master data using this BAPI.

We are passing following parameters.

company code :5075

businessentitynumber :100072

rentalobjectnumber:1

trans:PSEM

This is the error message we are getting.

RECAAP 066 Rental Unit cannot be changed. master data lock is set.

BAPI       003 Instance 5075 001000072 0000001 of object type RentalObject REFX could not be changed.

Please help me on this.

Regards,

Muthu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I hope that you are trying to unlock and change the object data at a time.

Try to use below to unlock the RO :

CALLFUNCTION'BAPI_RE_RO_CHANGE'

         EXPORTING

           COMPCODE                                     = 'XYZ'

           BUSINESSENTITYNUMBER          = LV_BE

           RENTALOBJECTNUMBER             = LV_RO

           TRANS                                                 = 'PSEM'

         TABLES

               RETURN                                           = IT_RETURN.

If you want to change any data in RO, you can do that only after unlocking master data.

Regards,

Chandra

Former Member
0 Kudos

Hi chandra,

Thanks for your reply. We are receiving this error message when we are trying to unlock the master data using this BAPI_RE_RO_CHANGE.

Please let me know whether this BAPI  can be used to unlock  rental object master data or any other BAPI used to unlock master data for rental objects. Please help me on this.

Regards,

Muthu

Former Member
0 Kudos

Hi Balaji,

This is the only BAPI we have to  lock / unlock the RO master data.

Try to test the BAPI from SE37 by giving

Company Code

Business Entity

Rental Object number

TRANS as PSEM

If you build a program already try to use below snippet:

CALLFUNCTION'BAPI_RE_RO_CHANGE'

         EXPORTING

           COMPCODE                                     = 'XYZ'

           BUSINESSENTITYNUMBER          = LV_BE

           RENTALOBJECTNUMBER             = LV_RO

           TRANS                                                 = 'PSEM'

         TABLES

               RETURN                                           = IT_RETURN.

Don't forget calling BAPI_TRANSACTION_COMMIT at the successful completion of above BAPI

Regards,

Chandra

Former Member
0 Kudos

Hi chandra,

As you mentioned, I've tried in se37 with appropriate parameters 'PSEM'. But still we are getting the same error.

Regards,

Muthu

Former Member
0 Kudos

Do you just want to unlock the rental object or change something in data as well?

Regards
Michael

Former Member
0 Kudos

Hi,

I am sorry, Just now I tested the scenario, facing the same issue.

Below is the code which is culprit in the method IF_RECA_BUS_OBJECT~INIT_BUS_OBJECT:


*     check, if master data lock is set

         IF lo_status_mngr->is_master_data_locked( ) = abap_true.

           get_ident( IMPORTING ed_ident_x = sy-msgv1 ).

           MESSAGE e066(recaap) WITH sy-msgv1

                   RAISING error.

ENDIF.

As alternative, use below Function module:

* do transaction and set resulting status

   CALL FUNCTION 'STATUS_CHANGE_FOR_ACTIVITY'

     EXPORTING

       check_only           = ' '

       no_check             = 'X'

       objnr                     = ld_objnr

       vrgng                     = 'PSEM'

     EXCEPTIONS

       warning_occured      = 01

       activity_not_allowed = 02

       object_not_found     = 03

       status_inconsistent  = 04

       status_not_allowed   = 05

       wrong_input          = 06

       OTHERS               = 10.

CALLFUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'x'.

Regards,

Chandra

Former Member
0 Kudos

I was facing the same problem using function 'STATUS_CHANGE_INTERN'.

It only worked for me with function 'STATUS_CHANGE_INTERN_VB'.


           gs_status_int-stat  = 'I0065'.
           gs_status_int-inact = 'X'.
           APPEND gs_status_int TO gt_status_int.



           CALL FUNCTION 'STATUS_CHANGE_INTERN_VB'
               EXPORTING
                 objnr  = gs_contract-objnr
               TABLES
                 status = gt_status_int.


          COMMIT WORK.

Regards
Michael

Answers (0)