cancel
Showing results for 
Search instead for 
Did you mean: 

method create is unknown or private or protected

Former Member
0 Kudos

Hi Experts

CALL METHOD ME->CREATE

EXPORTING

CUSTGENERAL = STRU_GENRAL

  • CUSTCOMPCOD =

CUSTSLGORG = STRU_SALES

  • CUSTBANK =

IMPORTING

TRANSID = LV_TRANS .

  • KUNNR =

I want to CALL METHOD ( create) which i had already created in class builder there i declared the method create under public section then i am getting those above mentioned error please help me .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The ME is referring to which class. please check this reference..

Create an object reference for your class and use that reference variable..

Former Member
0 Kudos

Hi Lekha,

Actually I called That method Through pattern , there i already choose class name and then method , what should i do now

Former Member
0 Kudos

Thanks to All

for Reply

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Neeraj,

ME-> is like this reference, which always refers to the class in which you are calling this method...

Say, class in which you are using CALL_METHOD ME->CREATE in class XYZ, ME always refers to the instance of +XYZ +and not the class in which you have deined CREATE method.

And, if the create method is in class XYZ, try calling it using CALL_METHOD CREATE instead of * CALL_METHOD ME-CREATE *

Edited by: Chinnu on Jul 12, 2011 12:13 PM

Edited by: Chinnu on Jul 12, 2011 12:13 PM

former_member199125
Active Contributor
0 Kudos

HI NEERAJ,

Use the below code

data obj1 type ref to zclassname.

create obj1.

CALL METHOD obj1->CREATE

EXPORTING

CUSTGENERAL = STRU_GENRAL

  • CUSTCOMPCOD =

CUSTSLGORG = STRU_SALES

  • CUSTBANK =

IMPORTING

TRANSID = LV_TRANS .

  • KUNNR =

former_member463524
Contributor
0 Kudos

Hi Neeraj,

There are two options to perform this,

1. you can create a object and then can access

2. you can mention this class in attributes and use the refernce from attributes.

Regards,

Meera