Application Development 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: 

Error: Field "ENDMETHOD" is unknown

Former Member
0 Kudos

Hello All,

I am getting the following error:

Class ZPOSITION_INFORMATION,Method EXTRACT_DATA

Field "ENDMETHOD" is unknown. It is neither in one of the specified

tables nor defined by a "DATA" statement. "DATA" statement.

Here is the code in the method EXTRACT_DATA

method EXTRACT_DATA .

data: emp_type type char50,

end_d type sy-datum,

loc type char04,

pers_sub type char04,

position_title type char40,

start_d type sy-datum .

select single empneededby from hrp9007 into start_date

where OBJID = POS_NUM .

write start_date .

write "hello world" .

endmethod.

Kind regards.

Srinivas

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Again syntax in the WRITE statement, not double quotes, single quotes.

write 'hello world' .

endmethod.

Regards,

RIch Heilman

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Again syntax in the WRITE statement, not double quotes, single quotes.

write 'hello world' .

endmethod.

Regards,

RIch Heilman

0 Kudos

I must appreciate your patience Rich. Many thanks. But again one more error (sorry for that).

Class ZPOSITION_INFORMATION,Public Section

Implementation missing for method "CONSTRUCTOR". "CONSTRUCTOR".

How important is the constructor. Do I always need to put something in constructor. Or can I skip the constructor alltogether.

Kind Regards.

Srinivas

0 Kudos

When I try to test/execute the class, I get the message:

"You are not authorized to execute this object".

I am able to activate the class though.

How can I test the class.

Regards.

Srinivas

0 Kudos

Constructor is the method of a class which executes automatically when an object of that class is instantiated. You need not put any code withing construct, unless you require to initialize public/private data of the object or assign default values.

For your second question, a class as such is not executable, a class is just a template. The object is instantiated at runtime, so you first instantiate the object and call its methods. This is how you will execute a method. Though, static methods can be executed independent of object instantiation.

0 Kudos

Hi Vishnu,

Thanks for your reply!

I have one more problem.

When I try to test/execute the class, I get the message:

"You are not authorized to execute this object".

I am able to activate the class though.

How can I test the class.

Kind Regards.

Srinivas