cancel
Showing results for 
Search instead for 
Did you mean: 

OData service for long texts (READ_TEXT)?

Jelena
Active Contributor

We need to provide an OData service for the long texts of a document. These texts are stored in STXH/STXL and are accessed by READ_TEXT FM and similar. We are working with S/4HANA 2020 system and ABAP RAP model (well, trying to, at least).

Using CDS views, the only option to provide these texts is to use a virtual element, as explained here and here. All is well but there is max length of 1033 characters in CDS string. We are dealing with some very long texts, unfortunately, that will exceed that.

Question: in 2022, how do we resolve this? Should we forget about CDS views and just use completely custom implementation in SEGW? Is there any other option? Splitting text into several variables or separate records would be undesirable.

Edit: this scenario does not involve SAP Fiori / UI5, so we don't care for CDS advantages in this area.

Thank you!

VijayCR
Active Contributor
0 Kudos

Hi Jelena ,

Can you reuse the logic similar to the Service SGBT_NTE_CDS_API_D_SRV with 1:N relationship so that you can all the texts for the same ?

Thanks

Vijay

rchudziak
Participant
0 Kudos

In S/4 2020 I noticed there is a CDS view I_Text_Templates which has an association I_TextObjectPlainLongText which selects from table ESH_SR_LTXT (Replicated Plain Longtext) - have a look if it helps

Jelena
Active Contributor
0 Kudos

Hi radek_c ! This specific CDS view is meant for the search and it will have the same problem of 1033 characters string length limitation that is mentioned in my post.

Accepted Solutions (1)

Accepted Solutions (1)

former_member185511
Active Participant

Some CDS limits like the above one and the total 4096 char limit is really problematic sometimes. For your scenario, I think just resolving on ABAP layer in a service would contain less moving part. I like doing everything with CDS but some limitations and workarounds to that limitations are creating technical dept. I think keeping simple with a SEGW custom implementation would be cleaner and leaner.

Answers (1)

Answers (1)

Ryan-Crosby
Active Contributor

Hi Jelena,

Maybe the following would help in your case?

Regards,

Ryan Crosby

Jelena
Active Contributor
0 Kudos

Thanks, Ryan! This type is only available in HANA CDS views, not with ABAP CDS views.

Ryan-Crosby
Active Contributor

Ahh ok, I'm behind the curve because we are transitioning to S4 now, so learning a fair amount about the changes since ole ECC. I'm more of an A2A/B2B integration expert though, so I would tailor up a service that would do the data manipulation without the 1,333 constraint, or like you had mentioned... the SEGW service (which I feel I have seen quite a few of in our S4 system).

Ryan-Crosby
Active Contributor
0 Kudos

The RAW type here may be an option - I mentioned the others previously but then I had to cross check it with the CDS types. Not sure what length you are looking for but RAW has a maximum length of 32,000 (not sure how conversion to character type could be handled though).