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: 

general doubt regarding class

Former Member
0 Kudos

Hi all,

can anyone tell under what class this method comes and how to find this.

iam getting this error

"P_FILE" is not type-compatible with formal parameter "FILE_NAME".

I have declared my p_file as

parameters : p_file like rlgrap-filename.

CALL METHOD cl_gui_frontend_services=>file_get_size

EXPORTING

file_name = p_file

IMPORTING

file_size = size.

2 REPLIES 2

Former Member
0 Kudos

parameters : p_file like rlgrap-filename.

data: TheFile type string. "<-- add this

    • Now move into a STRING data type.

move p_file to TheFile.

CALL METHOD cl_gui_frontend_services=>file_get_size

EXPORTING

file_name = TheFile " <---- Note change

IMPORTING

file_size = size.

messier31
Active Contributor
0 Kudos

Hi Preeti,

<b>CALL METHOD cl_gui_frontend_services=>file_get_size</b>

<b>cl_gui_frontend_services</b> - is the name of class &

<b>file_get_size</b> - is the name of method in class

Here <i>file_get_size</i> is method class i.e it an be used directly without creating any instance of class i.e directly by referring to the class name hence the class..

To get proper type for file name goto SE24 type the name of class cl_gui_frontend_services and place cursor on the above method name then click on the parameter button on top..from here you get the exact typ for file_name

Hope this helps you..

Enjoy SAP.

Pankaj Singh