Skip to content

Abap run new session#182

Merged
jfilak merged 2 commits into
jfilak:masterfrom
filak-sap:abap_run_new_session
Jul 6, 2026
Merged

Abap run new session#182
jfilak merged 2 commits into
jfilak:masterfrom
filak-sap:abap_run_new_session

Conversation

@filak-sap

Copy link
Copy Markdown
Contributor

No description provided.

filak-sap added 2 commits July 6, 2026 22:39
Because sometimes ABAP processes needs to be killed to see the newly
created objects correctly.
Not sure why, but we started to see the following error:
`Class does not implement if_oo_adt_classrun~main method!`

and only re-connecting helped.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@filak-sap, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a1fcfef6-a92e-4a27-871c-cb01cdd886ed

📥 Commits

Reviewing files that changed from the base of the PR and between 9c0c291 and 9be4543.

📒 Files selected for processing (4)
  • sap/adt/core.py
  • sap/platform/abap/run.py
  • test/unit/test_sap_adt_connection.py
  • test/unit/test_sap_platform_abap_run.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jfilak jfilak merged commit d223ed3 into jfilak:master Jul 6, 2026
3 checks passed
@mhoerisch

Copy link
Copy Markdown
Contributor

Live-verified against an S/4HANA Public Cloud tenant (DDCI-flavor) on 2026-07-06. Combined with #181 into one test install (both PRs cherry-picked onto master).

Before this PR — deterministic failure on every abap run invocation:

$ echo "out->write( |Hello| )." | sapcli abap run -
Error: Class does not implement if_oo_adt_classrun~main method!

The trace showed all preceding calls returning 200 (create, checkruns, source PUT, activate 0 errors, class GET) and only the final POST /oo/classrun/<name> returning the error text. The class was persistent-created via sapcli class create/write/activate + manually POSTed to /classrun (with a fresh CSRF token) succeeded — same endpoint, same class, but a cold session on the second call. That pinned the bug to the sequencing / session-caching inside execute_abap().

After this PR — three consecutive successful invocations:

$ echo "out->write( |Hello from abap run new_session| )." | sapcli abap run -
Hello from abap run new_session

$ echo "out->write( |Second call — reproducible| )." | sapcli abap run -
Second call â reproducible

$ sapcli abap run - <<'EOF'
> DATA(now) = utclong_current( ).
> out->write( |Multiline works, timestamp: { now }| ).
> EOF
Multiline works, timestamp: 2026-07-06 20:53:13.8101140

The connection.new_session() between activate and execute is exactly the right cut — the class is properly activated on the server, and the classrun call starts with a fresh HTTP session (new cookies, new CSRF token), which lets the runtime see the just-activated implementation.

Small cosmetic side observation not caused by this PR: the em-dash in the second call rendered as â on stdout. Predates this PR — HTTP response encoding is not UTF-8-transparent somewhere upstream. Doesn't affect the fix.

Nice fix. Thank you.

@mhoerisch mhoerisch mentioned this pull request Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants