0 1. Upgrade 에 따른 File Controlling Issue - SAP 에서는 향후 ‘WS_’ 로 시작하는 기존의 Function Module 들을 사용하지 말고 CL_GUI_FRONTEND_SERVICES Class 의 Method 를 사용할 것을 권고함.

Slides:



Advertisements
Similar presentations
ABAP Chapter 5 Modularization Catch Statement.
Advertisements

ABAP/4 PROGRAMMING Internal Table 講 師:呂 昇 燦 2000 年 9 月 26 日.
TFTP (Trivial File Transfer Protocol)
The Web Warrior Guide to Web Design Technologies
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
Lecture 7 Debugging Code & Data Import/Export © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
ABAP Chapter 6 Message Debugging File Transfer Type Group.
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
Creating And Maintaining A Database. 2 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of.
8/6/2015Auto Attendants 1 Smarter Communications.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Inti Online Login Page (Lecturer/Student/Administrator View)
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
© 2005 Avaya Inc. All rights reserved. Placing Orders via Avaya Solution Designer (ASD) Upload Method
DHL EasyShip to WorldShip Commodity Transfer
Control Break Report ALV Report
Microsoft Access Intro Class 2 Designing Databases and Tables.
ICP Kit 2011 HHC Data Entry Module The World Bank ICP Kit Training African Development Bank.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
SAP Script. 2 The ASP plus Solutions Company SAP Script is the SAP System's own text- processing system. SAP Script is integrated text management system.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Part 1 – PubMed Interface, Display options, Saving, Printing, and ing results. Instructions This part of the course is a PowerPoint demonstration.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
Using Client-Side Scripts to Enhance Web Applications 1.
Execute Workflow. Home page To execute a workflow navigate to My Workflows Page.
Website Development with PHP and MySQL Saving Data.
User Dialog Overview. Update Statement TABLES customers. SELECT SINGLE * FROM customers WHERE id = 1. IF sy-subrc = 0. customers-name = ‘John’. UPDATE.
Updates made to latest draft since Herndon Sony Corporation Toshiaki Kojima.
MIS 3020 ABAP Programming Lecture 2 Elementary & User Defined Types Domains, Elements, Variables/Fields.
CMPS 1371 Introduction to Computing for Engineers FILE Input / Output.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
Isograph Reliability Software FaultTree+ V10.1 What’s New.
Plugin management in Geronimo admin console
How to Import Transactions using the ASCII File Post Process Session 267 Presented By: Jim Collins Director of IS Graceland University This presentation.
ABAP Programming MINS298c Fall Overview Hiding in ABAP Primitive Pagination ABAP does Windows Making Messages Assignments.
The Report Generator Viewing Student Outcomes. Install the Report Generator In a browser, go to Click.
] COREY PEARSON [ ASUG INSTALLATION MEMBER MEMBER SINCE: 2008 CHAVONE JACOBS [ ASUG INSTALLATION MEMBER MEMBER SINCE: 2003 ALLAN FISHER [ ASUG INSTALLATION.
1 EXCEL Interface Northern Arizona University College of Business.
Agenda Positional Parameters / Continued... Command Substitution Bourne Shell / Bash Shell / Korn Shell Mathematical Expressions Bourne Shell / Bash Shell.
SELECT-OPTIONS. SELECT-OPTIONS Syntax TABLES customers. SELECT-OPTIONS id FOR customers-id. START-OF-SELECTION.
FIRST COURSE Integration Tutorial 2 Integrating Word, Excel, and Access.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
SAP DEVELOPMENT BASICS Bohuslav Tesar. TRAINING OVERVIEW Amazing life of ABAP developer ;) SAP introduction ABAP basics ABAP Reporting.
PubMed/How to Search, Display, Download & (module 4.1)
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
B Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Working with PDF and eText Templates.
1 PDMLink Application - User Features & Functions Module 6: Search Capabilities.
BW 3.0A ABAP Coding 목차 1.InfoSources. 2.InfoProvider. 3.User Exit for Variables.
File Operations. FILE PROCESSING For the purposes of the following discussion, reading means copying all or part of an existing file into memory Writing.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Computer Science 112 Fundamentals of Programming II Data Fields for I/O and Message Boxes for Error Recovery.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Citation format 1 The “Citation” display option is similar to the abstract display but has some extra information such as MeSH terms and substances listed.
Creates the file on disk and opens it for writing
Click on the assignment you wish to complete
Functions (subprograms)
Topics Introduction to File Input and Output
File IO and Strings CIS 40 – Introduction to Programming in Python
PowerPoint Mockup of CMS Code Generator
Configuring Internet-related services
Creates the file on disk and opens it for writing
Chapter (3) - Looping Questions.
KARDEX Drive IM Interface
Upgrade to Project Plan
Creating a Database and a table
Upgrade to Project Plan
Topics Introduction to File Input and Output
Excel Tips & Tricks July 18, 2019.
Presentation transcript:

0 1. Upgrade 에 따른 File Controlling Issue - SAP 에서는 향후 ‘WS_’ 로 시작하는 기존의 Function Module 들을 사용하지 말고 CL_GUI_FRONTEND_SERVICES Class 의 Method 를 사용할 것을 권고함. Function Group  Class, Function Module  Method 로 ABAP 개발환경이 변화하는 추세의 일환으로 판단됨. - Function Group ‘GRAP’ 에 포함된 아래의 Function Module 은 변경하여야 한다. CLPB_IMPORT: Send Text Table to Presentation Server Clipboard CLPB_EXPORT: Load Text Table from Presentation Server Clipboard DOWNLOAD: Save Internal Table as Presentation Server File with File Length UPLOAD: Transfer Presentation Server File to Internal Table with Length WS_DOWNLOAD: File Transfer from Internal Table to Presentation Server File WS_UPLOAD: Transfer Presentation Server File to Internal Table WS_FILENAME_GET: Call File Selector WS_EXCEL: Excel File 이들 Function Module 에 대한 대체될 Function 들은 ‘SFES’ Function Group 에서 찾을 수 있다. (WS_  GUI_ 로 변경 ) ‘SFES’ Function Group 은 내부가 CL_GUI_FRONTEND_SERVICES Class 의 Method 들로 구현됨. GUI_FILE_SAVE_DIALOG: Get Download File Name GUI_DOWNLOAD: Download GUI_UPLOAD: Upload CL_GUI_FRONTEND_SERVICE=>CLIPBOARD_EXPORT: Exports data to clipboard CL_GUI_FRONTEND_SERVICE=>CLIPBOARD_IMPORT: Imports data from clipboard CL_GUI_FRONTEND_SERVICE=>EXECUTE: Starts an Application or Opens a Document in the Client CL_GUI_FRONTEND_SERVICE=>FILE_OPEN_DIALOG: Displays a File Open Dialog CL_GUI_FRONTEND_SERVICE=>FILE_SAVE_DIALOG: Shows a File Save Dialog CL_GUI_FRONTEND_SERVICE=>GUI_DOWNLOAD: Download Data to Client PC CL_GUI_FRONTEND_SERVICE=>GUI_UPLOAD: Upload Data from Client PC ※ 관련 Notes : WS_DOWNLOAD, WS_UPLOAD Function Module 을 GUI_DOWNLOAD, GUI_UPLOAD 로 변경할 것 , : WS_FILENAME_GET Function Module 을 CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG, CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG 로 변경할 것. File Controlling

1 2. Get File Name - CL_GUI_FRONTEND_SERVICES Class 에 속한 Method 를 이용하여 파일명을 선택한다. DATA : L_FILE_TABLE TYPE FILETABLE, L_RC TYPE I, L_USER_ACTIO TYPE I, FILE_NAME TYPE STRING. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG EXPORTING : WINDOW_TITLE = 'File Open' DEFAULT_FILENAME = SPACE FILE_FILTER = '*.xls' INITIAL_DIRECTORY = 'C:\' MULTISELECTION = SPACE CHANGING : FILE_TABLE = L_FILE_TABLE RC = L_RC EXCEPTIONS : FILE_OPEN_DIALOG_FAILED = 1 CNTL_ERROR = 2 ERROR_NO_GUI = 3 OTHERS = 5. READ TABLE L_FILE_TABLE INTO FILE_NAME INDEX 1. DATA : LF_SEL_FILE TYPE STRING, LF_SEL_PATH TYPE STRING, LF_FULL_PATH TYPE STRING, LF_USER_ACTION TYPE I, FILE_NAME TYPE STRING. CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG EXPORTING : WINDOW_TITLE = 'Save File' DEFAULT_FILE_NAME = SPACE FILE_FILTER = '*.xls' INITIAL_DIRECTORY = 'C:\' CHANGING : FILENAME = LF_SEL_FILE PATH = LF_SEL_PATH FULLPATH = LF_FULL_PATH USER_ACTION = LF_USER_ACTION EXCEPTIONS : CNTL_ERROR = 1 ERROR_NO_GUI = 2 OTHERS = 4. CONCATENATE LF_SEL_PATH LF_SEL_FILE INTO FILE_NAME. File Controlling ※ CALL FUNCTION 'WS_FILENAME_GET'  4.6C (SAP_BASIS 41), 4.70 이상에서 사용 불가 ※ CALL FUNCTION ‘GUI_FILE_SAVE_DIALOG’ 로 변경

2 3. ASCII File Read - CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD Method 를 이용하여 ASCII File 에서 Data 를 읽어 Internal Table 에 저장한다. CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD EXPORTING : FILENAME = FILE_NAME FILETYPE = 'ASC' HAS_FIELD_SEPARATOR = C_TAB CHANGING : DATA_TAB = ITAB1[] EXCEPTIONS : FILE_OPEN_ERROR = 1 "File does not exist, cannot open FILE_READ_ERROR = 2 "File read error NO_BATCH = 3 "Front-end function cannot be executed GUI_REFUSE_FILETRANSFER = 4 "Incorrect front end, or error INVALID_TYPE = 5 "Incorrect parameter FILETYPE NO_AUTHORITY = 6 "No upload authorization UNKNOWN_ERROR = 7 "Unknown error BAD_DATA_FORMAT = 8 "Could not interpret data in file HEADER_NOT_ALLOWED = 9 "Invalid header SEPARATOR_NOT_ALLOWED = 10 "Invalid separator HEADER_TOO_LONG = 11 "Header information is maximum 1023 UNKNOWN_DP_ERROR = 12 "Error when calling data provider ACCESS_DENIED = 13 "No access to file DP_OUT_OF_MEMORY = 14 "Not enough memory in data provider DISK_FULL = 15 "Disk full DP_TIMEOUT = 16."Data provider timeout File Controlling ※ CALL FUNCTION ‘WS_UPLOAD‘  사용 불가 ※ CALL FUNCTION 'GUI_UPLOAD'  동일 기능

3 4. ASCII File Save - CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD Method 를 이용하여 Internal Table Data 를 ASCII File 에 저장한다. CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD EXPORTING : FILENAME = FILE_NAME FILETYPE = 'ASC' APPEND = SPACE WRITE_FIELD_SEPARATOR = C_TAB CHANGING : DATA_TAB = ITAB1[] EXCEPTIONS : FILE_WRITE_ERROR = 01 "Cannot write to file NO_BATCH = 02 "Front-end function cannot be executed GUI_REFUSE_FILETRANSFER = 03 "Incorrect front-end INVALID_TYPE = 04 "Invalid value for parameter FILETYPE NO_AUTHORITY = 05 "No download authorization UNKNOWN_ERROR = 06 "Unknown error HEADER_NOT_ALLOWED = 07 "Invalid header SEPARATOR_NOT_ALLOWED = 08 "Invalid separator FILESIZE_NOT_ALLOWED = 09 "File size invalid HEADER_TOO_LONG = 10 "Header information is maximum 1023 DP_ERROR_CREATE = 11 "Cannot create Data Provider DP_ERROR_SEND = 12 "Error when sending data with DP DP_ERROR_WRITE = 13 "Error when writing data with DP UNKNOWN_DP_ERROR = 14 "Error when calling data provider ACCESS_DENIED = 15 "No access to file DP_OUT_OF_MEMORY = 16 "Not enough memory in data provider DISK_FULL = 17 "Disk full DP_TIMEOUT = 18 "Data provider timeout FILE_NOT_FOUND = 19 "Could not find file DATAPROVIDER_EXCEPTION = 20 "General exception error CONTROL_FLUSH_ERROR = 21."Error in control framework ※ CALL FUNCTION ‘WS_DOWNLOAD‘  사용 불가 ※ CALL FUNCTION 'GUI_DOWNLOAD'  동일 기능 File Controlling

4 5. Excel File Read - ALSM_EXCEL_TO_INTERNAL_TABLE Function 을 이용하여 Excel File 의 Data 를 읽어온다. DATA : FILENAME LIKE RLGRAP-FILENAME VALUE 'C:\sample_data.xls'. DATA : XLS_DATA1 TYPE STANDARD TABLE OF ALSMEX_TABLINE WITH HEADER LINE. CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE' EXPORTING FILENAME = FILENAME I_BEGIN_COL = 1 I_BEGIN_ROW = 2 I_END_COL = 20 I_END_ROW = TABLES INTERN = XLS_DATA1 EXCEPTIONS INCONSISTENT_PARAMETERS = 1 UPLOAD_OLE = 2 OTHERS = 3. LOOP AT XLS_DATA1. CASE XLS_DATA1-COL. WHEN '001'. ITAB1-MATNR = XLS_DATA1-VALUE. WHEN '002'. ITAB1-MAKTX = XLS_DATA1-VALUE. ENDCASE. AT END OF ROW. CHECK ITAB1-MATNR NE SPACE. APPEND ITAB1. ENDAT. ENDLOOP. ALSMEX_TABLINE Structure ROWFlexible Excel Upload : Row number COLColumn VALUEComment : String Value File Controlling

5 6. Excel File Save - MS_EXCEL_OLE_STANDARD_DAT Function 을 이용하여 Excel File 에 Data 를 저장한다. DATA : BEGIN OF H_CAT OCCURS 0, IDX(02) TYPE N, "Index FIELD(30) TYPE C, "Field Name TITLE(20) TYPE C, "Title END OF H_CAT. DATA : BEGIN OF DOWN OCCURS 0, F1(50), F2(50), F3(50), F4(50), F5(50), F6(50), F7(50), F8(50), F9(50), F10(50), F11(50), F12(50), F13(50), F14(50), F15(50), F16(50), F17(50), F18(50), F19(50), F20(50), F21(50), F22(50), F23(50), F24(50), F25(50), F26(50), F27(50), F28(50), F29(50), F30(50), F31(50), F32(50), F33(50), F34(50), F35(50), F36(50), F37(50), F38(50), F39(50), F40(50), END OF DOWN. DATA : FLD1(40), FLD2(40), CNT(2), TABIX TYPE I. FIELD-SYMBOLS :,. PERFORM ADD_FIELDCAT USING : '01' 'MATNR' ‘Material’, '02' 'MAKTX' ‘Description’, '03' 'MEINS' ‘Unit’, '04' 'WAERS' ‘Currency’, '05' 'NETPR' ‘Price’. File Controlling LOOP AT ITAB1. TABIX = SY-TABIX. LOOP AT H_CAT. CNT = SY-TABIX. FLD1 = H_CAT-FIELD. CONCATENATE 'DOWN-F' CNT INTO FLD2. ASSIGN (FLD2) TO. ASSIGN COMPONENT FLD1 OF STRUCTURE ITAB1 TO. =. ENDLOOP. APPEND DOWN. CLEAR DOWN. ENDLOOP. CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT' EXPORTING FILE_NAME = FILENAME TABLES DATA_TAB = DOWN_TABLE FIELDNAMES = FIELDNAME. * FORM ADD_FIELDCAT USING P_IDX P_FIELD P_TITLE. MOVE : P_IDX TO H_CAT-IDX, P_FIELD TO H_CAT-FIELD, P_TITLE TO H_CAT-TITLE. APPEND H_CAT. ENDFORM.

6 7. Excel File Save - XXL_FULL_API Function 을 이용하여 Excel Data 와 Pivot Table 을 저장한다. DATA : BEGIN OF IT_DATA OCCURS 0, MATNR LIKE MARA-MATNR, “ 자재번호 MAKTX LIKE MAKT-MAKTX, “SVC 품명 LGPBE LIKE MARD-LGPBE, “ 저장 Bin FRLAB(20) TYPE C, “ 접수처재고 LGORT(20) TYPE C, “ 청구저장위치 GIREM(20) TYPE C, “ 출고예정수량 END OF IT_DATA. DATA : XMPLT_O TYPE TABLE OF GXXLT_O WITH HEADER LINE, XMPLT_P TYPE TABLE OF GXXLT_P WITH HEADER LINE, XMPLT_H TYPE TABLE OF GXXLT_H WITH HEADER LINE, XMPLT_V TYPE TABLE OF GXXLT_V WITH HEADER LINE, XMPLT_S TYPE TABLE OF GXXLT_S WITH HEADER LINE. XMPLT_V-COL_NO = 1. XMPLT_V-COL_NAME = ' 자재번호 '. APPEND XMPLT_V. XMPLT_V-COL_NO = 2. XMPLT_V-COL_NAME = 'SVC 품명 '. APPEND XMPLT_V. XMPLT_V-COL_NO = 3. XMPLT_V-COL_NAME = ' 저장 BIN'. APPEND XMPLT_V. XMPLT_V-COL_NO = 4. XMPLT_V-COL_NAME = ' 접수처재고 '. APPEND XMPLT_V. XMPLT_V-COL_NO = 5. XMPLT_V-COL_NAME = ' 청구저장위치 '. APPEND XMPLT_V. XMPLT_H-COL_NO = 1. XMPLT_H-ROW_NO = 1. XMPLT_H-COL_NAME = ' 출고예정수량 '. APPEND XMPLT_H. XMPLT_S-COL_NO = 1. XMPLT_S-COL_TYP = 'STR'. XMPLT_S-COL_OPS = 'DFT'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. XMPLT_S-COL_NO = 2. XMPLT_S-COL_TYP = 'STR'. XMPLT_S-COL_OPS = 'DFT'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. XMPLT_S-COL_NO = 3. XMPLT_S-COL_TYP = 'STR'. XMPLT_S-COL_OPS = 'DFT'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. File Controlling

7 CALL FUNCTION 'XXL_FULL_API' EXPORTING N_VRT_KEYS = 5 N_ATT_COLS = 1 N_HRZ_KEYS = 1 SEMA_TYPE = 'X' FILENAME = 'TEST' HEADER_1 = 'DATA' HEADER_2 = 'PIVOT' NO_DIALOG = ' ' TABLES VKEY = XMPLT_V HKEY = XMPLT_H DATA = IT_DATA SEMA = XMPLT_S ONLINE_TEXT = XMPLT_O PRINT_TEXT = XMPLT_P EXCEPTIONS CANCELLED_BY_USER = 01 DATA_TOO_BIG = 02 DIM_MISMATCH_DATA = 03 DIM_MISMATCH_SEMA = 04 DIM_MISMATCH_VKEY = 05 ERROR_IN_HKEY = 06 ERROR_IN_SEMA = 07 FILE_OPEN_ERROR = 08 FILE_WRITE_ERROR = 09 OTHERS = 10. XMPLT_S-COL_NO = 4. XMPLT_S-COL_TYP = 'STR'. XMPLT_S-COL_OPS = 'DFT'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. XMPLT_S-COL_NO = 5. XMPLT_S-COL_TYP = 'STR'. XMPLT_S-COL_OPS = 'DFT'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. XMPLT_S-COL_NO = 6. XMPLT_S-COL_TYP = 'NUM'. XMPLT_S-COL_OPS = 'ADD'. XMPLT_S-COL_SRC = 0. XMPLT_S-COL_CUR = 0. APPEND XMPLT_S. ※ N_VRT_KEYS + N_ATT_COLS 는 Internal Table 의 Field 수와 동일해야 한다. ※ COL_TYP - ‘STR’ : String - ‘DAT’ : Date - ‘MON’ : Month - ‘PCT’ : Percent - ‘NUM’ : Numeric ※ COL_OPS - ‘DFT’ : Default - ‘ADD’ : Additional File Controlling