Requirements: Parse the following three strings connected by "/" respectively.
The traditional practice is shown in the function module SKWF_UTIL_IO_FIND_BY_KEY in line 98 of the following figure:
The role of this function module is to parse document type: L, document class: CRM_L_ORD and document guid separated by two /.
This function module adopts the traditional method, splitting and storing the three keys into an internal standard, and then extracting each key by READ TABLE INDEX 1, 2, and 3 respectively. 42 lines of code were used.
If you use regular expressions, you only need 1 line of code:
And the latter is 3~6 times faster than the former: because FIND REGEX is implemented in C++ in the ABAP Kernel, it is more efficient than doing it on the ABAP side. Refer to the following performance test comparison results (unit: microseconds).
To get more original technical articles from Jerry, please follow the public account "Wang Zixi" or scan the QR code below: