Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error in unit test package

Former Member
0 Likes
537

Hi,

I try to use class in my program and i have error :

DATA: c_api TYPE REF TO cl_apl_ecatt_tdc_api.

(E) Paket "S_WR" darf das Objekt "cl_apl_ecatt_tdc_api "

aus Paket "SECATT_API" in keiner der folgenden Arten verwenden:

"Refer to data/object"

I think that the problem is with the package interface but i dont now how to avoid that .

S_WR is my package .

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
494

Hi Michael,

after translation it is shwing the below message


(E) parcel "S_WR" may the object "cl_apl_ecatt_tdc_api"
from parcel "SECATT_API" use in none of the following kinds:
"Refer to data/object"

so issue is with the object creation

i thnk with out creting the object you are using that class.

so create object before using the method inside that clas..

Thanks!

Edited by: M Prasanth on Jan 20, 2009 11:43 AM

3 REPLIES 3
Read only

Former Member
0 Likes
495

Hi Michael,

after translation it is shwing the below message


(E) parcel "S_WR" may the object "cl_apl_ecatt_tdc_api"
from parcel "SECATT_API" use in none of the following kinds:
"Refer to data/object"

so issue is with the object creation

i thnk with out creting the object you are using that class.

so create object before using the method inside that clas..

Thanks!

Edited by: M Prasanth on Jan 20, 2009 11:43 AM

Read only

0 Likes
494

Hi Prasanth ,

Thanks,

How i can do something like this ,i have to declare data and after do creation of object?

Maybe u have example?

Regards

Read only

0 Likes
494

Hi Michael,

follow this code,



DATA:   custom_container TYPE REF TO cl_gui_custom_container,

    IF custom_container IS INITIAL.          "Here I am creating the Object
*     Create object for custom container
      CREATE OBJECT custom_container
        EXPORTING
          container_name =  'CCONTROL'.

   ENDIF.

      CALL METHOD custom_container->free.  "Based on that object I am using that method.

For more information you can check the sample codes of the OO-ABAP in below Wiki...

https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/exampleofusingSAPObjects

may be it helps you.

Thanks!!

Edited by: M Prasanth on Jan 24, 2009 11:35 AM