2008 Aug 19 9:25 AM
Hi,
please tell me the difference between cl_gui_frontend_services=>gui_upload
and
call function gui_upload.
Before i have used call function gui_upload
now i want to change cl_gui_frontend_services=>gui_upload
i dont know oop abap.
if if use cl_gui_frontend_services=> any changes i have to do in my program ????.
Thanks is Advance
Regards
Hi,
please tell me the difference between cl_gui_frontend_services=>gui_upload
and
call function gui_upload.
Before i have used call function gui_upload
now i want to change cl_gui_frontend_services=>gui_upload
i dont know oop abap.
if if use cl_gui_frontend_services=> any changes i have to do in my program ????.
Thanks is Advance
Regards
2008 Aug 19 9:27 AM
Hi,
It is a way of represeinting the same funciton in procedural language using CALL FUCNTION and in classes (OOPS based) .
CALL FUNCTION is a traditional approach, using the classes is a OO approach
Just call the class CL_GUI_FRONTEND_SERVICES in the Pattern button to call a class, in that ABAP Object Patterns specify the class name CL_GUI_FRONTEND_SERVICES, method name specify the GUI_UPLOAD.
this way we can call the Class. As this class is the STATIC class there is no need of creating a object for it. We can directly use this class in the program.
Just pass the apt variables, strcutures to the class etc as you were doing in the traditionl approach . Rest all is the same.
cl_gui_frontend_services=>gui_upload(
EXPORTING
FILENAME = SPACE
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = SPACE
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
VIRUS_SCAN_PROFILE = VIRUS_SCAN_PROFILE
IMPORTING
FILELENGTH = FILELENGTH
HEADER = HEADER
CHANGING
data_tab = 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
NOT_SUPPORTED_BY_GUI = 17
ERROR_NO_GUI = 18
).
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
We go for this OO as there are changes made to the SAP R/3 where most of the things are OO. The Operating system or Kernel of the SAP lastest veriosns support OO. For easy implementations and resuability we go for OO.
Regards
Lekha
2008 Aug 19 9:29 AM
Both are same.
cl_gui_frontend_services=>gui_upload is OOPS method.
2008 Aug 19 9:38 AM
Hi,
Gui_upload is written in Normal ABAP and cl_gui_frontend_services=>gui_upload is written in oop ABAP
its an updated version of gui_upload.
2008 Aug 19 9:40 AM
Hi,
Gui_upload : it is normal function module to upload the File and XL Sheet Data into Internal table.
Call function Gui_upload : this Functionality used in OOPS.
Thanks&Regards,
naresh