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: 

OOABAP Report

Former Member
0 Kudos

Are there any GOOD standard programs / REPORTS to refer for OOABAP done already in SAP ?

Rgds,

Ö

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

There are plenty of them...

You can find lots of example , BCALV* examples are good examples. You can see some Controls examples in transaction<b> DWDM</b>

regards

vijay

3 REPLIES 3

Former Member
0 Kudos

Hi

ABAP Objects is a new concept in R/3 Release 4.0. The term has two meanings. On the one hand, it stands for the entire ABAP runtime environment. On the other hand, it represents the object-oriented extension of the ABAP language.

The following is a simple example shows the object-oriented aspect of function groups in the simple case of a counter.

Suppose we have a function group called COUNTER:

Create an abap program with this code :-

FUNCTION-POOL COUNTER.

DATA COUNT TYPE I.

FUNCTION SET_COUNTER.

  • Local Interface IMPORTING VALUE(SET_VALUE)

COUNT = SET_VALUE.

ENDFUNCTION.

FUNCTION INCREMENT_COUNTER.

ADD 1 TO COUNT.

ENDFUNCTION.

FUNCTION GET_COUNTER.

  • Local Interface: EXPORTING VALUE(GET_VALUE)

GET_VALUE = COUNT.

ENDFUNCTION.

  • End of program code

The function group has a global integer field COUNT, and three function modules,

- SET_COUNTER,

- INCREMENT_COUNTER, and

- GET_COUNTER, that work with the field.

Two of the function modules have input and output parameters. These form the data interface of the function group.

Any ABAP program can then work with this function group. For example:

REPORT ZABAPOO.

DATA NUMBER TYPE I VALUE 5.

CALL FUNCTION 'SET_COUNTER' EXPORTING SET_VALUE = NUMBER.

DO 3 TIMES.

CALL FUNCTION 'INCREMENT_COUNTER'.

ENDDO.

CALL FUNCTION 'GET_COUNTER' IMPORTING GET_VALUE = NUMBER.

WRITE: / 'After processing NUMBER is :- ', NUMBER.

  • End of program code

After this section of the program has been processed, the program variable NUMBER will have the value 8.

The program itself cannot access the COUNT field in the function group. Operations on this field are fully encapsulated in the function module. The program can only communicate with the function group by calling its function modules.

Regards,

Santosh

Former Member
0 Kudos

Hi,

By OO ABAP if you are meaning, ALV Control reports, there quite a few examples.

Just look at BCALVGRID* Reports.

As far as the Standard Programs are concerned most of the programs are slowly being modifed to OO ABAP. That is why you can see that lots of functions are being re-written in CLASSES / METHODS. For example you can look at ME21n transaction.

Regards,

Ravi

Note : Please mark the helpful posts.

former_member188685
Active Contributor
0 Kudos

There are plenty of them...

You can find lots of example , BCALV* examples are good examples. You can see some Controls examples in transaction<b> DWDM</b>

regards

vijay