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: 

Abap Objects

Former Member
0 Kudos

hi all,

some days ago, i asked a question of which are the uses of ABAP Objects, but every one only tell me that they uses in ALV, i did a lot examples of that, but now i want to know wich other uses abap objects has.?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

All you can do using ABAP you can do by ABAP Object.

It's another way of programming, I think Abap OO is more power for graphic than Abap: infact now there are many graphic objects (for example tree menu) there aren't before.

Max

9 REPLIES 9

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Objects is more than ALV, yes, the alv grid is implemented using ABAP objects, but that is not all. There are many different standard classes which you can use to help you in your coding. One example is the class CL_GUI_FRONTEND_SERVICES. If you look at the method of this class, you can see that there are many that can help you interact with the frontend pc. There are many more.

Remember ABAP Objects is an extension of the ABAP language. It is being used more in newer developments by SAP and you will find that new applications will be written using ABAP OO, check out the MIGO transaction. The Web Dynpro for ABAP tool, is completly made up of ABAP object classes and interfaces.

Hope it helps a little.

Regards,

RIch Heilman

0 Kudos

thanks Rich,

ok thats great, but do you have an example to introduce the uses of CL_GUI_FRONTEND_SERVICES?

Former Member
0 Kudos

Hi

All you can do using ABAP you can do by ABAP Object.

It's another way of programming, I think Abap OO is more power for graphic than Abap: infact now there are many graphic objects (for example tree menu) there aren't before.

Max

0 Kudos

hi,

thanks max, do you have any example to use Abap object?

0 Kudos

For example, here is a program that uses a method of the class to copy a file on the frontend.

You can make some comparisons between Function Groups/Function modules and Class/Methods.

http://help.sap.com/saphelp_nw2004s/helpdata/en/c3/225b5954f411d194a60000e8353423/frameset.htm




report zrich_0002 .


parameters: source type localfile,
            destin type localfile.

at selection-screen on value-request for source.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = source.

at selection-screen on value-request for destin.
  call function 'KD_GET_FILENAME_ON_F4'
       exporting
            static    = 'X'
       changing
            file_name = destin.


start-of-selection.

  data: xsource type string.
  data: xdestin type string.

  xsource = source.
  xdestin = destin.

  call method cl_gui_frontend_services=>file_copy
    exporting
      source             = xsource
      destination        = xdestin
*    OVERWRITE          = SPACE
    exceptions
      cntl_error         = 1
      error_no_gui       = 2
      wrong_parameter    = 3
      disk_full          = 4
      access_denied      = 5
      file_not_found     = 6
      destination_exists = 7
      unknown_error      = 8
      path_not_found     = 9
      disk_write_protect = 10
      drive_not_ready    = 11
      others             = 12.

Regards,

Rich Heilman

0 Kudos

Hi

No! I'm sorry but...I developed a my local class to create some methods to upload/dowloand the files. I you want (and give me your mail) I send it to you.

Anyway you can see the program DEMO_ABAP_OBJECT*

Max

0 Kudos

oks, i apreciate a lot if you could send me to jrmr2005@gmail.com

Former Member
0 Kudos

Hi,

now we are using Abap objects not only for ALV's but also for other purpose, goto Transaction code SE24 and press F4, you will find lot of Classess, read the Documentation of the Class, then you come to know the purpose of that class .....

Regards

Sudheer

Former Member
0 Kudos

Hi,

In my opinion I see ABAP Objects like the next generation of ABAP. The main difference is that ABAP is an imperative paradigm language while ABAP Objects is object oriented. I really do think that Object oriented paradigm are one the strongest because of all the advantages they have, such languages like JAVA, C++, .NET are a great example. And maybe that's why of the reason that ABAP Objects has borned. So I believe that we should all start using ABAP Objects for any requeriment, although I still don't do everything under Objects, I believe that would be the practice under a short term.

Regards,

Gilberto Li