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

INCLUDE ONCE?

Former Member
0 Likes
737

Does anyone know a way to achieve the following?


INCLUDE ONCE YCL_MYCLASS.

I know how to do it in PHP... Thanks a lot.

Peter

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
698

hi,

SAP has provided this statmrnt.

INCLUDE incl [IF FOUND].

5 REPLIES 5
Read only

Former Member
0 Likes
699

hi,

SAP has provided this statmrnt.

INCLUDE incl [IF FOUND].

Read only

0 Likes
698

Thanks Avinash.

That works if an include may or may not exists.

I assume the included object already exists. What I don't know is if it has already been included.

If it was included already, I want ABAP to ignore it this time.

Regards

Peter

Read only

matt
Active Contributor
0 Likes
698

If the include contains data declarations, or subroutines, or class definitions etc. you'll get a syntax error if you try to include it more than once.

But there is nothing like the "include once" statement.

matt

Read only

0 Likes
698

Thanks Matt. I thought as much. I prefer to develop objects in includes rather than SE24, because I can see my code at a glance. But this option is severely constrained without an "INCLUDE ONCE" type statement.

Read only

matt
Active Contributor
0 Likes
698

If you're shifting over to doing more ABAP, it might be beneficial for you to do things the standard way - i.e. not using includes so much... Otherwise you might find people find your code hard to maintain and, worse for you, you're not used to the standard ways of doing thing!

Personally, I use SE24 but always switch on the object browser for easy navigation. ( Display Object List - Ctrl-Shift-F5 ). But I do wish we had the Eclipse environment...

matt