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

SAP Controls tutorial code problem

Former Member
0 Likes
483

Hello all,

I'm working on a SAP tutorial and I can't get this piece of their code to work. We're on version 4.7, basis version 6.2.

This is a link to the tutorial and here is a segment of code that does not pass the syntax check.

http://help.sap.com/saphelp_webas630/helpdata/en/ea/6013361d5af835e10000009b38f839/frameset.htm

DATA: EVENT_TYPE(20) TYPE C.

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: CATCH_DBLCLICK FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT.

IMPORTING SENDER.

ENDCLASS.

Lesson one worked just the way the tutorial described. But the first exercise of lesson two is giving me a syntax error regarding IMPORTING SENDER. Has anyone successfully completed exercise one of lesson two?

Thanks

Bruce

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
457

Hi,

Please remove the fullstop (dot) after the CLASS-METHODS: CATCH_DBLCLICK FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT.

Check the below code

DATA: EVENT_TYPE(20) TYPE C.

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: CATCH_DBLCLICK FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT IMPORTING SENDER.

ENDCLASS.

regards,

Vara

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
457

I don't think that should be there. Try removing it.



DATA: EVENT_TYPE(20) TYPE C.
CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.
   CLASS-METHODS: CATCH_DBLCLICK 
             FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT.

ENDCLASS.



Regards,

Rich Heilman

Read only

Former Member
0 Likes
458

Hi,

Please remove the fullstop (dot) after the CLASS-METHODS: CATCH_DBLCLICK FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT.

Check the below code

DATA: EVENT_TYPE(20) TYPE C.

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS: CATCH_DBLCLICK FOR EVENT DBLCLICK OF CL_GUI_TEXTEDIT IMPORTING SENDER.

ENDCLASS.

regards,

Vara

Read only

0 Likes
457

Vara,

Thanks for spotting that mis-placed '.'. Removing that corrected the syntax problem. That was a very fast and useful response.

Bruce

Rich,

Thanks for thinking about and responding to my question. I'm not sure what you are suggesting be removed. If it was the period, then your answer was the same as Vara's.

Bruce

Read only

0 Likes
457

Actually I was saying to remove the IMPORTING SENDER, but then on my way home from work, I was thinking that the period was placed in the statement accidently. I ran in the door, booted up the laptop, came here to tell you to remove the period, and Vara beat me to it. Oh well, good catch Vara. Glad your problem is solved.

Regards,

Rich Heilman