Quantcast
Channel: SCN : Document List - ABAP Development
Viewing all articles
Browse latest Browse all 935

Calling the method of class CL_RSD_DTA via FACTORY Method

$
0
0

Issue :

During the migration of SAP BW 7.0 to 7.4 project the call to the method of the class CL_RSD_DTA turns into error.

 

Analysis :

The method was called by creating instance of the class using  CREATE OBJECT statement and using that instance to call te method.

In the new 7.4 version the constructor of the class CL_RSD_DTA is no longer public and hence that goes into error.

 

Solution :

To resolve this issue we used the FACTORY method of the class to create its instance and used that instance to call the methods within that class.

 

Example :

 

Earlier Code :

CREATE OBJECT l_r_dta

    EXPORTING

      i_infoprov = l_s_rkb1d-infocube.

  CALL METHOD l_r_dta->dta_get_info

    IMPORTING

      e_s_dta = l_s_dta.


New Code :
CALL METHOD cl_rsd_dta=>factory

   EXPORTING

     i_infoprov = l_s_rkb1d-infocube

   RECEIVING

     r_r_dta    = l_r_dta

   EXCEPTIONS

     OTHERS     = 1.


  CALL METHOD l_r_dta->dta_get_info

    IMPORTING

      e_s_dta = l_s_dta.

 

 


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>