Friday, 8 March 2024

SQL Statement Collection for SAP HANA - The output is right aligned

In some ABAP Support Packages the SQL Editor of DBACOCKPIT will show a right-aligned output.

SAP Note 1969700 (section 'The output is right aligned') respectively 3343639 describe the reason and solution for this from ABAP aspect.

The aim of this post is to present an instant workaround to convert the output to a kind of "human readable" format.

The SQL statement referenced here is a statement from the statement collection attached to the SAP Note 1969700.

I am using Notepad++ as a freeware text editor.

....

When you run a statement via the SQL editor of DBACOCKPIT and you get an output like this:

SQL Statement Collection for SAP HANA - The output is right aligned

SQL Statement Collection for SAP HANA - The output is right aligned

You might be struggling to read the columns and the values in the right way.
To get this right I usually:

1. Export the output from the SQL editor to the clipboard

SQL Statement Collection for SAP HANA - The output is right aligned

SQL Statement Collection for SAP HANA - The output is right aligned

2. Paste the copied output from the clipboard to a new text file in Notepad++.

3. Check which lines I want to have left aligned.

4. Select the first character of the lines in question and delete them

SQL Statement Collection for SAP HANA - The output is right aligned

You can achieve this by using Alt + Mouse cursor (to select column vertically)

5. Once you have deleted the first character and there are only spaces you can use the 'Trim Leading Space' option.

SQL Statement Collection for SAP HANA - The output is right aligned

6. The result looks like this:

SQL Statement Collection for SAP HANA - The output is right aligned

It is not a big deal but helps me every time.

No comments:

Post a Comment