Application Development and Automation 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: 
Read only

Classes

Former Member
0 Likes
492

Hey folks,

How to call a particular class from SE38.

Thanks in advance .

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
469

Hi,

Please try this.

1. Go to SE38.

2. Go to Edit mode.

3. Click on Pattern button.

4. Click on ABAP Object pattern.

5. Click on Continue button.

6. Enter Class CL_GUI_FRONTEND_SERVICES (for example).

7. Enter Method GUI_DOWNLOAD (for example).

8. Click on OK.

Regards,

Ferry Lianto

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
469

it would depend on how/if the class needs to be instaniated. If it has static methods you can call them straight way.





    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = lv_file
        filetype                = 'BIN'
*     has_field_separator     = SPACE
    IMPORTING
      filelength              = lv_file_length
      CHANGING
        data_tab                = lt_data
      EXCEPTIONS
        OTHERS                  = 19.

but if the method is an instance method, you would first have to create an object of the class, then call the method.



  DATA: gr_zip TYPE REF TO cl_abap_gzip.

  CREATE OBJECT gr_zip.
  call method  gr_zip->compress_binary(
                EXPORTING
                       raw_in = raw_in
                IMPORTING
                       gzip_out = zip_out ).

Regards,

RIch Heilman

Read only

ferry_lianto
Active Contributor
0 Likes
470

Hi,

Please try this.

1. Go to SE38.

2. Go to Edit mode.

3. Click on Pattern button.

4. Click on ABAP Object pattern.

5. Click on Continue button.

6. Enter Class CL_GUI_FRONTEND_SERVICES (for example).

7. Enter Method GUI_DOWNLOAD (for example).

8. Click on OK.

Regards,

Ferry Lianto

Read only

uwe_schieferstein
Active Contributor
0 Likes
469

Hello

If you display the class using either transaction <b>SE80 </b>or <b>SE24 </b>then you can run the class in <b>test-mode</b>. If instantiation is public then you can create an instance and call any of its public methods.

Regards

Uwe