Application Development 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: 

report generation during runtme

Former Member
0 Kudos

Is it possible to create new dynamic programs during runtime of an ABAP/4 program.give me the procedure

2 REPLIES 2

Former Member
0 Kudos

Hi Reddy,

For Dynamic Programming I can suggest you couple of good materail That will help you a lot.

Weblogs :

/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements

/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements

/people/thomas.szcs/blog/2006/02/22/dynamic-programming-in-web-dynpro-abap--part-iii-aggregations-and-ddic-binding-of-viewelements

Other than that there good pdf avilable of WD ABAP

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fef...

( SAP NetWeaver Developers Guide Release 2004s Web Dynpro ABAP

ProgrammingGuidelines)

Regards,

Lijo Joseph

0 Kudos

To create new dynamic programs during the runtime of an ABAP/4 program, you must use an internal table. For this purpose, you should create this internal table with one character type column and a line width of 72. You can use any method you like from Filling Internal Tables to write the code of your new program into the internal table. Especially, you can use internal fields in which the contents are dependent on the flow of the program that you use to create a new one, to influence the coding of the new program dynamically. The following example shows how to proceed in principal:

DATA CODE(72) OCCURS 10.

APPEND 'REPORT ZDYN1.'

TO CODE.

APPEND 'WRITE / ''Hello, I am dynamically created!''.'

TO CODE.

Two lines of a very simple program are written into the internal table CODE.

In the next step you have to put the new module, in the above example it is a report, into the library. For this purpose you can use the following statement:

Syntax

INSERT REPORT <prog> FROM <itab>.

The program <prog> is inserted in your present development class in the R/3 Repository. If a program with this name does not already exists, it is newly created with the following attributes:

Title: none,

Type: 1 (Reporting),

Application: S (Basis).

You can specify the name of the program <prog> explicitly within single quotation marks or you can write the name of a character field, which contains the program name. The name of the program must not necessarily be the same as given in the coding, but it is recommended to do so. <itab> is the internal table containing the source code. For the above example you could write:

INSERT REPORT 'ZDYN1' FROM CODE.

or

DATA REP(8).

REP = 'ZDYN1'

INSERT REPORT REP FROM CODE.