Transport standard text to a transportable request
Program: RSTXTRAN[@more@]
Table control wizard mutiply lines selection
PROCESS AFTER INPUT.*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'PROD_LIST' LOOP AT GT_DATA. CHAIN. FIELD GT_DATA-AUFNR. FIELD GT_DATA-VORNR. FIELD GT_DATA-MGVRG. FIELD GT_DATA-LMNGA. FIELD GT_DATA-XMNGA. FIELD GT_DATA-CON_LMNGA. FIELD GT_DATA-CON_XMNGA. endchain. MODULE CHECK_TABLE. ENDLOOP. MODULE CHECK_TABLE. IF GT_DATA-SEL = 'X'. " GT_DATA-SEL TYPE C (此域应当添到PROD_LIST属性中 不会修改表GT_DATA,但是会修改同名STRUCTURE) APPEND g
PDF form tips
1. import logo which you could find via SE78:import the logo into MIME Repository (Program RSXFT_MIGRATE_BDS_GRAPHICS).how to find MIME type: sap->BC->fp->graphics->PUBLIC->GRAPHICSCreate GRAPHICS in SFP CONTEXT -> graphics content -> specify name(xstring) and MIME type (string)that should store in variable.Drag the graphics in LAYOUT2. Not display the caption of a text field when the value is initialJavascript :if ( this.rawValue == null ){ this.presence = "hidden&quo
Passing parameters
What are the dieffrent ways to pass data from the main ABAP program (actual parameters) to a subroutine or FORM statement(formal parameters) ? A: Data is passed from a main program to a subroutine using parameters. The data in the main program would be referred to as the actual parameters. The data in the subroutine (FORM statement) would be known as the formal parameters. There are three different ways to pass parameters to subroutines:Pass by reference - parameters are listed after the 'USING
Page numbering issue in Smartforms
Dear, To whom it concerns .... Problem : Sometimes page numbers are outputted incorrectly on the layout of the printout. As long as the page count is less or equal to 9, pages are shown correctly. When more than 9 pages, output is wrong.Smartform code : &SFSY-PAGE&/&SFSY-FORMPAGES&. Example : Page numbering shown as : 1/, 2/, ... 10/11, 11/11 (as of 10 it's correct) Solution :In the smartform : - The WINDOW definition where you use the coding : set window type
获得登录用户EMAIL
* --- get email address of the person who create the orderDATA: ls_address_printer TYPE crms_email_partner_address.DATA: ls_address TYPE crms_email_recipient.CALL METHOD cl_crm_email_utility_base=>get_user_addressEXPORTINGiv_user = zvbdka-ernamIMPORTINGes_partner_address = ls_address_printeres_address = ls_address.[@more@]
ABAP的事件
ABAP的事件 EVENTS IN ABAPThere will be different types of events in ABAP.Events in Dialog ProgramPBO - Process Before OutputPAI - Process After InputPOH - Process on HelpPOV - Process on Value Request.Events in Classical ReportINITIALIZATIONAT SELECTION-SCREEN OUTPUTAT SELECTION-SCREENSTART-OF–SELECTION.TOP OF PAGEEND OF PAGEEND-OF-SELECTION.Control Break events related to Internal TablesAT NEW FIELDAT END OF FIELDAT FIRSTAT LASTEvents in Interactive Report AT USER-COMMAND.AT LINE-SELECTIONAT P
User Exits For Billing
User Exits For BillingUSEREXIT_NUMBER_RANGE (Module pool SAPLV60A, program RV60AFZZ) The internal number range used in the standard system is specified in the billing type table and can be changed in this user exit. This user exit is only called when the billing documents is created.USEREXIT_ACCOUNT_PREP_KOMKCV (Module pool SAPLV60A, program RV60AFZZ) In this user exit additional fields for account determination that are not provided in the standard system are copied into communication structure
格式化的数值转为非格式化数值 --- 转自老白的博客
如: 123,456.78 -> 123456.78 REPORT z_barry_test NO STANDARD PAGE HEADING . TABLES usr01.DATA: pp TYPE p DECIMALS 2 . "注意这个地方的定义 SELECT SINGLE * FROM usr01 WHERE bname = sy-uname.CALL FUNCTION 'UNITS_STRING_CONVERT' EXPORTING units_string = '12,345.7' dcpfm = usr01-dcpfm IMPORTING units = pp EXCEPTIONS invalid_type = 1 OTHERS = 2. WRITE pp. [@more@]
在自定义Screen上利用标准选择屏幕的两个方法 --- 转自老白的博客
有时候为了方便,会把标准选择屏幕(1000)那一套东西拿到自己定义的屏幕上使用。有两个方法可以实现。1、Subscreen,直接嵌入到自定义的Screen上,需要在Screen上画一个子屏幕的区域2、弹出一个窗口,不用对自定义屏幕做更改 REPORT z_barry_test NO STANDARD PAGE HEADING. TABLES ekko.DATA: ok_code LIKE sy-ucomm. SELECTION-SCREEN BEGIN OF SCREEN 111 AS SUBSCREEN.SELECT-OPTIONS: p_ebeln FOR ekko-ebeln .SELECTION-SCREEN END OF SCREEN 111. SELECTION-SCREEN BEGIN OF SCREEN 222 AS WINDOW .SELECT-OPTIONS: p_aedat FOR e
SD相关表 --- 转自老白的博客
一、客户主数据基本数据放在KNA1里;公司代码放在KNB1里;销售视图放在KNVV里;合作伙伴放在KNVP里;二、信用主数据KNKK里有信贷限额、应收总额、特别往来;S066里是未清订单值;S067里是未清交货值;KNKK里面的应收值不一定对,要和BSID表去比。S066、S067也是一样,不对的时候就要重组。三、物料主数据MARA里是基本数据;MAKT是文本;MARC是工厂视图;MVKE是销售视图;MARM是物料的计量单位;四、价格数据主数据在表AXXX里,XXX表示三个数字,KNOH和KONP分别存放抬头和行项;单据的价格在KONV里;五、自动确定的科目在CXXX里,XXX表示三
弹出SE61所写文本的的文本框 --- 转自老白的博客Barry.bai
REPORT ztest.INCLUDE .BREAK-POINT.DATA: user_buttons LIKE smp_dyntxt OCCURS 0 WITH HEADER LINE,parameter LIKE spar OCCURS 0 WITH HEADER LINE,antwort LIKE rsnewleng-fcode.START-OF-SELECTION.CLEAR user_buttons.user_buttons-text = '关闭'.user_buttons-icon_id = icon_close.user_buttons-icon_text = '退出'.user_buttons-quickinfo = '结尾'.APPEND user_buttons.CALL FUNCTION 'POPUP_DISPLAY_TEXT_USER_BUTTON'EXPORTINGlanguage = sy-langupopup_title = '测试'start_column = 5start_row = 5text_object = 'COM_ATTR_
ABAP中正则表达式的简单使用 --- 转自老白的博客 Barry.bai
在一个论坛上面看到有人在问正则表达式的问题,特举例简单说明一下。另外,REPLACE也支持REGEX关键字。最后:只能是ECC6或者更高版本才可以(ABAP supports POSIX regular expressions as of Release 7.00)REPORT z_test.DATA: str TYPE string ,result_tab TYPE match_result_tab ,wa LIKE LINE OF result_tab.*找出STRING里面的双字节字符str = 'abc我啊adfsf们'.FIND ALL OCCURRENCES OF REGEX '[^x00-xff]*' IN str RESULTS result_tab.LOOP AT result_tab INTO wa.WRITE / str+wa-offset(wa-length).ENDLOOP.*找出STRING里面的单字节字
下载内表到本地.CSV文件中
form down_load tables gt_down." TYPE gt_data.data: filename type string value '',path type string value '',fullpath type string value ''.call method cl_gui_frontend_services=>file_save_dialogexportingdefault_extension = 'CSV'file_filter = '*.CSV'initial_directory = 'D:'changingfilename = filenamepath = pathfullpath = fullpathexceptionscntl_error = 1error_no_gui = 2not_supported_by_gui = 3others = 4.loop at gt_down into wa_down.if not wa_down-runit is initial.call function 'CONVERSION_EXI
获得登录用户的Email地址
* --- get email address of the person who create the orderDATA: ls_address_printer TYPE crms_email_partner_address.DATA: ls_address TYPE crms_email_recipient.CALL METHOD cl_crm_email_utility_base=>get_user_address EXPORTING iv_user = zvbdka-ernam IMPORTING es_partner_address = ls_address_printer es_address = ls_address.[@more@]
调用SO10填充选择屏
* 本段代码调用SO10, 使用户可以在选择屏中选择文本, 并同时填充TEXT ID.TABLES: pstxt.** call trx so10 (rstxtcat is the program of so10)PARAMETERS: p_head TYPE tdobname.PARAMETERS: p_txtid TYPE tdid.DATA: it_value TYPE TABLE OF dynpread WITH HEADER LINE.AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_head. SET PARAMETER ID 'TXT' FIELD p_head. SUBMIT rstxtcat AND RETURN. GET PARAMETER ID 'TXT' FIELD pstxt. p_head = pstxt-tdname. CLEAR it_value. it_value-fieldname = 'P_TXTID'. it_value-fieldvalue =
上传本地.CSV文件到内表中
TYPE-POOLS: truxs.DATA: filename TYPE string VALUE '',path TYPE string VALUE '',fullpath TYPE string VALUE ''.DATA: l_rc TYPE i,l_filetable TYPE filetable.DATA w_ans .DATA gt_line TYPE truxs_t_text_data.DATA: gt_data LIKE STANDARD TABLE OF zobj_personeel WITH HEADER LINE.PARAMETERS p_file TYPE string.AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.* Open The txt FileCALL METHOD cl_gui_frontend_services=>file_open_dialogEXPORTINGwindow_title = 'please choose import file'file_filter = 'Notpad(*
List box at selection screen
type-pools: vrm.data: it_list type vrm_values,list_value type vrm_value.* --- selection screenparameters: p_period(2) type c as listbox visible length 15 obligatory. " Perioddata: p_num type i value '1',p_len type i,p_temp(2) type c.at selection-screen output.clear it_list.refresh it_list.data p_num type i value '1'.do 16 times.clear: p_len,p_temp.clear list_value.p_temp = p_num.p_len = strlen( p_temp ).if p_len = '1'.concatenate '0' p_temp into p_temp.endif.condense p_temp.list_value-key =