‎2006 Mar 11 5:20 AM
hi,
Some one please help in finding the equivalent function module for WS_QUERY.
Girish.
‎2006 Mar 12 11:27 AM
Hi,
The Equivalent Function Module for WS_QUERY-File Exist in ABAP 4.7 is CL_GUI_FRONTEND_SERVICES=>FILE_EXIST or WS_QUERY-Directory Exist is CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST.
Sample code for Replacement of WS_QUERY-File Exists is::
data: WK_DIRECTRY(128) TYPE C .
CALL FUNCTION 'WS_QUERY'
EXPORTING
FILENAME = WK_DIRECTRY
QUERY = 'FE'
IMPORTING
RETURN = RC
EXCEPTIONS
INV_QUERY = 1
NO_BATCH = 2
FRONTEND_ERROR = 3
OTHERS = 4.
<b>Repleacement Function module is :</b>
DATA: W_FILENAME TYPE STRING,
W_RESULT TYPE C.
W_FILENAME = WK_DIRECTRY.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-* MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF W_RESULT IS INITIAL.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
EXPORTING
DIRECTORY = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
IF W_RESULT = 'X'.
RC = '1'.
ELSE.
RC = '0'.
ENDIF.
‎2006 Mar 11 5:25 AM
Your topic subject and your question inside look like two different things. What do you want to do? May be that will get you more answers, instead of asking for an alternative for WS_QUERY.
‎2006 Mar 11 5:31 AM
hi srinivas,
i am upgrading one program when i am doing EPC it is showing that ws_query is absolute and replace it with the other one can you guide me to that answer,
thanx,
Girish
‎2006 Mar 11 5:50 AM
You should use the methods of class CL_GUI_FRONTEND_SERVICES
or use function modules from function group
SFES
as suggested by the WS_QUERY FM documentation.
Regards
Raja
‎2006 Mar 11 3:52 PM
I am sorry, I misunderstood when you said ABSOLUTE instead of OBSOLETE. I thought you were looking for the ABS command and inside you were talking about WS_QUERY, that is why I got confused.
‎2006 Mar 11 7:52 PM
"Obsolete" doesn't mean that it won't work; just that you shouldn't use it in new development. If it's in an existing program you can just leave it.
Rob
‎2006 Mar 12 11:27 AM
Hi,
The Equivalent Function Module for WS_QUERY-File Exist in ABAP 4.7 is CL_GUI_FRONTEND_SERVICES=>FILE_EXIST or WS_QUERY-Directory Exist is CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST.
Sample code for Replacement of WS_QUERY-File Exists is::
data: WK_DIRECTRY(128) TYPE C .
CALL FUNCTION 'WS_QUERY'
EXPORTING
FILENAME = WK_DIRECTRY
QUERY = 'FE'
IMPORTING
RETURN = RC
EXCEPTIONS
INV_QUERY = 1
NO_BATCH = 2
FRONTEND_ERROR = 3
OTHERS = 4.
<b>Repleacement Function module is :</b>
DATA: W_FILENAME TYPE STRING,
W_RESULT TYPE C.
W_FILENAME = WK_DIRECTRY.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
EXPORTING
FILE = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-* MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF W_RESULT IS INITIAL.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_EXIST
EXPORTING
DIRECTORY = W_FILENAME
RECEIVING
RESULT = W_RESULT
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
WRONG_PARAMETER = 3
NOT_SUPPORTED_BY_GUI = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
IF W_RESULT = 'X'.
RC = '1'.
ELSE.
RC = '0'.
ENDIF.
‎2006 Mar 13 7:43 AM
Hi Ashok,
Thanx for ur Tip but my WS_QUERY looks like below
CALL FUNCTION 'WS_QUERY'
EXPORTING
query = 'WS'
IMPORTING
return = l_opsys
EXCEPTIONS
inv_query = 1
no_batch = 2
frontend_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MOVE sy-subrc TO p_subrc.
EXIT.
ENDIF.
ENDIF.
These parameters r not like u gave,
so,how can i proceed with this function module plz help me,
Girish.
‎2006 Mar 13 8:03 AM
your code would return the plafortm (example win32 , etc).
use the following code.
data: nplatform type i.
call method cl_gui_frontend_services=>get_platform
receiving
platform = nplatform
exceptions
error_no_gui = 1
cntl_error = 2
not_supported_by_gui = 3
others = 4.
if sy-subrc <> 0.
ndone = -1.
else.
ndone = 1.
case nplatform.
when cl_gui_frontend_services=>platform_windows95.
return = 'WN32_95'.
when cl_gui_frontend_services=>platform_windows98.
return = 'WN32_98'.
when cl_gui_frontend_services=>platform_nt351.
return = 'WN32'.
when cl_gui_frontend_services=>platform_nt40.
return = 'WN32'.
when cl_gui_frontend_services=>platform_nt50.
return = 'WN32'.
when cl_gui_frontend_services=>platform_mac.
return = 'MC'.
when cl_gui_frontend_services=>platform_os2.
return = 'PM'.
when cl_gui_frontend_services=>platform_linux.
return = 'MF'.
when cl_gui_frontend_services=>platform_hpux.
return = 'MF'.
when cl_gui_frontend_services=>platform_tru64.
return = 'MF'.
when cl_gui_frontend_services=>platform_aix.
return = 'MF'.
when cl_gui_frontend_services=>platform_solaris.
return = 'MF'.
when cl_gui_frontend_services=>platform_macosx.
return = 'MF'.
when 14. "PLATFORM_WINDOWSXP
return = 'WN32'.
when cl_gui_frontend_services=>platform_unknown.
return = '??'.
when others.
return = '??'.
endcase.
endif.
Regards
Raja
‎2006 Mar 13 8:53 AM
thanx Durairaj Athavan Raja ,
Your code really solved my problem Thank you,
Girish.