Before I wrote that tool, I have no technical knowledge on note at all. I will share with you how I was able to write a tool by myself by getting source code I need via debugging.
All I know is the fact that I can use tcode SNOTE to download a note in Netweaver system.
1. I click “Goto”->”Download SAP Note”:
And maintain a Note number which I would like to download:
2. Create a new text file pasting the following content into it:
Save the text file. Drag this file to the download popup in step1, when you see the small “+” icon, drop it.
You should see “Debugging switched on” in the bottom screen.
3. Click F8 to start download, for me since I have also activated system debugging, so the callstack below seems not so useful for me.
Double click stack11:
So from here I can know the main logic of note download is implemented in report scwn_note_download:
Set a dynamic breakpoint by clicking the line 334, and click F8. Now code has executed to line 334, we can simply click F5 to step into the report:
Within this report I learned a useful function module SCWN_NOTES_DOWNLOAD:
All I have to pass into this FM to start note download is note number, version and language:
And I continue to step into this FM, I get to know some more function modules with more fine granularity, such as SLIC_GET_LICENCE_NUMBER and SCWN_NOTE_UNPACK_XML, and it is good for me to know finally that the note download is just implemented via a RFC call:
In fact most of the source code of my tool are copied from FM SCWN_NOTE_DOWNLOAD.