abap

abap string 类型 转rawstring (Xstring)

一个人想着一个人 提交于 2019-12-04 20:03:39
1. SCMS_STRING_TO_XSTRING /*--> */ /*--> */ CALL FUNCTION 'SCMS_STRING_TO_XSTRING' EXPORTING text = lv_string * MIMETYPE = ' ' * ENCODING = IMPORTING buffer = lv_xstring EXCEPTIONS failed = 1 OTHERS = 2 . IF sy -subrc <> 0 . * Implement suitable error handling here ENDIF . 2 .cl_abap_codepage =>convert_to() /*--> */ /*--> */ lv_xstring = cl_abap_codepage =>convert_to ( lv_string ) . 3.SE24 : CL_BCS_CONVERT. 来源: https://www.cnblogs.com/WACBZWY/p/11880811.html

ABAP - AT END OF 的使用

笑着哭i 提交于 2019-12-04 19:59:11
TYPES: begin of ty_tab , num(3) type i, str(3) type c, end of ty_tab. data: gw_tab TYPE ty_tab , gt_tab TYPE TABLE OF ty_tab WITH HEADER LINE. data: gt_out TYPE TABLE OF ty_tab, gw_out TYPE ty_tab. gw_tab-num = 100. gw_tab-str = 'AAA'. append gw_tab to gt_tab. gw_tab-num = 100. gw_tab-str = 'BBB'. append gw_tab to gt_tab. gw_tab-num = 200. gw_tab-str = 'AAA'. append gw_tab to gt_tab. gw_tab-num = 200. gw_tab-str = 'BBB'. append gw_tab to gt_tab. gw_tab-num = 200. gw_tab-str = 'CCC'. append gw_tab to gt_tab. CLEAR gw_tab. sort gt_tab by num. loop at gt_tab . MOVE gt_tab to gw_tab."这个转移很重要 at

ABAP学习(11):ALV显示之OO ALV使用示例

北战南征 提交于 2019-12-04 15:06:55
2、OO ALV OOALV主要通过CL_GUI_ALV_GRID这个类来控制alv的显示。 ALV显示需要屏幕容器,容器对应类: 1、cl_gui_custom_container,默认容器alv自动占满整个容器; 2、cl_gui_docking_container,docking容器alv宽度可以直接调整; 3、cl_gui_splitter_contianer,splitter容器,可以将屏幕划分区域显示多个alv; 2.1、cl_gui_custom_container容器 示例1:OO ALV使用cl_gui_custom_container容器 TABLES:spfli. CLASS cl_event_handle DEFINITION."事件处理类定义 PUBLIC SECTION. "初始化ALV工具栏对象事件,如增加按钮并设定属性 METHODS handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object e_interactive. "该事件用于在下ALV工具栏的下拉菜单按钮中增加选项 METHODS handle_menu_button FOR EVENT menu_button OF cl_gui_alv_grid IMPORTING e_object e_ucomm.

ABAP学习(10):ALV显示之function alv

浪尽此生 提交于 2019-12-04 15:06:17
ABAP的ALV 1、Function ALV 调用function,传入要显示的内表,显示样式等参数,显示alv。 可以调用REUSE_ALV_GRID_DISPLAY这个function,也可以调用REUSE_ALV_GRID_DISPLAY_LVC这个function,输入的参数一致,但是一些细节传入参数类型不同。 REUSE_ALV_GRID_DISPLAY调用示例: "调用function,显示alv CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' * EXPORTING * I_INTERFACE_CHECK = ' ' * I_BYPASSING_BUFFER = ' ' * I_BUFFER_ACTIVE = ' ' * I_CALLBACK_PROGRAM = ' ' * I_CALLBACK_PF_STATUS_SET = ' ' * I_CALLBACK_USER_COMMAND = ' ' * I_CALLBACK_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_TOP_OF_PAGE = ' ' * I_CALLBACK_HTML_END_OF_LIST = ' ' * I_STRUCTURE_NAME = * I_BACKGROUND_ID = ' ' * I_GRID_TITLE = * I

