1

I need to get the particulars/long text of FI held documents. I tried the 'read_text' function module but had no luck since the held document has the temporary document number.

I tried looking for data in STXL and STXH tables, I also tried the function modules in FM group FTXT and STXD but had no luck.

Any other method to achieve that goal?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kjarlvi
  • 126
  • 1
  • 13
  • 1
    If you are working with a temporary document number, I am guessing you need this data in a user exit. If you tell us what that is we might be able to help you better. – Gert Beukema Mar 14 '18 at 03:20
  • One of the parameters needed on 'read_text' fm is the document number which will be generated when the document is parked or posted. I made a fi document which is held, i used tcode f-43. then I inserted a long text more particularly, the particulars. how can I get that particulars/ long text? – Kjarlvi Mar 14 '18 at 03:31

1 Answers1

0

First of all, you need the temporary document number which can be get either from F-43 itself or from RFDT table.

enter image description here

In field SRTFD you should separate it from username.

enter image description here

Then run READ_TEMP_DOCUMENT FM, after running it you should have your texts in ABAP memory.

To get them use GET_TEXT_MEMORY.

 ls_uf05a-tempd = '0012312356'.     "doc number
 ls_uf05a-unamd = 'JOHNDOE'.        "username

 CALL FUNCTION 'READ_TEMP_DOCUMENT'
   EXPORTING
     I_UF05A         = ls_uf05a
    TABLES
     T_BKPF          = lt_bkpf
     T_BSEC          = lt_bsec
     T_BSED          = lt_bsed
     T_BSEG          = lt_bseg
     T_BSET          = lt_bset
     T_BSEZ          = lt_bsez
     .

DATA: lt_texts TYPE TABLE OF TCATALOG,
      t_tline TYPE STANDARD TABLE OF tline,
      memory_id(30) VALUE 'SAPLSTXD'.

CALL FUNCTION 'GET_TEXT_MEMORY'
  TABLES
    TEXT_MEMORY       = lt_texts.

READ TABLE lt_texts ASSIGNING FIELD-SYMBOL(<cat>) WITH KEY tdobject = 'BELEG'
                                                           tdid = '0001'
                                                           tdspras = 'E' BINARY SEARCH.
IF sy-subrc = 0.
   memory_id+8(6) = <cat>-id.
ENDIF.

IMPORT tline = t_tline FROM MEMORY ID memory_id.

LOOP AT t_tline ASSIGNING FIELD-SYMBOL(<tline>).
  WRITE: <tline>-tdline.                                    "showing the texts
ENDLOOP.
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Thank you for the reply, but doesn't work, I have tried that method and I use 'DOC_ITEM' instead beleg, and i have looked into the header of the long text to get the id and object. any other way to get that particulars – Kjarlvi Mar 26 '18 at 03:23
  • Why do you use `DOC_ITEM` instead beleg? And what do you mean under particulars? – Suncatcher Mar 26 '18 at 03:43
  • I tried beleg too, but it doesn't work. I found out that the object for particulars is DOC_ITEM while the text id was Z002, i've seen this in the text header. on the f-43 held document long texts. – Kjarlvi Mar 26 '18 at 05:25
  • I don't know what *particulars* you are talking about. There is no such entity in SAP. There **are** [long texts](https://imgur.com/a/OCymU) and this code definitely works for them. – Suncatcher Mar 26 '18 at 07:31
  • GIve the screenshot for clarity. – Suncatcher Mar 26 '18 at 07:31