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

general issue with class declaration

Former Member
0 Likes
823

Hi all,

Iam very new to OO programming.

can any one tell as how i should call a CLASS

FOR FM , i know we use click pattern and give the required FM name and it would bring up the code in the editor and we have to pass the necessary parameters

but how should i call a class , is there a way to call it or do i need to write the code manually

say when i code like this does that mean it has been typed or just called like a FM

If its called like FM , let me know how its called

CALL METHOD cl_gui_frontend_services=>file_open_dialog

EXPORTING

window_title = 'Select file for download'

default_extension = '.txt'

initial_directory = 'C:\'

CHANGING

file_table = li_filetable

rc = lv_return

EXCEPTIONS

file_open_dialog_failed = 1

cntl_error = 2

error_no_gui = 3

OTHERS = 4

.

Thanks

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
787

Hi,

You can use pattern (SE38) same as FM.

But instead choose ABAP Object Pattern -> OK -> Select Call Method -> Enter CL_GUI_FRONTEND_SERVICES (Class/Interface) -> Enter FILE_OPEN_DIALOG (Method) -> OK.

Regards,

Ferry Lianto

8 REPLIES 8
Read only

Former Member
0 Likes
787

hai

we can like function module.

in editor ,just click pattern button. in that,select second radio button abap object...

after that, it ask for class, object and other things...

regards,

tamil

Read only

ferry_lianto
Active Contributor
0 Likes
788

Hi,

You can use pattern (SE38) same as FM.

But instead choose ABAP Object Pattern -> OK -> Select Call Method -> Enter CL_GUI_FRONTEND_SERVICES (Class/Interface) -> Enter FILE_OPEN_DIALOG (Method) -> OK.

Regards,

Ferry Lianto

Read only

0 Likes
787

Hi all,

This is what i was looking for

iam awarding points all

Thanks

Read only

0 Likes
787

Hi Ferry,

i don't see call method under AABAP OBJECTS PATTERN

I AM LOOKING IN 4.6C VERSION

LET ME KNOW

THANKS

Read only

0 Likes
787

Hi all,

i got that . Thanks for your answers

kajol

Read only

Former Member
0 Likes
787

Hi,

You can use the pattern for abap oo class method also..

Press the pattern button..

Choose the radio button "AABAP Objects patterns"

Give the class name and the method name..It will give the parameters like FM..

Thanks,

Naren

Read only

Former Member
0 Likes
787

Hi,

IN that screen..

GIve the class name cl_gui_frontend_services and the method name file_open_dialog.

And then press enter..

Thanks,

Naren

Read only

ferry_lianto
Active Contributor
0 Likes
787

Hi,

Sorry ... I am in SAP 4.7 and ECC 5.0.

I am not sure whether is available in 4.6C (i am afraid you need to type by yourself).

When you click on Pattern button (SE38), system should display an option for AABAP Object Patterns (4.7) and ABAP Object Patterns (ECC 5.0).

Then you click on OK button in order to see another selection for OO Statement Pattern (new popup window). In here, you should see Call Method selection and others.

Regards,

Ferry Lianto