‎2007 Mar 06 9:52 PM
Hi all,
what is the difference if i call a FM gui_upload directly from pattern using CALL FUNCTION
or if i call it USING CLASS
I MEAN TO SAY WHAT IS THE DIFFERENCE BETWEEN BELOW TWO CODES.
1)
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = SPACE
HEADER_LENGTH = 0
IMPORTING
FILELENGTH =
HEADER =
changing
data_tab =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
others = 17
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2)CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CAN ANYONE TELL WHAT 'S THE DIFFERENCE BETWEEN THE ABOVE TWO METHODS OF CALLING
Thanks
kajol
‎2007 Mar 06 9:55 PM
Hi,
I believe both are same..
If you check the class method code..The FM GUI_UPLOAD FM will be called..
Thanks,
Naren
‎2007 Mar 06 9:55 PM
Hi,
I believe both are same..
If you check the class method code..The FM GUI_UPLOAD FM will be called..
Thanks,
Naren
‎2007 Mar 06 10:01 PM
I think theres no difference as the class itself uses FM 'GUI_UPLOAD'.
It is suggested to use CLASS method however.
Thanks,
Santosh
‎2007 Mar 06 11:28 PM
Hi Kajol,
The cl_gui_frontend_services is developed for envelop the exists functions, to meet the OO develop requirement.
Both does the same job. If you look at the code inside the method cl_gui_frontend_services=>gui_upload, it would be calling GUI_UPLOAD function.
In terms of performance efficiency, there will be a very negligible difference and call function will be slightly better in my opinion.
Regards,
Ferry Lianto