cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with class CL_RECN_CONTRACT

Former Member
0 Kudos

Hi,

First of all, I want to precise that I'm really new in the ABAP OO world, sorry if I'm not explaining my problem in a comprehensive way...

I would like to update User Data in RECN transaction, represented in RUSER include of VICNCN table.

In order to do this, I first made an upcast of IF_RECN_CONTRACT (already instanciated) to CL_RECN_CONTRACT :

CALL METHOD cf_recn_contract=>find_by_intreno
  EXPORTING
    id_intreno  = gs_contract-intreno
    id_activity = reca1_activity-change
  RECEIVING
    ro_instance = go_contract
  EXCEPTIONS
    OTHERS  = 1.

CHECK sy-subrc = 0.
CHECK go_contract IS BOUND.

CHECK go_contract->is_active( ) = abap_true.

go_cl_contract ?= go_contract.

Everything works. But then, the method which I'm interested in (ME_STORE_PREPARE) is Protected and I can't figure out how to use it.

I tried to create a subclass inheriting from CL_RECN_CONTRACT (go_cl_contract is now defined as TYPE REF TO zcl_contract):

CLASS zcl_contract DEFINITION INHERITING FROM cl_recn_contract FINAL.

  PUBLIC SECTION.

    METHODS store_prepare.

ENDCLASS.

CLASS zcl_contract IMPLEMENTATION.

  METHOD store_prepare.

    CALL METHOD me_store_prepare.

  ENDMETHOD.

ENDCLASS.

After this modification, I'm getting a CAST ERROR and can't figure out how to solve my problem... Is anybody able to help me find the right way to proceed ?

Thanks in advance for your help.

Mickaël

Accepted Solutions (1)

Accepted Solutions (1)

franz_posch
Active Contributor
0 Kudos

Hi  Mickael,

I am just wondering about the purpose why you want to change the user data of a contract. The user data are normally set by the system to document when a contract is created/changed and not intended to be changed afterwards.

Regards, Franz

Former Member
0 Kudos

Hi Franz,

Thanks for your reply. I found another solution by just updating an attribute in the contract and storing this update : RUSER was then updated too.

I don't know why I struggled so much on this..

Thanks again Franz,

Regards, Mickaël

Answers (0)