SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

SAPGUI, Presentation Server | Сервер представления (PC)



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Sep 08, 2007 5:56 pm    Post subject: SAPGUI, Presentation Server | Сервер представления (PC) Reply with quote

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)

GUI_GET_FILE_INFO
Version, language, single-character flag, size

GUI_GET_FILELIST_INFO
Like previous, but for list of files

GUI_HAS_OBJECTS
SAPGUI object models OBJECT_MODEL= ACTX | JBEAN | OLE | SAP | HTML
Returns 'X' if model supported.

GUI_HAS_ACTIVEX
Calls GUI_HAS_OBJECTS with OBJECT_MODEL= ACTX

GUI_HAS_JAVABEANS
Calls GUI_HAS_OBJECTS with OBJECT_MODEL= JBEAN

GUI_IS_ITS
Calls GUI_HAS_OBJECTS with OBJECT_MODEL= HTML (ITS - Internet Transaction Server)

GUI_GET_OBJECT_MODELS
Returns table within all models supported

GUI_DELETE_FILE

GUI_CREATE_DIRECTORY
Create a Directory in the user local PC

GUI_REMOVE_DIRECTORY

GUI_RUN
Start a File or Program Asynchronously with ShellExecute Imports: command, parameter, working dir.

GUI_EXEC
Start a File or Program Asynchronously with WinExec
Imports: command, parameter.

GUI_UPLOAD
FILETYPE= BIN | DAT | ASC

GUI_DOWNLOAD
FILETYPE= BIN | ASC

C13Z_FRONTEND_FILENAME_GET
F4 for GUI_DOWNLOAD FILENAME

Code:

PARAMETERS: p_file(60) DEFAULT 'c:\test.xls'.
DATA: gui_filename TYPE string,
gui_directory TYPE string,
actual_file TYPE rcgfiletr-ftfront.

*-------------------------------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*-------------------------------------------------------------------
GUI_FILENAME = 'test.txt'.
GUI_DIRECTORY = 'c:\dir'.
CALL FUNCTION 'C13Z_FRONTEND_FILENAME_GET'
  EXPORTING
* I_WINDOW_TITLE =
  I_DEFAULT_FILENAME = GUI_FILENAME
  I_INITIAL_DIRECTORY = GUI_DIRECTORY
IMPORTING
  E_FILENAME = ACTUAL_FILE
* TABLES
* I_FILE_EXTENSION_TAB =
* EXCEPTIONS
* INTERNAL_ERROR = 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.

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.

CALL FUNCTION 'GUI_GET_REGVALUE'
  EXPORTING
    root = hkey_current_user
    key = reg_key
    value_name = reg_field
  CHANGING
    string = value
  EXCEPTIONS
    registry_error = 1.

  IF sy-subrc IS INITIAL.
    MOVE value TO gf_file.
  ELSE.
    gf_file = 'C:\'. "#EC NOTEXT
  ENDIF.


GUI_SET_REGVALUE
Set value in the Workstation Registry

Self-explanatory names
TMP_GUI_CREATE_DIRECTORY
No-flush and flush allowed

TMP_GUI_REMOVE_DIRECTORY

TMP_GUI_DELETE_FILE

TMP_GUI_GET_FILE_EXIST
File or directory. For file returns also filelength.

TMP_GUI_READ_DIRECTORY
Imports: directory name, extension (space for all).
Returns list of file names.

TMP_GUI_BROWSE_FOR_FOLDER
Imports: window title, initial folder.
Returns folder name.

Code:
CALL FUNCTION 'TMP_GUI_BROWSE_FOR_FOLDER'
  EXPORTING
    window_title = 'Select the Appropriate Folder'
    initial_folder = p_folder
  IMPORTING
    selected_folder = p_fname
  EXCEPTIONS
    cntl_error = 1
    OTHERS = 2.

TMP_GUI_FILE_OPEN_DIALOG
Multiselection allowed

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.
       
call function 'TMP_GUI_DIRECTORY_LIST_FILES'
  exporting
    directory        = lc_directory
    filter           = lc_filter  importing
    file_count       = li_file_count
    dir_count        = li_dir_count
  tables
    file_table       = ltab_file_table
    dir_table        = ltab_dir_table
  exceptions
    cntl_error       = 1
    others           = 2.


CLPB_EXPORT - Export a text table to the clipboard (on presentation server)

CLPB_IMPORT - Import a Text Table from the Clipboard (on presentation server)

PROFILE_GET - Read an Entry in an INI File on the frontend

PROFILE_SET - Write an Entry in an INI File on the frontend

REGISTRY_GET - Read an Entry from the Registry

REGISTRY_SET - Set an entry in the Registry
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Function Modules | Функциональные модули All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.