【転載】LOOP - WITH CONTROL

喜夏-厌秋 提交于 2019-12-04 10:58:32
本文的原文章:https://www.cnblogs.com/clsoho/archive/2010/01/22/1654379.html LOOP - WITH CONTROL Syntax 语法 LOOP [AT itab INTO wa [CURSOR top_line] [FROM n1] [TO n2]] WITH CONTROL contrl. ... ENDLOOP. Variants: 变式 1. LOOP WITH CONTROL contrl. 2. LOOP AT itab CURSOR cur INTO wa [CURSOR top_line] [FROM n1] [TO n2] WITH CONTROL contrl. Effect 作用 Definition of a loop in the dynpro flow logic, which is linked to a table control contrl . The loop sequentially processes the presented rows of table control contrl by executing one loop pass per table control row. For contrl , you must directly specify the name

Abap Null issue in the code

大兔子大兔子 提交于 2019-12-04 06:58:30
问题 I was trying run this program copied from a tutorial. But I am getting Null exception I this line CALL METHOD list->SET_TABLE_FOR_FIRST_DISPLAY. form My understanding the list object should be created in the class-constructor. Method CLASS_CONTRUCTOR. CREATE OBJECT list EXPORTING i_parent = cl_gui_container=>screen0. ENDMETHOD. //code please have a look. class select_display_sflight DEFINITION. public section. CLASS-METHODS class_contructor. Methods: constructor importing i_carrid type

Merging cells and cell formatting in ALV

蓝咒 提交于 2019-12-04 05:27:39
问题 We are trying to manipulate the alv grid class to get result like in Sap Agenda (SSC1 tcode) i.e. to merge columns and rows. We found that the class cl_calendar_control_schedule with the method display handles that and we are working to understand the content of this method and its parameters. We found that the internat table of lvc_t_data type handles horizontal and/or vertical merging of cells (one row of this Internal table for each cell), but I struggle to understand how to code cell

Different ways to call methods in ABAP

我的未来我决定 提交于 2019-12-04 04:14:23
Sorry for this basic ABAP question. What are the different ways to call methods in ABAP? And what are their "official" names? I've heard of perform, method call, and internal/inline method call. Perform uses the PERFORM keyword and method call the CALL METHOD syntax, I guess. But what is an "internal" or "inline method call"? Jagger These are the possibilities of an inline method call. If you are calling so called functional method which has only IMPORTING parameters and optionally one RETURN parameter you can call it like this. CLASS lcl_test DEFINITION. PUBLIC SECTION. CLASS-METHODS: func

Parsing json into data structures with lower case field names

我们两清 提交于 2019-12-04 03:43:29
问题 I am parsing JSON into ABAP structures, and it works: DATA cl_oops TYPE REF TO cx_dynamic_check. DATA(text) = `{"TEXT":"Hello ABAP, I'm JSON!","CODE":"123"}`. TYPES: BEGIN OF ty_structure, text TYPE string, code TYPE char3, END OF ty_structure. DATA : wa_structure TYPE ty_structure. TRY. text = |\{"DATA":{ text }\}|. CALL TRANSFORMATION id OPTIONS clear = 'all' SOURCE XML text RESULT data = wa_structure. WRITE: wa_structure-text , wa_structure-code. CATCH cx_transformation_error INTO cl_oops.

ALV Grid missing toolbar

对着背影说爱祢 提交于 2019-12-04 03:31:53
问题 I'm creating a simple ALV grid in SAP. So far i've been able to populate the grid with my data and display the grid after the selection screen no problem. I'm not adding the grid to a custom container on a custom screen. Just viewing the grid full screen. My question is - is there a property of the alv grid object that I need to set in order to view the tool bar that is normally on top of the grid with buttons for filter, sort etc? So far this is what I have: TRY. cl_salv_table=>factory(