Abstract

IntroductionThe study of algorithms forms a cornerstone of computer science research and education. However, many developers may not be aware of common algorithmic techniques, which the programming language they are using may provide. That is why companies like Google, Apple or Facebook use dynamic programming algorithms questions in their interviews and select only the best.In many areas of activity, dynamic programming is a method for solving a certain problem by breaking it into sets of subproblems [1]. Every time the same subproblem occurs, instead of searching again for a solution, one simply looks at the previously computed solution. By using this method, precious time can be saved at the expense of a modest storage increase.The core idea of dynamic programming is to avoid repeated work by remembering partial results and this concept finds its application in a lot of real life situations. Dynamic programming algorithms are often used for optimization purposes. These analyze if a problem has two key attributes: optimal substructure and overlapping of problems. Dynamic programming is mainly used when solutions of same subproblems are needed again and again. Afterwards, one of the following two approaches are used: a topdown approach (memorization) or a bottomup approach (tabulation).Since dynamic programming can be applied in so many different ways, the underlying concepts are quite general. The best way to really understand something is by making use of it, so in the next section we will check out an interesting problem which can efficiently be solved with dynamic programming, using the ABAP programming language.2Dynamic programming in ABAP2.1 General AssumptionsAs we know, ABAP programs may contain both static and dynamic parts, that cannot be clearly delimited. According to Cecchini [2], dynamic and static apply to the data and/or operations performed on the data within a program. It would not benefit anyone, if we would try to create categories in this regard. However, we would like to define these characteristics.The static parts of a program refer to the characteristics of the data, which is fixed at compile time and will not change during runtime. On the other hand, dynamic properties are for various reasons not known, nor fixed at compile time [2]. Dynamic programming enables you to use certain features during runtime that cannot be determined at compile time. Instead, these features are defined by the values of parameters that are passed to the program at runtime.To help us understand better the concept of dynamic programming in ABAP, we would like to present an easy example of Open SQL syntax: SELECT COUNT(·) FROM (tablename) INTO count. The variable tablename can be read at runtime, as the user interacts with the program by entering a value for the tablename. As a result, the program will be able to display a correct result for the variable, which got its value at runtime.In a similar manner, ABAP generic data types like ANY, or DATA are used to create data references via the command CREATE DATA, which allows to dynamically specify the type of the variable at runtime [3]. Field symbols, another dynamic programming feature of ABAP, which is not found in other programming languages, help the developers access and modify data from internal tables or structures at runtime, without copying them, acting as placeholders.We can conclude, that dynamic programming involves the use of incompletely typed or untyped data objects. This enables generic subroutines and methods to be created that run independently of the types of input data. This would not be possible in ABAP without the RTTS (Runtime Type Services), which makes it possible to handle the properties of types in programs: RTTI (Runtime Type Information) is used in order to get the corresponding types at runtime and a related service, RTTC (Runtime Type Creation), which creates new types when programs are executed and generates corresponding data objects [4]. …

Highlights

  • 2.1 General Assumptions As we know, ABAP programs may contain both static and dynamic parts, that cannot be clearly delimited

  • That dynamic programming involves the use of incompletely typed or untyped data objects. This enables generic subroutines and methods to be created that run independently of the types of input data. This would not be possible in ABAP without the RTTS (Runtime Type Services), which makes it possible to handle the properties of types in programs: RTTI (Runtime Type Information) is used in order to get the corresponding types at runtime and a related service, RTTC (Runtime Type Creation), which creates new types when programs are executed and generates corresponding data objects [4]

  • As an ABAP program is an array of coding lines, we will construct our program at runtime, according to the settings found in the customizing table

Read more

Summary

Dynamic programming in ABAP

2.1 General Assumptions As we know, ABAP programs may contain both static and dynamic parts, that cannot be clearly delimited. The static parts of a program refer to the characteristics of the data, which is fixed at compile time and will not change during runtime. Dynamic programming enables you to use certain features during runtime that cannot be determined at compile time. ABAP generic data types like ANY, or DATA are used to create data references via the command CREATE DATA, which allows to dynamically specify the type of the variable at runtime [3]. That dynamic programming involves the use of incompletely typed or untyped data objects This enables generic subroutines and methods to be created that run independently of the types of input data. We will explain how a complete selection screen can be generated in ABAP at runtime, without using the screen painter

Dynamic selection screen generation in ABAP
Conclusions
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call