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

New OO Syntax

Former Member
0 Likes
919

Does anyone know of any really thorough resources for the newer syntax of ABAP Objects? I have found virtually nothing on the topic and come from a Java background. I much prefer omitting extra keywords like CALL METHOD wherever possible. I am also interested in finding out what capabilities the newer syntax style may have for avoiding unnecessary data declarations and value passing in circumstances when I would like to call a method of an object that is an attribute of another object, such as with using chained method calls.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

You would find Thomas Jung's presentations on what's new in ABAP in NetWeaver 7.02, where you will find the things that you're asking for, such as chaining, etc.  The 7.02 release is said to be the largest release ever for the ABAP language and is a confirmation of SAP's commitment to ABAP, rather than JAVA, as its development language.

For new ABAP practitioners, I found ABAP Objects: Application Development from Scratch and Next Generation ABAP Development, 2nd edition, both from SAP Press, to be very good references.  SAP Press has a lot of very good manuals on a variety of subjects.

6 REPLIES 6
Read only

Former Member
0 Likes
847

Hi Zachary,

            To reduce the number of coding lines we can normally use Subroutines with the program. We can use Call Function to call function modules which are actually said to improve the program performance.

However, basic structures declarations is unavoidable.

Does it answer your question ?

Regards

Uday

Read only

Former Member
0 Likes
847

Hi Zachary,

check the following link.

http://help.sap.com/abapdocu_731/en/index.htm

Especially the section ABAP Programming Guidelines is IMHO very interesting.

Best regards,

Tapio

Read only

matt
Active Contributor
0 Likes
847

I tend to use the newer Java-like syntax as well. I think it makes for much more readable code. There's no real resource for it, except the ABAP help. Chaining is not possible up to 7.01, but is from 7.02. Of course, you can search SCN!

I like to use things like:

IF r_obj->some_condition( ) EQ abap_true.

This is better, in my view, then

CALL METHOD r_obj->some_condition RECEIVING r_match = l_match.

IF l_match EQ abap_true.

The lack of true boolean in ABAP is a bit of a pain. Also, functional methods - like above - are not usable everywhere.

You can set options in the ABAP editor so that the pattern functionality uses the java-like syntax. This also defines the syntax when you drag a method from an object tree into the editor.

I'd like the opportunity to do a bit more chaining, but do bear in mind that too much of it makes the program less readable, and therefore harder to contain. Write-once read-never code is to be avoided!

Read only

Former Member
0 Likes
848

You would find Thomas Jung's presentations on what's new in ABAP in NetWeaver 7.02, where you will find the things that you're asking for, such as chaining, etc.  The 7.02 release is said to be the largest release ever for the ABAP language and is a confirmation of SAP's commitment to ABAP, rather than JAVA, as its development language.

For new ABAP practitioners, I found ABAP Objects: Application Development from Scratch and Next Generation ABAP Development, 2nd edition, both from SAP Press, to be very good references.  SAP Press has a lot of very good manuals on a variety of subjects.

Read only

0 Likes
847

I am not aware of ABAP Objects: Application Development from Scratch, but I bought the book Next Generation ABAP Development 2nd Edition and read it. it is really a cool book, however, I wouldn't say that it is for a beginner, as far as I remember in one of the podcasts the authors stated that this book is not for an ABAP beginner.

But book is worth its money 😃

BR,

Kairat Alaichiev

Read only

Former Member
0 Likes
847

Thanks to all of you for your insights and resources. It is a very hard thing to find information about on the internet, I think mostly because ABAP as a language is a little older and is a procedural language, and so it has been hard for people doing it for a long time to want to adapt to a more Object Oriented approach. I think that concepts like method chaining could greatly improve the likeliness of adopting OO for people who do the original ABAP because of the powers in accomplishing more with less code and efficiency in passing data. Conceptually OO is far more complex and takes much more coding up front, so with more of these types of syntax rules people may see more benefit once the initial work is done in terms of making the reuse of the code easier.