ajson icon indicating copy to clipboard operation
ajson copied to clipboard

Using ajson in BTP/Cloud ABAP

Open G3GDan opened this issue 1 year ago • 5 comments

A query at this stage - but it may become an issue.

Has anyone attempted to use ajson in the context of BTP? We're planning a shift to Public Cloud so no lift and shift of code. I suppose it all starts with getting BTP to talk to github - possibly via an Eclipse plug-in.

Any advice or experiences which can be shared, please?

G3GDan avatar Jul 12 '24 15:07 G3GDan

I didn't use it in BTP. @larshp does abaplint have a possibility to check it? (P.S. I tried to configure double platform check last year but didn't manage to do it)

sbcgua avatar Jul 13 '24 14:07 sbcgua

easiest is to install https://github.com/marketplace/abaplint and then there is an example in https://github.com/abap2xlsx/abap2xlsx

also note that the marketplace abaplint works better with pull requests from forks

larshp avatar Jul 13 '24 15:07 larshp

I'm back with some generally positive news.

We have a Public Cloud system and I've been able to pull the current ajson via the Eclipse plug-in. At some stage I will try to do the same in a BTP instance.

Three things were flagged:

  • the performance test program can't be created - no PROG allowed
  • preference for lr_stack_top = ref #( ) rather than GET REFERENCE OF INTO lr_stack_top
  • deprecated POSIX for regex processing

Problem is what (not) to do to maintain compatibility. Probably I'll convert to using ref# as it's "easy" and create a Class equivalent of ZAJSON_PERF_TEST. Less enthusiastic about tinkering with the regex code - at least not until I've read up and have some data I can use to test.

Happy to contribute these back but are we potentially in a situation where there will need to be traditional vs cloud branches?

My main mission now is reworking the interface which uses the ajson Classes.

G3GDan avatar Oct 08 '24 11:10 G3GDan

ref #( ) and the newer regex are not compatible with 7.02. SAP made it impossible to have code that seamlessly works in every environment. 🤷

IMHO, the best approach is a "latest" version that works with the most recent ABAP release (and BTP if that's a target) while trying to support as many older releases as possible (something like 740 SP 8 or higher). To support older releases, create a separate repo that clones "latest" and automatically downport using abaplint. You could do this with branches but the CI setup becomes more complex.

mbtools avatar Oct 08 '24 13:10 mbtools

I agree with Marc regarding the compatibility. get reference and POSIX regexs are still valid and, my guess, will stay there for a while ... The perf_test deployment (which is the most annoying here imho) can be skipped by Exclude path feature - the package separation was quite intentional ;0 image image

sbcgua avatar Oct 21 '24 18:10 sbcgua