Monday, March 4, 2019

Partial Pritty Print

Especially in AMS you often don't want to pretty print the whole include, but only a part of it.

Select the section to pretty print
right click and select "Format" --> "Selektion formatieren"

Saturday, March 2, 2019

Debugging remote nodejs applications

If you want to debug a nodejs application that runs on a remote Linux server from a local Windows machine with Chrome, do the following:

Go to the Linux machine and make sure that the debugging port is opened in the firewall
ufw status
ufw allow 9229
start the nodejs application in debug mode
node --inspect app.js

Alternatives:
use node --inspect-brk app.js to start it with a breakpoint at the beginning
use node --inspect=linuxserver.com:9229 app.js to make a debugger listen on a public port. Don't do this.

Open Chrome and go to chrome:inspect
Your application doesn't appear because Chrome is only looking on local ports
Since node --inspect app.js makes the remote debugger listen on 127.0.0.1 it doesn't make sense to add the Linux server to your configuration in chrome:inspect. Instead configure a tunnel: open cmd and type
ssh -nNT -L 9229:127.0.0.1:9229 user@linuxserver.com
if you have an rsa key to logon to your remote server
ssh -nNT -L 9229:127.0.0.1:9229 user@linuxserver.com -i keyfile

Port 9229 of your local Windows machine is now forwared to the remote Linux server. In chrome:inspect under Remote Target #LOCALHOST a link apears that you can use to debug your application running on the remote Linux server in Chrome on your local machine.

(What has that to do with SAP? Cloud is comming for ABAPers)

SAP ABAP: Determine Timezone for Plant

    DATA:       lt_tzone TYPE STANDARD TABLE OF tznzone WITH DEFAULT KEY,       l_tzone  TYPE tznzone.     " get time zone for plant   ...