Skip to content

Instantly share code, notes, and snippets.

@sandraros
sandraros / mass_reading_stxl.abap
Last active August 11, 2025 09:24
Bulk reading long texts in SAP R/3 & S/4 (tables STXH and STXL) with very good performance
* Improvement of code at https://blogs.sap.com/2014/02/25/alternative-to-readtext-function-module/comment-page-1/#comment-4121
* including Kenneth proposal at https://blogs.sap.com/2014/02/25/alternative-to-readtext-function-module/comment-page-1/#comment-452639
*
* Create your own class implementing LIF_PROCESSOR to process each text extracted.
* Two demo classes are provided: LCL_WRITER (active) and LCL_VERIFIER (if you want to test).
*
* Note: you won't need this code if you have the newest standard function modules READ_MULTIPLE_TEXTS and READ_TEXT_TABLE installed in
* your system (cf note 2261311 – Function module for reading multiple SAPscript texts -> https://launchpad.support.sap.com/#/notes/2261311/E )
REPORT zdemo.
@sandraros
sandraros / vba_word_tabs_to_spaces_or_markdown
Last active January 19, 2019 19:51
VBA macro to paste into MS Word, which converts text lines with tab characters representing tables into tables without tab, but instead with values right-padded with spaces (markdown version too) so that to fit perfectly for usage of HTML <pre>...</pre>
Rem 1) select the text lines representing a table whose columns are separated by the tab character
Rem 2) run this macro
Rem 3) result: the tab characters are replaced by two or more space characters such a way each column
Rem has the same number of characters
Rem 4) you may then copy/paste those text lines inside HTML <pre>...</pre> it will look like a table
Sub tabs_to_spaces()
Dim par As Paragraph
Dim pars() As Paragraph
Dim arr(50) As Integer ' 50 tabs maximum per line