Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
SeshaP
Participant
Hi All,

This blog post provides how to read a long text of SAP Master data objects/fields like

Material - PO Long text

Material - Sales Long text

Equipment/Notification long text etc.,in S4 HANA through a CDS view.

Introduction:


Long texts of a material master or any master data objects are stored in an encrypted format in tables STXH and STXL , where STXH stores the header information of the long text like MATERIAL, PO, Sales etc., which indicates which Text Object the long text belongs to, TDID which indicates the various types of texts related to a text object, and TDNAME which is the actual name of the long text (in the case of MATERIAL should be the material number)

As these texts are stored in an encrypted format, the texts cannot be read using a SELECT statement. In ECC and R3 systems you will have to use the function module READ_TEXT. Through Read text we have limitation if we have maintained more than 250 chars it will truncate.

Below are some of the question’s and issues raised in SCN forum related to READ_TEXT.

https://answers.sap.com/questions/3237668/problems-with-text-with-more-than-250-characters-u.html

https://answers.sap.com/questions/10151756/create--read-text-with-more-than-255-chars.html

https://answers.sap.com/questions/7946583/in-readtext-fm-the-data-after-256-characters-gets-.html

https://answers.sap.com/questions/8926760/how-to-print-long-text-of-255-character-in-alv-gri.html


Solution:


In S4 Hana a standard CDS view I_TextObjectPlainLongText has introduced it stores all the master data related long texts. Using this you can read any long text of SAP Master data objects or fields without any limitation.With this view we can easily view and download any no of characters.

Data to this CDS view is populating or feeding through an ABAP program ESH_SR_LTXT_REPLICATE. We can Schedule or run the abap program depending on frequency of usage.

It can be accessed in SE16n or SE11.



  • Text Object: Master Data object – Material, Equipment, Notification etc.

  • Text ID: BEST – PO Long text , QMEL – Notification etc.

  •  Language: EN,FR etc.,

  • Text Name: Material No(MATNR), Notification no (QMEL) etc.

  •  Long text : Descption of the Object


Depnding on requirement pass the values. You will see a long description in PLAINLONGTEXT/ Long Text column.

In addition, There are some standard CDS view available in S4 HANA which were created using I_TextObjectPlainLongText as source as listed below.


All these CDS views can be accessed in Eclipse, sql views in SE16n or SE11 . Depending on requirement we can use them directly either in ABAP program or a fiori app.

References:

https://help.sap.com/docs/SAP_NETWEAVER_750/6522d0462aeb4909a79c3462b090ec51/ef55edda68864a709d51345...

OSS Note : 3048704 Long text (SAPScript) search enablement for CDS-based search

Note: There is a limitation with this long text cds view’s currently we can’t use them directly in analytic based modelling views - @analytic.query.true. If we try to use, we will get an error - ignored: Type g with length 000000 not supported [Analytics]

Hope this blog post helps.
12 Comments
former_member495146
Discoverer
0 Kudos

Hi,

Good article.

Maintenance Order Long text data was visible but could not see any instance of PO Long Text in Table ITXTOBJPLNLTXT

Any ideas?

Regards

 

SeshaP
Participant
0 Kudos

Hi,

As mentioned in blog data for this table was feeding or populating through an ABAP program ESH_SR_LTXT_REPLICATE. Run the abap program and see.

Thank you.

 

former_member495146
Discoverer
0 Kudos
Hi Sesha,

We did ran the program and number of records went up inclusive of material, Maintenance Plans, Equipments but not for PO.

What are we missing?

Regards
SeshaP
Participant
0 Kudos
Hi Javed,

Are you seeing po long text through READ_TEXT function module?

Also, make sure Text ID as BEST and Text object as material while passing the values in  ITXTOBJPLNLTXT  table.

 

Thank you

 
Jelena
Active Contributor
Thanks for sharing!

I had a question last year about the long texts and CDS views. Please be aware that there is a 1033 character limit for strings in ABAP CDS views in general ("unlimited" string is available in HANA CDS views). When dealing with longer texts, we did not find any other solution than to implement the OData service using classic code-based approach.

I've not heard of any changes since then but would be curious if anyone knows otherwise.
SeshaP
Participant
0 Kudos

Thank you for reading the blog and providing your feedback.

In my requirement, I am extracting  long text information through a CDS view via 3rd party or external tools  - SQL server and displaying the values in PBI report.

I don't see any character limit's while extracting data through  sql server.  This blog main purpose was instead of reading long text through a function module READ_TEXT read through the standard CDS views.

 

Thank you

Jelena
Active Contributor
0 Kudos

I don't remember where the information came from in my question. It could've been a typo. In documentation, I see 1333 limit for SSTRING type here

fischerm
Explorer
Hi Sesha,

great post! I have a question though. How would I associate more cds views to get more long text, e.g. for Objekt VBBK?

Best regards

Markus
SamyD
Explorer
0 Kudos
Hi Jelena,

 

I think your case in only for sstring type in CDS or for older version. Here it's not the case. You can try with more than 1033c. i'm trying with more than 3000c. it's working well in SH42020.

 

Br,
koyaajai
Explorer
0 Kudos

I have same question as fischerm, How can we extend the TExt objects to run for VBBK and VBBP. ?

Sandra_Rossi
Active Contributor
0 Kudos

fischerm koyaajai Please clarify why you are thinking that there are restrictions about VBBK and VBBP. The author has said that there was no restriction at all except in one special case ("without any limitation [...] There is a limitation [...] in analytic based modelling views"), all texts can be read with I_TextObjectPlainLongText.

 

DATA vbak TYPE vbak.
DATA(vbeln_pattern) = |{ vbak-vbeln }%|.
SELECT *
    FROM i_textobjectplainlongtext
    WHERE     textobjectcategory   IN ( 'VBBK','VBBP' )
          AND textobjectkey      LIKE @vbeln_pattern
    INTO TABLE @DATA(long_texts).

 

NB: link to the SAP Note 3048704 - Long text (SAPScript) search enablement for CDS-based search - SAP for Me

The examples given by the author, of specialized CDS views, are optional, they don't prevent from using directly I_TextObjectPlainLongText:

  • A_EquipmentLongText
  • C_MaintNotifLongTextTP
  • I_MaintNotifLongText
  • I_OrderLongText
  • I_PurchaseOrderText
  • I_PurchasingLongText

 

koyaajai
Explorer

Appreciate your quick response Sandra. 

I tried to replicate the text using the program ESH_SR_LTXT_REPLICATE in test mode. The text Object doesn't even let us enter VBBK and VBBP objects.  The program code has restrictions to multiple Sales related text objects we were looking for. I couldn't find any OSS note that points us to activate any missing configuration. 

Labels in this area