Posted: Sat Sep 08, 2007 5:56 pm Post subject: SAPGUI, Presentation Server | Сервер представления (PC)
DOWNLOAD
Store Internal Table with Dialog as File on the Presentation Server Calls WS_QUERY, WS_FILENAME_GET, WS_DOWNLOAD. Dialog like se38 "Download..."
WS_DOWNLOAD
Save Internal Table as File on the Presentation Server
UPLOAD
Load Data from the Presentation Server into an Internal Table / Dialog Calls WS_QUERY, WS_FILENAME_GET, WS_UPLOAD. Dialog like se38 "Upload..."
WS_UPLOAD
Load File from the Presentation Server into Internal Table
WS_FILENAME_GET
Call file Selector Browse and get file name of the chosen type
Code:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR PCPATH.
PERFORM WS_FILENAME_GET CHANGING PCPATH.
*&---------------------------------------------------------------------*
*& Form WS_FILENAME_GET
*&---------------------------------------------------------------------*
FORM WS_FILENAME_GET CHANGING P_PCPATH.
DATA: FILENAME LIKE PCPATH.
*call pop-up box to help user select path and file on PC....
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = 'db.txt'
DEF_PATH = 'C:\TEMP'
MASK = ',DB,*.txt.'
MODE = '0'
TITLE = 'Save DB Extract File As'
IMPORTING
FILENAME = FILENAME
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
IF SYST-SUBRC <> 0.
EXIT.
ELSE.
P_PCPATH = FILENAME.
ENDIF.
ENDFORM. " WS_FILENAME_GET
WS_EXECUTE
Execute an External Program on the Presentation Server
WS_MSG
Issue the Presentation Server style message Note. Only I, E and A types. Does not affect events flow logic.
WS_EXCEL
Download internal table into file and start Excel for it [and upload changed file into the internal table]. See also FTBU_START_EXCEL
WS_QUERY
Execute query function on the Presentation Server Query can be WS(windowsystem)-e.g.WN32 for WinNT, CD(directory), EN(environment)-?, FL(filelength), FE(filename exist)-returns 1(Yes)/0, FC(filename creator(Apple)), FT(filetype/status(UNIX only)), DE(directory exist)-returns 1(Yes)/0, OS(operating system)-e.g.NT for WinNT, WI(windowID)-?, XP(execute-path), GM(GMUX-version),RC(last returncode).
WS_FILE_DELETE - Delete File at the Frontend
WS_VOLUME_GET - Get the label from a frontend device.
F4_FILENAME
F4 for filename / Filemanager support to locate file in a directory Uses current dynpro value, calls WS_FILENAME_GET
KD_GET_FILENAME_ON_F4
Call file Selector Browse and get file name of the chosen type. Allows also File Mask (e.g. C:\Work\abc*.*)
GUI_GET_DESKTOP_INFO
Delivers Information About the Desktop (client) TYPE= -1(SAP dir) -2(SAP sys dir) 1(computer name) 2(Win dir) 3(Sys dir) 4(tmp dir) 5(user name) 6(Win OS) 7(Win build No) 8(Win ver) 9(SAP GUI program name) 10(SAP GUI program path) 11(SAP current dir) 12(desktop dir)
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
P_FILE = ACTUAL_FILE.
GUI_IS_AVAILABLE
'X' if yes
GUI_GET_REGVALUE
Get value from the Workstation Registry
Code:
DATA: reg_key(80) TYPE c
VALUE ''Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',
reg_field(80) TYPE c VALUE 'Personal',
value(80) TYPE c VALUE '<missing>',
hkey_current_user TYPE i VALUE 1.
TMP_GUI_DIRECTORY_LIST_FILES
Imports: directory (ended with '\'), filter (default '*.*').
Returns: list of files, list of subdirectories.
TMP_GUI_GET_SYSTEMDIR
TMP_GUI_GET_COMPUTERNAME
TMP_GUI_GET_TEMPPATH
PC_CHECK_DRIVE
Self-explanatory names Checks for correctness only, not existence (can be checked for DOS also)
PC_CHECK_PATH
PC_CHECK_FILENAME
PC_CHECK_EXTENSION
PC_CHECK_PATH_WITH_DRIVE
PC_CHECK_FILENAME_WITH_EXT
PC_BUILD_COMPLETE_FILENAME
PC_SPLIT_COMPLETE_FILENAME
POPUP_DISPLAY_TEXT
Text display dialog box
Code:
PARAMETERS: CL_VARI AS CHECKBOX DEFAULT ' '.
AT SELECTION-SCREEN ON HELP-REQUEST FOR CL_VARI.
PERFORM POPUP_FOR_F1HELP USING 'CL_VARI'.
*&---------------------------------------------------------------------*
*& Form POPUP_FOR_F1HELP
*&---------------------------------------------------------------------*
FORM POPUP_FOR_F1HELP USING SOURCE_READ.
DATA: TEXT_OBJECT LIKE DOKHL-OBJECT.
CASE SOURCE_READ.
WHEN 'CL_VARI'.
TEXT_OBJECT = 'FI_GENERATING_FLAG'.
ENDCASE.
CALL FUNCTION 'POPUP_DISPLAY_TEXT'
EXPORTING
LANGUAGE = SY-LANGU
POPUP_TITLE = ' '
TEXT_OBJECT = TEXT_OBJECT
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " POPUP_FOR_F1HELP
POPUP_DISPLAY_TEXT_USER_BUTTON
Dialog Box with User-Defined Pushbuttons for Displaying a Text
POPUP_DISPLAY_TEXT_WITH_PARAMS
Dialog box for displaying a text with parameters
TMP_GUI_DIRECTORY_LIST_FILES - Retrieve all of the files and subdirectories on the Presentation Server (PC) for a given directory.
Imports: directory (ended with '\'), filter (default '*.*').
When a value other than * or *.* is used for the filter, you will not get any directories, unless they match your wildcard filter. For example, if you entered *.png, then only files and directories that end in png will be returned by the function.
Code:
data: lc_directory like bdschko16-target_dir value 'C:\TEMP\',
lc_filter(20) type c default '*.*'.
li_file_count type i,
li_dir_count type i,
ltab_dir_table like sdokpath occurs 0 with header line,
ltab_file_file_table like sdokpath occurs 0 with header line.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.