abap

通过一个简单的ABAP报表窥探ABAP内存分配和管理机制

感情迁移 提交于 2020-01-25 07:56:03
REPORT zhelloworld. PARAMETERS: clear TYPE c as CHECKBOX DEFAULT abap_false. TYPES: tt_table TYPE TABLE OF tadir WITH KEY pgmid object. DATA: lt_result TYPE TABLE OF tadir, lt_total TYPE TABLE OF tadir, lr_result TYPE REF TO tt_table. DATA: c1 TYPE cursor. OPEN CURSOR @c1 FOR SELECT * FROM tadir. DO. WRITE: / |Round: { sy-index } | COLOR COL_NEGATIVE. CREATE DATA lr_result. FETCH NEXT CURSOR @c1 INTO TABLE @lr_result->* PACKAGE SIZE 800000. IF sy-subrc <> 0. EXIT. ENDIF. APPEND LINES OF lr_result->* TO lt_total. cl_abap_memory_utilities=>get_memory_size_of_object( EXPORTING object = lt_total

Writing JSON serializer

蹲街弑〆低调 提交于 2020-01-24 19:47:10
问题 If I want to develop a serializer for a language for which one doesnt exist already (e.g. ABAP), what could be the efforts involved in it? Does it involve merely writing "text equivalent" of ABAP serialzer - how would I tackle complex objects. What would be the best starting point for this? 回答1: Update: Starting with Releases 7.02 and 7.03/7.31 (kernel patch 116), JSON is supported natively in ABAP - check this blog by Horst Keller. You should search for ABAP and JSON using site:sap.com first

MD5 hash of a file in ABAP

不羁的心 提交于 2020-01-24 05:19:26
问题 I want to generate a MD5 hash of a text file in ABAP. I have not found any standard solution for generating it for a very big file. Function module CALCULATE_HASH_FOR_CHAR does not meet my requirements because it takes a string as an input parameter. Although it works for smaller files, in case of a for example 4 GB file one cannot construct such a big string. Does anybody know whether there is a standard piece of coding for doing that (my google efforts did not bring me anything) or maybe

How to use REUSE_ALV_FIELDCATALOG_MERGE function module?

喜你入骨 提交于 2020-01-23 12:26:27
问题 I'm trying to use the function module REUSE_ALV_FIELDCATALOG_MERGE to pass the field label in ddic to display in the column header of the alv report. But, that didn't work. If I comment the I_STRUCTURE_NAME = 'TY_YNAH_CUS_OBJ_REQ' line, it give me runtime error state The ABAP program lines are wider than the internal table. But if I uncomment it ,the program still did not work REPORT YALV_TEST. tables sscrfields. type-pools : slis. "CREATE STRUCTURE -1 TYPES: BEGIN OF TY_YNAH_CUS_OBJ_REQ,

How to use REUSE_ALV_FIELDCATALOG_MERGE function module?

妖精的绣舞 提交于 2020-01-23 12:26:10
问题 I'm trying to use the function module REUSE_ALV_FIELDCATALOG_MERGE to pass the field label in ddic to display in the column header of the alv report. But, that didn't work. If I comment the I_STRUCTURE_NAME = 'TY_YNAH_CUS_OBJ_REQ' line, it give me runtime error state The ABAP program lines are wider than the internal table. But if I uncomment it ,the program still did not work REPORT YALV_TEST. tables sscrfields. type-pools : slis. "CREATE STRUCTURE -1 TYPES: BEGIN OF TY_YNAH_CUS_OBJ_REQ,

如何用ABAP代码生成新的function module

删除回忆录丶 提交于 2020-01-23 02:27:28
REPORT zcreate_fm. DATA: date TYPE sy-datum, time TYPE sy-uzeit, pool_name TYPE rs38l-area, func_name TYPE rs38l-name, lt_codeline TYPE STANDARD TABLE OF char255, l_function_include TYPE progname. DATA it_exception_list TYPE TABLE OF rsexc. DATA it_export_parameter TYPE TABLE OF rsexp. DATA it_import_parameter TYPE TABLE OF rsimp. DATA wa_rsimp TYPE rsimp. DATA it_tables_parameter TYPE TABLE OF rstbl. DATA it_changing_parameter TYPE TABLE OF rscha. DATA wa_rscha TYPE rscha. DATA it_parameter_docu TYPE TABLE OF rsfdo. date = sy-datum. time = sy-uzeit. CONCATENATE 'ZTEST_FBS_' date time INTO

ABAP Short Dump on append of a sorted table

£可爱£侵袭症+ 提交于 2020-01-22 17:40:44
问题 Why does my ABAP program short dump when I append a line to a sorted table? ST22 Shows ITAB_ILLEGAL_SORT_ORDER data: sorted_tab type sorted table of ty_tab with non-unique key key, line type ty_tab. line-key = 1. append line to sorted_tab. "works fine" line-key = 2. append line to sorted_tab. "works fine" line-key = 1. append line to sorted_tab. "<==== Short dump here" 回答1: The program short dumps when appending a sorted table in the wrong sort order data: sorted_tab type sorted table of ty

ABAP Short Dump on append of a sorted table

别说谁变了你拦得住时间么 提交于 2020-01-22 17:40:00
问题 Why does my ABAP program short dump when I append a line to a sorted table? ST22 Shows ITAB_ILLEGAL_SORT_ORDER data: sorted_tab type sorted table of ty_tab with non-unique key key, line type ty_tab. line-key = 1. append line to sorted_tab. "works fine" line-key = 2. append line to sorted_tab. "works fine" line-key = 1. append line to sorted_tab. "<==== Short dump here" 回答1: The program short dumps when appending a sorted table in the wrong sort order data: sorted_tab type sorted table of ty

ABAP 中长文本处理

浪子不回头ぞ 提交于 2020-01-22 02:51:18
相关类 CL_GUI_TEXTEDIT 主要方法 CL_GUI_TEXTEDIT->GET_TEXT_AS_R3TABLE CL_GUI_TEXTEDIT->SET_TEXT_AS_R3TABLE 此类的构造方法和CL_GUI_ALV_GRID 一样也需要放置一个容器 DATA GO_PARENT TYPE REF TO CL_GUI_CUSTOM_CONTAINER . DATA GO_TEXTEDIT TYPE REF TO CL_GUI_TEXTEDIT . CONSTANTS: C_LINE_LENGTH TYPE I VALUE 256 . TYPES: BEGIN OF GTY_TEXT, LINE(C_LINE_LENGTH) TYPE C, END OF GTY_TEXT. DATA GT_TEXT_SAVE TYPE STANDARD TABLE OF GTY_TEXT . "定义内表对长文本保存 CREAT OBJECT GO_PARENT EXPORTING CONTAINER_NAME = 'CON2' . CREATE OBJECT GO_TEXTEDIT EXPORTING WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION WORDWRAP_TO_LINEBREAK_MODE = CL

sap abap alv report fill gap between documents

元气小坏坏 提交于 2020-01-22 02:36:11
问题 I was trying to challenge myself to make an ALV report that displays all the data by company code. but some document number has a gap. I want to fill the gap between missing number For example: last index value: 20012 then next value is: 20014 How do I able to insert 20013 in the grid if the report is using all the data that exist in internal tables? Thanks. 回答1: This is just blind text typing, but I hope you are able to understand it ... should be quite simple. Dont expect complete code,