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

table for Long Text

Former Member
0 Likes
6,542

hi,

Longtext gets stored in which table??How to access those text without read_text FM??

Thanks,

Gaurav

8 REPLIES 8
Read only

former_member156446
Active Contributor
0 Likes
1,850

STXH STXD SAPscript text file header

Read only

0 Likes
1,850

hi,

which field is storing the text?

Gaurav

Read only

Read only

0 Likes
1,850

TLINE-TDLINE..

using the FM is the best way to do... create few tables and pull with the FM and play with it.

Read only

Former Member
0 Likes
1,850

STXH is the text "header" table

check this for sample code.

http://fuller.mit.edu/SAPDocs/sap_long_text.html

Regards,

Maha

Read only

former_member194669
Active Contributor
0 Likes
1,850

Hi,

No possible without using fm READ_TEXT.

The data in table STXL in LRAW format. you need to use fm read_texr

a®s

Message was edited by:

a®

Read only

Former Member
0 Likes
1,850

Hi

You can use the Strutcure <b>TLINE</b>

Check the below sample

*&---------------------------------------------------------------------*
*& Report  ZREADTEXTTEST                                               *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  ZMATERAILDESCRIPTION                           .


tables: ekpo,MAKT.
TYPE-POOLS: slis.
 DATA: thread LIKE thead.
 DATA: l_index LIKE sy-tabix.


DATA: BEGIN OF INT_OUT OCCURS 0,
        MATNR LIKE  EKPO-MATNR,
        MAKTX LIKE MAKT-MAKTX,
        TDLINE LIKE TLINE-TDLINE,
        WERKS LIKE EKPO-WERKS,
      END OF INT_OUT.
DATA: BEGIN OF INT_OUT_new OCCURS 0,
        MATNR LIKE  MAKT-MATNR,
        MAKTX LIKE MAKT-MAKTX,
        TDLINE LIKE TLINE-TDLINE,
        tline like tline occurs 0,
        WERKS LIKE EKPO-WERKS,
      END OF INT_OUT_new.




DATA: it_tlines  LIKE tline OCCURS 10 WITH HEADER LINE.

**************************
****ALV list definintion
*************************
DATA: ws_cat TYPE slis_fieldcat_alv ,
      int_cat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
      g_custom_container TYPE REF TO cl_gui_custom_container.




*****************
*selection-screen
*****************




SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 25(20) text-001.
**PARAMETERS:  S_MATNR LIKE MAKT-MATNR obligatory.
*
SELECT-OPTIONS: S_MATNR FOR MAKT-MATNR  .
SELECTION-SCREEN END OF LINE.




*SELECTION-SCREEN BEGIN OF LINE.
*SELECTION-SCREEN COMMENT 25(20) text-002.
**PARAMETERS:p_ebeln LIKE ekko-ebeln obligatory.
*SELECT-OPTIONS: S_WERKS  FOR EKPO-WERKS OBLIGATORY.
*SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.


START-OF-SELECTION.
  PERFORM get_data.
*  PERFORM field_catalog.
*  PERFORM display_data.

END-OF-SELECTION.
*FORM GET_DATA.


form get_data.




 DATA: l_index LIKE sy-tabix.

*SELECT
*      a~matnr
*      a~werks
*      b~maktx FROM ekpo AS a
*              INNER JOIN makt AS b
*              ON b~matnr = a~matnr
*              INTO CORRESPONDING FIELDS OF TABLE int_out
*              WHERE
**              a~matnr = s_matnr and
*              a~werks IN s_werks.



*To Fetch Data From Makt.

SELECT MATNR MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF TABLE
int_out WHERE MAKT~MATNR IN S_MATNR.



LOOP AT int_out.



l_index = sy-tabix.

* read table int_out_new with key matnr = int_out-matnr.

    int_out_new-matnr = int_out-matnr.
    int_out_new-maktx = int_out-maktx.

*
    thread-tdname = int_out-matnr.

CALL FUNCTION 'READ_TEXT'
        EXPORTING
              client = sy-mandt
              id = 'BEST'
              language = sy-langu
              name = thread-tdname
              object = 'MATERIAL'
              TABLES
              lines = it_tlines
        EXCEPTIONS
              id = 1
              language = 2
              name = 3
              not_found = 4
              object = 5
              reference_check = 6
              wrong_access_to_archive = 7
              OTHERS = 8.

*Loop on it_tlines where long text is coming .

loop at it_tlines.


    IF sy-subrc = 0.

        int_out_new-tdline = it_tlines-tdline.
        append int_out_new.
        clear int_out_new.
        clear int_out_new-tdline.

    ENDIF.

endloop.

delete  adjacent  duplicates  from INT_OUT .
append int_out_new.
ENDLOOP.

* Field Catalog

***MATERIAL NO no
  int_cat-tabname       = 'INT_OUT_NEW'.
  int_cat-fieldname     = 'MATNR'.
  int_cat-reptext_ddic  = 'MATERIAL NO'.
  APPEND int_cat .

*material Short Description
  int_cat-tabname       = 'INT_OUT_NEW'.
  int_cat-fieldname     = 'MAKTX'.
  int_cat-reptext_ddic  = 'MATERIAL SHORT DESCRIPTION'.
  int_cat-datatype = 'CHAR'.
  int_cat-outputlen = '45'.

  APPEND int_cat .

** Material Long Description
  int_cat-tabname       = 'INT_OUT_NEW'.
  int_cat-fieldname     = 'TDLINE'.
  int_cat-reptext_ddic  = 'MATERIAL LONG DESCRIPTION'.
  int_cat-datatype = 'CHAR'.
  int_cat-outputlen = '200'.

    APPEND int_cat .


  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      i_callback_program = sy-repid
      it_fieldcat        = int_cat[]

    TABLES
      t_outtab           = int_out_NEW
    EXCEPTIONS
      program_error      = 1
      OTHERS             = 2.



ENDFORM.                    "display_data

Regards

Pavan

Read only

0 Likes
1,850

stxh & stxl is used for storing long text........