A simple tool to calculate the total size of a BSP application
to The of application size Simple TOOL BSP
2023-09-14 09:02:50 时间
Today Ben asks me whether there is some tool which can allow us to get a draft estimation on the size of a BSP application. As far as I know there is no such tool, so I write one by myself:
You can simply create a report and paste the source code from this blog, execute it by specifying the BSP application name:
According to ABAP help, in Unicode system 1 char occupies 2 bytes:
So in the example below the BSP application CRM_OPPRTNTY occupies at least 2011344 * 2 = 4022688 bytes.
Source code of report:
REPORT zbsp.
*&---------------------------------------------------------------------*
*& Report ZCONTEXT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
PARAMETERS: bspname TYPE o2pagdir-applname OBLIGATORY DEFAULT 'CRM_OPPRTNTY'.
TYPES:
BEGIN OF ty_view_source,
applname TYPE o2pagdir-applname,
pagekey TYPE o2pagdir-pagekey,
source TYPE o2pageline_table,
END OF ty_view_source .
TYPES:
tt_view_source TYPE STANDARD TABLE OF ty_view_source WITH KEY
applname pagekey .
DATA: ls_pagecon_key TYPE o2pconkey,
lt_view_source TYPE tt_view_source,
lv_total TYPE i VALUE 0,
lv_each TYPE i.
FIELD-SYMBOLS: <line> LIKE LINE OF lt_view_source.
START-OF-SELECTION.
PERFORM main.
*&---------------------------------------------------------------------*
*& Form MAIN
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM main.
SELECT applname pagekey FROM o2pagdir INTO CORRESPONDING FIELDS OF TABLE
lt_view_source WHERE applname = bspname.
ls_pagecon_key-objtype = 'PD'.
ls_pagecon_key-version = 'A'.
LOOP AT lt_view_source ASSIGNING <line>.
ls_pagecon_key-applname = <line>-applname.
ls_pagecon_key-pagekey = <line>-pagekey.
IMPORT content TO <line>-source
FROM DATABASE o2pagcon(tr) ID ls_pagecon_key
ACCEPTING PADDING IGNORING CONVERSION ERRORS.
PERFORM get_char_number USING <line>-source CHANGING lv_each.
lv_total = lv_total + lv_each.
WRITE: / <line>-pagekey COLOR COL_NEGATIVE, lv_each COLOR COL_KEY.
ENDLOOP.
WRITE: / 'total number of characters: ' COLOR COL_NEGATIVE , lv_total COLOR COL_GROUP.
ENDFORM. "MAIN
*&---------------------------------------------------------------------*
*& Form GET_CHAR_NUMBER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->IT_SOURCE text
* <--CV_SIZE text
*----------------------------------------------------------------------*
FORM get_char_number USING it_source TYPE o2pageline_table CHANGING cv_size TYPE i.
CLEAR: cv_size.
FIELD-SYMBOLS: <source> LIKE LINE OF it_source.
LOOP AT it_source ASSIGNING <source>.
cv_size = cv_size + strlen( <source> ).
ENDLOOP.
ENDFORM. "GET_CHAR_NUMBER
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- 记录一次在生成数据库服务器上出现The timeout period elapsed prior to completion of the operation or the server is not responding.和Exception has been thrown by the target of an invocation的解决办法
- Fielddata is disabled on text fields by default. Set fielddata=true on [gender] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memor
- How to Create Mixed Reality Videos for the Vive - with Two Controllers
- [Typescript] Tips: Use 'extends' keyword to narrow the value of a generic
- [Functional Programming] Use the Callback and Closure Pattern to Build Advanced Async Behaviors [Full code]
- [Grid Layout] Use auto-fill and auto-fit if the number of repeated grid tracks is not to be def
- [!Typescript] Tips: dynamic specify the type of arguments to function
- Unable to read the project file 'client.csproj'. Could not load file or assembly 'Microsoft.Build.En
- How to change the background color of button in Footer area
- How to analyze the dump MESSAGE_TYPE_X when modifying an attachment
- A simple tool to calculate the total size of a BSP application
- CM: How to get the complete url of a product attachment
- VM启动报错Cannot open the disk,Failed to lock the file
- 成功解决To fix this you could try to: 1. loosen the range of package versions you‘ve specified
- 成功解决h5py_init_.py:26:FutureWarning: Conversion of the second argument of issubdtype from `float` to
- 已解决pyautogui.FailSafeException: PyAutoGUI fail-safe triggered from mouse moving to a corner of the s
- 已解决EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
- 【错误记录】编译 Linux 内核报错 ( Unable to find the ncurses package. )
- DT: An R interface to the DataTables library datatable 数据清洗
- strip: Unable to recognise the format of the input file
- SQL报错——check the manual that corresponds to your MySQL server version for the right syntax to use
- AS编译的报错提示:Failed to query the value of property ‘namespace‘
- Android Stdudio 打包Apk签名时出现状态窗口报错提示:Please select at least one of the signature versions to use
- C++堆内存错误:CRT detected that the application wrote to memory after end of heap buffer