2023 Sep 26 6:03 PM
I'm debugging a custom program which creates a document in AL11. Is it possible to remove the whitespace?
Whitespace is highlighted in blue. Additionally, I want to put "#" or " | " at the end of the line.
Edit: assuming that the pipes in the image are borders between null values.
Sometimes the output is:
|50|123|444|122222| *whitespace*
2023 Sep 26 6:22 PM
Yes. This won't create any trailing space:
TRANSFER '50||||...........001|||||||||' TO textfile.
2023 Sep 27 7:56 AM
How can we help without you sharing relevant piece of code?
2023 Sep 27 8:53 AM
l_concat = l_concat && '|'.
CONDESE l_concat NO-GAPS.
Actually that looks like code from hell!
2023 Sep 27 11:03 AM
should I insert it here? the value of c_del is ' | '
* DO.
* ASSIGN COMPONENT sy-index
* OF STRUCTURE <fs_final>
* TO <fs_field>.
* IF sy-subrc EQ 0.
* IF sy-index EQ 1.
* DATA(l_concat) =
* CONV string( <fs_field> ).
* l_concat = c_del && l_concat.
* ELSE.
* IF <fs_field> IS NOT INITIAL.
* l_concat = l_concat &&
* c_del &&
* <fs_field>.
* ENDIF.
* IF <fs_field> IS INITIAL.
* l_concat = l_concat &&
* c_del.
* ENDIF.
* ENDIF.
* l_count = l_count + 1.
* ELSE.
* EXIT.
* ENDIF.
* ENDDO.
* outlines = outlines + 1.
* move-corresponding
2023 Sep 27 12:22 PM
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE <fs_final>
TO <fs_field>.
IF sy-subrc = 0.
lv_concat = lv_concat && CONV string( <fs_field> ) && c_del.
ELSE.
* Last field => add last delimiter and exit
lv_concat = lv_concat && c_del.
EXIT.
ENDIF.
ENDDO.
* Remove leading/trailing blanks and all substrings that contain nothing but blanks
CONDENSE lv_concat NO-GAPS.
WRITE:/ lv_concat.
2023 Sep 27 3:05 PM
c12b61ded10b4e18beae75c3b6218d2c Hi, I've tried replicating your code but still encountering a whitespace. This is a subroutine pool. Is it possible to debug it?
2023 Sep 27 4:59 PM
walkerist Why don't you use debugger F9 at the ABAP statement TRANSFER? I'm pretty sure it will work even for generated subroutine pools.
2023 Sep 27 11:50 AM