Three years ago I published a post with a suspiciously delicious title: “Easy Cooking: SM58 LUW_extractor (Extract pdf from logs in SM58 transaction)”. This is the sequel — the second serving — where the same SM58 problem returns to the kitchen, but this time the sous-chef is AI… and it finally knows how to finish the recipe.
Back in 2023, when I first wrote “Easy Cooking: SM58 LUW_extractor (Extract pdf from logs in SM58 transaction)”, I had a very simple plan: get the PDF out of SM58, no matter what it takes. And by “what it takes,” I obviously mean: write it in C#, because my ABAP skill level then (and now) is still proudly parked at “Hello World”. 😄
So yes — I cooked the whole thing in C# first. Not because it was the “correct” SAP-native choice, but because it was the choice that allowed me to actually finish the meal without setting the kitchen on fire. The extractor worked, the PDFs came out, everyone was happy… and my ABAP editor remained untouched and peacefully unused, like a gym membership in January.
Then came the “side quest”: Could this tool live outside of .NET?
With a bit of help from AI, I managed to port the C# logic into PHP. That part was surprisingly smooth — like swapping pasta brands and still ending up with dinner. Different syntax, same recipe, same result.
But ABAP? Oh, ABAP was the boss fight.
At the time, I tried multiple times to translate the same logic into ABAP, again with AI assistance. The result was always the same: I’d get something that looked like ABAP, smelled like ABAP… and then dumped like a dramatic opera singer the moment I pressed “Activate.” The best I could get was a collection of promising fragments — a method here, a structure there, a confident comment like “this should work” — and then I’d spend the rest of the day proving that it did not, in fact, work.
So I did what any reasonable developer would do: I left it alone and pretended it was “not a priority.”
One day, the thought returned: What if I tried again?
Same problem. Same repository. Same C# code sitting on GitHub, looking at me like: “Remember when you said you’d rewrite me in ABAP?”
This time, I decided to make it a proper challenge. I gave AI the GitHub URL and basically said:
“Here’s the C# implementation. Please rewrite it in ABAP.”
And I expected the usual: a motivational speech, a half-solution, and a polite suggestion that I should “consider using standard SAP functionality.”
Instead… AI just went to the repo, read the C# code, and came back like a calm senior developer who had already fixed the issue while I was still explaining it.
It generated the complete ABAP program — not just snippets, not just pseudo-code — an actual, end-to-end translation of the logic. The kind of output that makes you blink twice and check if you accidentally asked a coworker instead of a chatbot.
Of course, I didn’t trust it immediately. (I’ve been hurt before.)
So I did what we all do when something looks too good to be true: I tested it like a suspicious QA engineer with free time and a personal vendetta.
And here’s the plot twist:
It worked… after a few iterations.
Not “first try, perfection, angels singing.”
More like: “Nice attempt… now let’s fix this dump, and that edge case, and the one thing that looked innocent but absolutely wasn’t.”
So yes — there were a couple of back-and-forth rounds with AI and some testing on my side. But the important part is: the core solution was real, the logic was there, and with a bit of iterative seasoning, the ABAP version became fully functional.
The PDF extraction ran cleanly, the output made sense, and the program behaved like it had been written by someone who actually enjoys ABAP (which is definitely not my “Hello World” self).
So this Part II is really the story of that moment:
the same recipe, the same ingredients — but suddenly the kitchen gained a chef.
Figure 1. Shows how rewritten code in ABAP extracts and opens PDF from SM58 LUW's log
Summary
That’s it for Part II of this “Easy Cooking” experiment. If you’ve tried extracting PDFs from SM58 logs (or fought with LUWs in general), I’d love to hear how you approached it — and whether you’d do anything differently. Drop a comment with your thoughts, improvements, or war stories.
The ABAP version (ZSM58_LUW_EXTRACT_ABAP) is available in the GitHub repository, and the AI model used for the rewrite was ChatGPT 5.2. Feel free to test it, break it, improve it — and if you spot a better way, share it with the rest of us.
NOTE:
Bonus idea for Part III (because sequels always happen): instead of the current “save the log → upload → extract” routine, we could make it even more lazy-developer-friendly. Imagine a mode where you just paste the SM58 Transaction ID, hit execute, and the ABAP does the rest — one input field, one click, one PDF… and zero file juggling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |