Accessing long text of SAP Master data Objects or fields in S4 Hana through a CDS View
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.
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.
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.
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.