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

Object reference syntax error

Former Member
0 Likes
2,486

Hi,

I am new to ABAP..I have declared a variable in the global class event_method. I am trying to use that variable value in the Report. But I am getting syntax error "Field "IT_LFA11" is unknown. It is neither in one of the specified".

Globalclass method

data: IT_LFA11 TYPE FRE_LFA1_TTY.

..

IT_LFA11 = IT_LIFNR..

Report.

IT_LFA11 = OBJ->IT_LFA11.

Please help me in this regard.

Regards,

Harish

10 REPLIES 10
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,601

Hi.,

Have you declared IT_LFA11 in the Parameters of the method.!!

I think you didnt created IT_LFA11 in the method parameters.

Thanks & Regards,

Kiran

Read only

0 Likes
1,601

Hi,

I cann't declare as export parameter as I copy the parameters from event method to method....

Thanks,

Harish

Read only

0 Likes
1,601

Hi Harish,

Has the variable IT_LFA11 been declared as a instance variable in your class or as a local variable to a method of a class ?

To access the variable with OBJ->IT_LFA11 , it_lfa11 must be a instance variable of the corresponding class. Please post ur code , that might give a better idea of your problem .

Regards,

Pawan

Read only

Former Member
0 Likes
1,601

Hi Harish,

please check whether IT_LFA11 is an instance or static attribute of the global class that you are referring to here.

regards,

Adithya

Read only

0 Likes
1,601

Hi,

1. Make sure that IT_LFA11 is declared as object or has been declared like "TYPE REF TO" so that it can hold objects.

2. Make sure that IT_LFA11 is declared in attribute of a class or in mother class.

3. See to it that all your classes are active.

Regards,

Nope

Read only

Clemenss
Active Contributor
0 Likes
1,601

Hi harish,

please post more code (formatted as code) and we can reveal that data: IT_LFA11 is not declaring any global attribute. Note the name IT implies that it is an Importing Table parameter which you already denied.

Let us know what you are doing and what kind of result you want. Help is right around the corner.

Regards

Clemens

Read only

Former Member
0 Likes
1,601

Halo Harish,

I believe OBJ is an instance reference of Global Class.

Say if you have created a Global Class G1 and declared public instance attributes say A1, A2 etc, then you can access the same externally in the report .


data: obj type ref to G1.

create object obj.

obj->A1 = 'Public attribute A1'.

Moreover if you have declared types(Public) in the types tab of class builder. you can access the same in the reprt like

G1=>T1 where T1 is the public type declared in the class

Regards

Arshad

Read only

Former Member
0 Likes
1,601

hai harish,

1).you have to declare object in following manner,

data: <objectname> type ref to <classname>.

create object <objectname>.

2). you have to check that the class is decared as final,becoz if final means we can't access.

3).you have to check it_kna11 is properly decared or not i.e, it should be public.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,601

Ignore

Edited by: Keshav.T on Oct 5, 2011 4:05 PM

Read only

hiriyappa_myageri
Participant
0 Likes
1,601

Hi...


Please Do not Declare It_lfa11 in Event_Method Parameters .
Instead of Declaring in Event_method Parameter just Declare it in "Attributes Tab" that is public section of class

as a 

it_lfa11 type stanard table of <strcuture>.

then your problem will solve..


Thanks & Regards,
Hiriyappa.