Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPScript: Getting long text of type DOKU with DOCU_READ function module

0 Likes
2,438

Hi everyone,

I am trying to get the entire long text of a data element, using the DOCU_READ function module. The trouble is, I can only get it to return this:


U1&DEFINITION&

AS

U1&USE&

AS

U1&DEPENDENCIES

AS

U1&EXAMPLE&

AS

The entire text that I entered in the documentation for the ZSAMPLE_DATA data element is not returned. In the SAPscript editor in tcode SE11 the documentation long text looks like this:

So there is quite a bit more text, but DOCU_READ does not return it. Here is my code:


DATA:

   ltid      LIKE  dokhl-id,

   ltspras   LIKE  dokhl-langu,

   ltobject  LIKE  dokhl-object,

   lttyp     LIKE  dokhl-typ,

   ltversion LIKE  dokhl-dokversion,

   i_tline   TYPE STANDARD TABLE OF tline,

   ltline    TYPE tline.

ltid 'DE'.

ltversion = '0000'.

ltspras = 'EN'.

lttyp = ' '.

ltobject 'ZSAMPLE_DATA'.

CALL FUNCTION 'DOCU_READ'

   EXPORTING

     id                      = ltid

     langu                   = ltspras

     object                  = ltobject

     typ                     = lttyp

     version                 = ltversion

   TABLES

     line                    = i_tline

   EXCEPTIONS

     id                      = 1

     language                = 2

     name                    = 3

     not_found               = 4

     object                  = 5

     reference_check         = 6

     wrong_access_to_archive = 7

     OTHERS                  = 8.

LOOP AT i_tline INTO ltline.

   WRITE ltline-tdformat.

   NEW-LINE.

   WRITE ltline-tdline.

   NEW-LINE.

ENDLOOP.

How can I get all of the text from the data element long text?

Any ideas?

Thanks so much!

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,595

Use parameter TYP = 'E' (you may get also the exact key values in table DOKIL).

Hi everyone,

I am trying to get the entire long text of a data element, using the DOCU_READ function module. The trouble is, I can only get it to return this:


U1&DEFINITION&

AS

U1&USE&

AS

U1&DEPENDENCIES

AS

U1&EXAMPLE&

AS

The entire text that I entered in the documentation for the ZSAMPLE_DATA data element is not returned. In the SAPscript editor in tcode SE11 the documentation long text looks like this:

So there is quite a bit more text, but DOCU_READ does not return it. Here is my code:


DATA:

   ltid      LIKE  dokhl-id,

   ltspras   LIKE  dokhl-langu,

   ltobject  LIKE  dokhl-object,

   lttyp     LIKE  dokhl-typ,

   ltversion LIKE  dokhl-dokversion,

   i_tline   TYPE STANDARD TABLE OF tline,

   ltline    TYPE tline.

ltid 'DE'.

ltversion = '0000'.

ltspras = 'EN'.

lttyp = ' '.

ltobject 'ZSAMPLE_DATA'.

CALL FUNCTION 'DOCU_READ'

   EXPORTING

     id                      = ltid

     langu                   = ltspras

     object                  = ltobject

     typ                     = lttyp

     version                 = ltversion

   TABLES

     line                    = i_tline

   EXCEPTIONS

     id                      = 1

     language                = 2

     name                    = 3

     not_found               = 4

     object                  = 5

     reference_check         = 6

     wrong_access_to_archive = 7

     OTHERS                  = 8.

LOOP AT i_tline INTO ltline.

   WRITE ltline-tdformat.

   NEW-LINE.

   WRITE ltline-tdline.

   NEW-LINE.

ENDLOOP.

How can I get all of the text from the data element long text?

Any ideas?

Thanks so much!

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,596

Use parameter TYP = 'E' (you may get also the exact key values in table DOKIL).

Read only

0 Likes
1,595

Thanks Sandra for helping me with my first steps here!

Looking in table DOKIL did the trick.