Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
jogeswararao_kavala
Active Contributor

For many of the Functional people longtexts is a sort of complicated thing for the fact that there are no straight tables which store these lines. So, whenever we think of making some report displaying long texts, we generally stuck at the very initial stage of finding the source of this information. This document is aimed at clearing these concepts.

We know the longtexts are very widely used within all SAP objects. For example in PM module, Longtexts associated with Notification Header, Order Header etc, also the Long texts associated with Catalog-Codes in Notifications, Operations in Orders, Measuring document related.

In this post, we try to understand these concepts, through the longtexts of PM Order operations.

So, let’s try and see how we reach the Long text lines of an Order operation.

Essence of this document is centered at using a Function Module named READ_TEXT.  First let’s have a look at what this FM gives? For this, run Tcode SE37.

Give FM name in the Function Module field and Hit function key F8 or Click on Execute button shown above.

Now, here in the above screen, when we

  1. Enter the values for the fields marked Green
  2. Press Execute button

We get the long text lines into the table named LINES at the bottom (marked Red).

Now what are these fields we need to fill and where we will find these? The answer comes from the Order operation longtext page. In our example we have taken operation 0020 of an Order as shown below .

Here, we enter into the long text page upon clicking on the Longtext icon above. Now in the Longtext page click on GoTo --> Header  in the menubar.

Now we get the pop-up below, showing these field values required for SE37.

Let’s see the relation between the SE37 screen and the Order Longtext screen fields through the following picture. (The value in ‘Client’ field of SE37 need not be filled. System identifies and fills it).

Here, we understand all the field values except for one i.e. the TEXTNAME. The understood fields are namely :

Field nameValueRemarks
LANGUAGEENConstant as per your system
TEXTIDAVOTConstant for Order Operation longtext
TEXTOBJECTAUFKConstant for Order related longtext

What we need to understand is the value of TEXTNAME i.e., 400100140302700000002. Let’s see how this comes. Let's see this number this way.

400100140302700000002

First 3 characters (400) is the client number of the SAP (on which you are working)

Next 10 characters (1001403027) form the AUFPL field value of the operation

Next 8 characters (00000002) indicate the Operation number APLZL

Client number we always are aware of. Other two field values we should take from table (view) VIAUF_AFVC by inputting the Order number. Means, run Tcode SE16, give value VIAUF_AFVC and hit function key F7 .

Enter the Order number and Execute (F8).

We get this results screen.

Here as per the operations tab of the Order we see 3 records one for each operation.  Our operation in question is no.2. Let’s pick-up the corresponding values of AUFPL and APLZL from here.

So what I want to say is, the ABAPer passes the values of Orders from the Selection screen (of the ZTcode he develops) and extracts these values from the table and concatenates (joins) all the 3 vlaues together into TEXTNAME and executes the Function Module alongwith other values (Language, TextId, TextObject) to get the Longtext lines through the Table LINES of the Function Module.

Now let’s execute the FM READ_TEXT by filling these values.

See what we got

The FM READ_TEXT has given us all the 4 lines present in the Operation2 text . Now our ABAPer would use this info in his code for long text report.

Hope things are clear.

Further:

The values of TextId, TextObject vary as to which SAP object the Longtext belongs, so as the constituents of TextName field value also. Here I am attempting to tabulate few such examples  of SAP-PM area for the benefit of members.

Long Text Associated withTEXTID

TEXT

OBJECT

TEXTNAME parts*Remarks
Notification Header TextLTXTQMELQMNUM (Notifn no )
Item Text in Catalogs&CodesLTXTQMFEQMNUM + POSNRPOSNR from  VIQMFE table
Cause Text in Catalogs&CodesLTXTQMURQMNUM + QURNUMQURNUM from  VIQMUR table
Task Text in Catalogs&CodesLTXTQMSMQMNUM + QSMNUMQSMNUM from  VIQMSM table
Activity Text in Catalgs&CodesLTXTQMMAQMNUM + QMANUMQMANUM from  VIQMSM table
PM order Header TextKOPFAUFKClientNo + AUFNR (Order)
Measuring DocumentLTXTIMRGMDOCM (Document no)
TasklistPLPOROUTINGClient+TasklistType+Group+PLNKN+ZAEHL values (of PLPO table)

Refer to my reply to the 1st comment of this  Document

*The QMNUM, AUFNR values should be preceded by the leading zero's (like 004300093626)

Easy retrieving of Longtexts in Smartforms

The information so far is more relevant to ALV reporting (though it works for smartforms also). In Smartforms, there is a convenient way of retrieving long texts, i.e., through include text. We declare the text type as Include text which gives us the provision of filling the TEXTNAME, LANGUAGE, TEXTID, TEXTOBJECT etc. As the the loop runs the TEXTNAME changes according to the SAP object number the respective longtext is retrieved. In the picture below an example for Notification Longtext in smartforms is given.

Related technical info

There is a table named STXH which stores the Text Header details. Here you get the number of text lines in the long text upon inputting the field values such as TDID, TDOBJECT, TDNAME etc. The following Selection screen (SE16) and the output are self explanatory .



So, that's everything on this subject, which I had been thinking of documenting for the benefit of the forum, since sometime. Hope members find it useful.

Thank you

KJogeswaraRao

PS: Members might now have understood that though PM Objects have been illustrated here, this post applies to the Longtexts of objects in other module  too.


41 Comments
Labels in this area