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
Get the characteristics of a certain class for a certain material
CLAF_CLASSIFICATION_OF_OBJECTS[@more@]
获得登录用户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@]
通过日期返回周信息
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE' . 返回信息:1. 当前是本年第几周2. 获得当前日期周 周一 周日的日期[@more@]
检查LOGO是否存在
If you need to include a (lot of) graphic(s) on a layout, you need to check first if the object exists or this will cause errors when the output is triggered.?To do this : (example from smartforms)?- Define a variable 'GV_GRAPHICS_EXIST' in the global variables- Add the following code to your smartform data: ls_stxbitmaps like stxbitmaps.select single * from stxbitmaps into ls_stxbitmaps where tdobject = 'GRAPHICS'
FM 获得外部单位
data lv_output type string.call function 'CONVERSION_EXIT_RUNIT_OUTPUT' exporting input = caufvd_tab-gmein " 单位 language = sy-langu importing output = lv_output[@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里面的单字节字
对ALV的自动刷新
* ------- 对ALV LIST的刷新:MODULE user_command_1100 INPUT.DATA save_ok LIKE sy-ucomm.save_ok = ok_code.CLEAR ok_code.CASE save_ok.WHEN 'BACK'.CLEAR gs_data.PERFORM update_internal_table.SET SCREEN 0.LEAVE SCREEN.FORM update_internal_table.DATA: gd_repid LIKE sy-repid, "Existsref_grid TYPE REF TO cl_gui_alv_grid.IF ref_grid IS INITIAL.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = ref_grid.ENDIF.IF NOT ref_grid IS INITIAL.CALL METHOD ref_grid->check_changed_data .ENDIF.END
下载内表到本地.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@]