| Yuxin's profileDream SpacePhotosBlogLists | Help |
|
|
4/18/2008 [SAP]Saving Passwords for SAP shortcutsPasswords are not saved in shortcuts created within SAPGUI. 4/15/2008 [ABAP]How to assign Fun. key to reserved key F4,Shift+F10How to assign Function key to 【予約機能キー】(reserved key) F4 and Shift-F10 ?
In Menu painter(SE41) place the cursor on the Function keys and click the "attributes" button in application tool bar or click Shift+F1. Then one pop-up screen appear where click the "Function keys for standard function handling in lists" checkbox. Then can have the option【予約機能キー】(Reserved Key) to assign your own function code for F4 key and Shift-F10 key. 4/10/2008 Authorization Checks in Your Own DevelopmentsEach time a transaction is started, the system automatically checks for authorization object S_TCODE. This check is also executed for any transactions that you created yourself. If you use the Profile Generator to generate your authorization profiles automatically, the authorizations for the authorization object S_TCODE are contained in the profiles. You can also add your own authorization checks to protect critical points in your ABAP programs. Adding Authorization Checks to Programs In order to maintain authorization objects and fields, you need access to the authorization object Authorizations (S_USER_AUT). To add authorization checks to programs, you need to do the following: 1. Create an Authorization Field 2. Create an Authorization Object 3. Programming Authorization Checks Use the ABAP AUTHORITY-CHECK statement. Specify alphabetic values in uppercase letters: ABC. Test values from user master records are converted to uppercase before being passed to AUTHORITY-CHECK. See the ABAP programming documentation for more information ( 4/2/2008 SAP Field ExitsFrom 4.6c onwards, Field exits will no more be supported by SAP. They removed the function of field exit but they had given lot of flexibility through userexit. However, if you still required it, here is how to activate it :- First called up transaction CMOD. or Activation of the field exits and assignment of the dynpros can also be carried out using program RSMODPRF. For this purpose, the program must be started without parameters (input fields remain blank). If required, new field exits can be created using program RSMODPRF (see the program documentation). 2/10/2008 解决win xp sp2及win 2003 sp1看不了sapshow notes的方法Start Registry Editor (Start -> Run -> regedit.exe)
Select the following key in the Windows registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\
Main\FeatureControl\FEATURE_DISABLE_MK_PROTOCOL] - Select "New" -> "DWORD Value" Value Name: sapshow.exe Value: 0x00000000 7/19/2007 ABAP中LOCAL关键字的使用 Local语句可以保护在子过程对全局变量的修改不会影响到子过程之外。特别是在子过程里不能直接使用Tables定义工作区,既是你将TABLES语句写在子过程里,该工作区也是全局性的。
如果你需要定义子程序内的工作区,你可以先用tables定义一个全局的,再在子程序里使用local定义本地的,代码样例如下:
REPORT demo_mod_tech_local. TABLES sflight. PERFORM tabtest1. WRITE: / sflight-planetype, sflight-price currency sflight-currency. PERFORM tabtest2. FORM tabtest1. FORM tabtest2. 5/31/2007 But fix for SAPgui for windows 640 and IE 7.00With upgrading your MS Internet Explorer to release 7.00 and running SAP GUI for Windows 6.40 the GUI controls based on HTML might work no longer properly. To fix this bug it is neseccary to patch your SAP GUI to patchlevel 23. Download the patch and run the exe-file on the machine where the SAP GUI for Windows 6.40 is installed. 5/14/2007 Using shortcut to auto logon SAPguiAs you know, SAPgui connection has the timeout setting, so we have to logon the SAPgui continually.
Now, I will introduce an easy setting to you for autologon.
1. run the command 'REGEDIT'
2. Find the key 'HKEY_CURRENT_USER\Software\SAP\SAPShortcut\Security'
3. change the value of the string 'EnablePassword' from 0 to 1.
4. start the SAPgui logon to create a shortcut for autologon.
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. 5/12/2007 SAP ALV的Header内容如何居中”SAP ALV的Header内容如何居中?
“如果会写HTML语句,就简单多了。请看下面例子。
REPORT zzzz_test_alv. "@ides 900
........
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING i_buffer_active = space i_callback_program = 'ZZZZ_TEST_ALV' i_callback_pf_status_set = l_c_manu i_callback_user_command = l_c_func * I_CALLBACK_TOP_OF_PAGE = 'ALV_TOP_OF_PAGE' i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE' it_fieldcat = l_itab_fcat is_layout = l_str_layout it_events = itab_event i_grid_settings = l_str_gridset TABLES t_outtab = itab_dis EXCEPTIONS program_error = 1 OTHERS = 2. FORM html_top_of_page
USING cl_dd TYPE REF TO cl_dd_document. DATA:
l_mp TYPE i, l_fp TYPE i, l_mbuff TYPE string, l_string(99). * You must using HTML to modify your header.
CONCATENATE '<CENTER><H1>My header test</H1 ></CENTER>' '<br>Created by: ' sy-uname '<br>Created date: ' sy-datum INTO l_mbuff. * CALL METHOD cl_dd->html_insert EXPORTING contents = l_mbuff CHANGING position = l_mp. ENDFORM. " html_top_of_page 5/1/2007 Introduction to SELECTION-SCREEN Function KeysSAP的选择屏幕的标准工具栏上系统预先定义了5个按钮,他们对应的功能码是FC01-FC05,默认是不激活的。用户可以使用SELECTION-SCREEN FUNCTION KEY i.来激活这5个按钮(这里的i必须是1-5),这五个按钮的文本放在SSCRFields的对应的Functxt_0i中。当用户按下按钮时,系统将触发AT SELECTION-SCREEN 事件,并将功能码放到sscrfields的ucomm字段中。 代码样例: TABLES sscrfields. "定义工作区 PARAMETERS: p_carrid TYPE s_carr_id, SELECTION-SCREEN: FUNCTION KEY 1, "激活按钮 INITIALIZATION. AT SELECTION-SCREEN. START-OF-SELECTION. 注意:在AT SELECTION-SCREEN事件执行后,系统将再次显示屏幕,只有当用选择Execute(F8),系统才会进行其他事件的执行。 CL_ABAP_CHAR_UTILITIES在编写SAP程序时,程序员经常需要将常字符串进行分割,在字符串中加入回车换行或TAB字符,在其他语言可以使用$13$10的ASCII码进行插入.而在abap里却出错,为了解决此问题,请使用sap的类CL_ABAP_CHAR_UTILITIES.
CL_ABAP_CHAR_UTILITIES中有字符常量:如:CR_LF,HORIZONTAL_TAB,NEWLINE等等. 下面给出字符串中加入回车换行的示例: DATA: crlf(2) TYPE c. DATA: l_html(4096) TYPE C. crlf = cl_ABAP_char_utilities=>cr_lf. Implement DropDownList on Selection Screen"Implement DropDownList on Selection Screen
REPORT ZMENG_SO_LIST.
TYPE-POOLS vrm.
DATA: l_name TYPE vrm_id,
itab_list TYPE vrm_values, str_value LIKE LINE OF itab_list. PARAMETERS: ps_parm(20) AS LISTBOX VISIBLE LENGTH 20. AT SELECTION-SCREEN OUTPUT.
l_name = 'PS_PARM'.
str_value-key = 'NO1'.
str_value-text = 'YULONG.CHEN'. APPEND str_value TO itab_list. str_value-key = 'NO2'.
str_value-text = 'XIAOHUA.SUN'. APPEND str_value TO itab_list. str_value-key = 'NO3'.
str_value-text = 'FANG.YU'. APPEND str_value TO itab_list. CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING id = l_name values = itab_list. START-OF-SELECTION. WRITE: / 'Parameter:', ps_parm. 2/8/2007 [ABAP] Add select-options screen to screen1
、定义select-options screen
TABLES: t001.
2、定义屏幕100
3、定义屏幕100
BPO
4 、定义屏幕100 PAI
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. 12/14/2006 [BC] To view the user listTCode - Description
----------------------------------
AL08 - Users Logged On
SM04 - User List
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. 12/12/2006 [ABAP] Finding the user-exits of a SAP transaction codeREPORT zmeng_exit NO STANDARD PAGE HEADING.
* * Finding the user-exits of a SAP transaction code * * Enter the transaction code in which you are looking for the user-exit * and it will list you the list of user-exits in the transaction code. * Also a drill down is possible which will help you to branch to SMOD. * * Written by : SAP Basis, ABAP Programming and Other IMG Stuff * http://www.sap-img.com * TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
TABLES : tstct. DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
DATA : field1(30). DATA : v_devclass LIKE tadir-devclass. PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.
IF sy-subrc EQ 0. SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = tstc-pgmna. MOVE : tadir-devclass TO v_devclass. IF sy-subrc NE 0. SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna. IF trdir-subc EQ 'F'. SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna. SELECT SINGLE * FROM enlfdir WHERE funcname = tfdir-funcname. SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR' AND object = 'FUGR' AND obj_name EQ enlfdir-area. MOVE : tadir-devclass TO v_devclass.
ENDIF. ENDIF. SELECT * FROM tadir INTO TABLE jtab WHERE pgmid = 'R3TR' AND object = 'SMOD' AND devclass = v_devclass. SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND tcode EQ p_tcode. FORMAT COLOR COL_POSITIVE INTENSIFIED OFF. WRITE:/(19) 'Transaction Code - ', 20(20) p_tcode, 45(50) tstct-ttext. SKIP. IF NOT jtab[] IS INITIAL. WRITE:/(95) sy-uline. FORMAT COLOR COL_HEADING INTENSIFIED ON. WRITE:/1 sy-vline, 2 'Exit Name', 21 sy-vline , 22 'Description', 95 sy-vline. WRITE:/(95) sy-uline. LOOP AT jtab. SELECT SINGLE * FROM modsapt WHERE sprsl = sy-langu AND name = jtab-obj_name. FORMAT COLOR COL_NORMAL INTENSIFIED OFF. WRITE:/1 sy-vline, 2 jtab-obj_name HOTSPOT ON, 21 sy-vline , 22 modsapt-modtext, 95 sy-vline. ENDLOOP. WRITE:/(95) sy-uline. DESCRIBE TABLE jtab. SKIP. FORMAT COLOR COL_TOTAL INTENSIFIED ON. WRITE:/ 'No of Exits:' , sy-tfill. ELSE. FORMAT COLOR COL_NEGATIVE INTENSIFIED ON. WRITE:/(95) 'No User Exit exists'. ENDIF. ELSE. FORMAT COLOR COL_NEGATIVE INTENSIFIED ON. WRITE:/(95) 'Transaction Code Does Not Exist'. ENDIF. AT LINE-SELECTION.
GET CURSOR FIELD field1. CHECK field1(4) EQ 'JTAB'. SET PARAMETER ID 'MON' FIELD sy-lisel+1(10). CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN. *---End of Program
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. 12/3/2006 [ZT] 如何进行各种码制数据之间转换1 系统内部转换命令(一般建议不直接使用) 2 使用SAP系统封装的类CL_ABAP_CONV_IN_CE and CL_ABAP_CONV_OUT_CE DATA: S TYPE STRING, ASSIGN STR TO <X> CASTING. CVTI_UTF8 = CL_ABAP_CONV_IN_CE=>CREATE( ENCODING = 'UTF-8' INPUT = <X> ). CALL METHOD CVTI_UTF8->READ STR = S. 3 使用sap封装的Form 4使用sap封装的函数(外部->系统默认代码,系统默认代码->外部) 5使用TRANSLATE命令 6 常见代码编号 Saved From : http://blog.csdn.net/CompassButton/archive/2006/11/28/1418479.aspx 12/1/2006 ABAP: Check the file extension in the selection screen.ABAP: Check the file extension in the selection screen.
REPORT zmeng_testi . DATA: file_filter TYPE string . PARAMETERS: p_file TYPE PCFILE-PATH LOWER CASE . INITIALIZATION. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file. * allow user to only select pdf file.CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = 'Select the File' * DEFAULT_EXTENSION = cl_gui_frontend_services=>FILETYPE_TEXT * DEFAULT_FILENAME = file_filter = file_filter * INITIAL_DIRECTORY = * MULTISELECTION = CHANGING file_table = wf_filetab rc = wf_filerc * USER_ACTION = * EXCEPTIONS * file_open_dialog_failed = 1 * cntl_error = 2 * error_no_gui = 3 * not_supported_by_gui = 4 * OTHERS = 5 . READ TABLE wf_filetab INTO p_file INDEX 1. START-OF-SELECTION. * ABAP: Check the file extension in the selection screen. CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME' write: / 'File name = ', p_file, This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. 11/7/2006 正确地使用SAP的标准对话框函数[转]在用户设计sap的程序时,经常需要一些对话框,用户可以自己编写,但使用SAP系统中提供了的对话框函数将减少许多开发工作。 1、sap的函数组列表和用途说明
2、函数列表和说明
2.2、Function group SPO2
The action, the diagnosis text, the question and the alternative actions are passed as parameters. The user action (Alternative 1, Alternative 2, or Cancel) is returned in a parameter. 2.3、Function group SPO4
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text, if the key word from the Dictionary is not to be displayed as field text in the dialog box, in the structure. The standard help functionality (F1, F4) is supported.
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text in the structure, if the key word from the Dictionary is not to be displayed as field text in the dialog box. A comparison operator for checking the input data in the database is passed. You can specify whether the check is for the existence or absence of an object. A foreign key relationship check is supported. The standard help functionality (F1, F4) is supported. The user action is returned in a parameter.
The Data input by the user in the dialog box are passed to the sub-routine specified in the interface for checking. Errors found by the check are entered in an error structure and are evaluated on return from the sub-routine by the function module. The standard help functionality (F1, F4) is supported. The user action (Continue or Cancel) is returned in a parameter.
The input fields are passed in a structure and must be defined in the Dictionary. You can also specify individual field display attributes and a field text in the structure, if the key word from the Dictionary is not to be displayed as field text in the dialog box. You can pass the data which are entered by the user in a dialog box to a sub-routine which must be specified in the interface for checking. Errors occurring in the check are stored in an error structure and are analyzed by the function module upon return from the sub-routine. The data, and an error message, if appropriate, are displayed again. The standard help functionality (F1, F4) is supported. User exits for a user F1 or F4 help can also be specified. The user action (Continue or Cancel) is returned in a parameter.
2.4、Function group SPO6
With this function module you display a text which exists in the system in a dialog box.
With this function module you display a text which exists in the system with parameters in a dialog box. The parameter values are passed in a table. The use of numbered texts is recommended, to make the parameter values translatable. The parameter names must be passed in upper-case letters. 2.5、Function group SPO5
从列表中选择数据,样例程序 report rsspo500. if antwort ne 'A'. * 2. Aufruf ********************************************************** call function 'POPUP_TO_DECIDE_LIST' endif. Posted from:http://blog.csdn.net/CompassButton/archive/2006/09/29/1306632.aspx 如何访问SAP的Domain的Value Range[转]访问Domain的Value Range有两种方法: 1、直接访问表 2、使用SAP的标准函数 Posted from:http://blog.csdn.net/CompassButton/archive/2006/10/11/1330477.aspx 10/7/2006 [ABAP] Make use of SELECT-OPTIONS easier on the selection screenREPORT zmeng_testc .
TABLES: bseg.
* データ型プール SSCR のインクルード TYPE-POOLS sscr.
* パラメータ RESTRICTION に渡すオブジェクトの定義 DATA itab_restrict TYPE sscr_restrict.
* RESTRICT に入力するための補足オブジェクト DATA str_opt_list TYPE sscr_opt_list. DATA str_ass TYPE sscr_ass.
SELECT-OPTIONS: so_werks FOR bseg-werks NO-EXTENSION NO INTERVALS.
INITIALIZATION.
* JUST_EQ: EQ のみ使用可 CLEAR str_opt_list. MOVE 'JUST_EQ' TO str_opt_list-name. MOVE 'X' TO str_opt_list-options-eq. APPEND str_opt_list TO itab_restrict-opt_list_tab.
* 対象項目 CLEAR str_ass. MOVE: 'S' TO str_ass-kind, 'SO_WERKS' TO str_ass-name, 'I' TO str_ass-sg_main, 'N' TO str_ass-sg_addy, 'JUST_EQ' TO str_ass-op_main. APPEND str_ass TO itab_restrict-ass_tab.
* 汎用モジュール呼出 CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' EXPORTING restriction = itab_restrict EXCEPTIONS too_late = 1 repeated = 2 not_during_submit = 3 db_call_after_report_call = 4 selopt_without_options = 5 selopt_without_signs = 6 invalid_sign = 7 report_call_after_db_error = 8 empty_option_list = 9 invalid_kind = 10 repeated_kind_a = 11 OTHERS = 12.
START-OF-SELECTION. PERFORM output_data.
*&---------------------------------------------------------------------* *& Form output_data *&---------------------------------------------------------------------* FORM output_data. LOOP AT so_werks. WRITE: / so_werks-option, so_werks-sign , so_werks-low , so_werks-high . ENDLOOP. ENDFORM. " output_data |
|
|