Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the include keyword of ABAP

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use the include keyword of ABAP". In the daily operation, I believe that many people have doubts about how to use the include keyword of ABAP. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "how to use the include keyword of ABAP". Next, please follow the editor to study!

ABAP

Repeat the introduction of an include program using the keyword, and it will report syntax error:

The reason is that ABAP's implementation of the keyword include is a little different from that of other programming languages. When activated, it simply replaces the INCLUDE incl line in the original program with all the source code of include's program, so repeatedly introducing an include program will cause an error.

It is worth mentioning that ABAP report quietly include a lot of standard program, such as.

So if you repeat it again, you will also encounter grammatical errors.

Import in Java

Java's import and ABAP's include keyword achieve different results. Using import to introduce package names in Java allows programmers to type fewer words, such as comparing lines 13 and 15 below. Obviously, the former is more concise.

Because import introduces the package name and does not introduce the source code of the package into the source program that uses import, as ABAP does, you can repeat import. Just after decompiling the .class generated by the Java compiler, you will find that the compiler automatically removes the redundant import and automatically introduces a new package java.io.printStream:

Include in C

Teacher Tan Haoqiang's book "C programming" mentions that when preprocessing the compiler, it is necessary to carry out "file inclusion processing" on the # include command: copy all the contents of the header file of the include to # include.

Then the include of C language is similar to the keyword include of ABAP.

Example: include standard in A.C:

Location of this header file: / usr/include

There are some macro definitions and function declarations:

There is no header file called include in b.c:

Therefore, the size of the execution file generated by the b.c compilation is smaller than A.C:

Import in C4C ABSL

Import, like Java, does not have any impact on the ABAP code generated in the background.

At this point, the study on "how to use the include keyword of ABAP" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report