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

Parameter for READ_TEXT

Former Member
0 Likes
5,767

Hi

What parameter do i need to pass to read the purchase order line item text to the READ_TEXT functional module.

Regard

Raj.

7 REPLIES 7
Read only

Former Member
0 Likes
2,173

Hi,

You need to pass Text ID of text to be read, Language of text to be read, Name of text to be read, Object of text to be read. Refer below sample code:


DATA: l_c_ltxt   TYPE tdid     VALUE 'F01',
      l_c_mdtxt  TYPE tdobject VALUE 'EKKO'.

CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id                      = l_c_ltxt
      language                = V_VEN_LANG  "sy-langu
      name                    = l_v_tname
      object                  = l_c_mdtxt
    TABLES
      lines                   = i_tline
    EXCEPTIONS
      id                      = 1
      language                = 2
      name                    = 3
      not_found               = 4
      object                  = 5
      reference_check         = 6
      wrong_access_to_archive = 7
      OTHERS                  = 8.

Thanks,

Archana

Edited by: Archana Pawar on Feb 9, 2010 6:58 AM

Read only

Former Member
0 Likes
2,173

Hope this is helpful.

concatenate wa_final-po_number wa_final-po_item into lv_textname.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

id = 'F02'

language = 'E'

name = lv_textname

object = 'EKPO'

Read only

Former Member
0 Likes
2,173

Hi

You have to pass the parameters like 'ID', 'NAME' & 'OBJECT ID' and language as 'EN' for English.

e.g. NAME is like 'VBBK' id will be like 'Z001' and object will be like 'VBELN'.

you open your text filed, then go to header details, where you will find the details of parameters which needs to send

Rani.

Read only

Former Member
0 Likes
2,173

when you are in that transaction & text edit screen. click on Menu > Goto > Header

there you will get all required details for that long text. like folloeing. normally text id/name you need to build concatinating object id & item no etc.

Text Name V000450199

Language EN

Text ID 0001 Correspondence

Text object BUT000 Business partners

which long text you are looking for ?

Read only

anup_deshmukh4
Active Contributor
0 Likes
2,173

pass language as EN or E

pass name as : if its a header level text pass header document number

if its a line item level text pass header document number + line item number (concatinated )

pass ID as : 'B01 ' i.e. as example if you want to know the text id of your text double click on the text area and navigate to 'GOTO' and header you will get it ( Hear you will get all teh parameters you want to pass for teh function module )

pass object as the table name....ie ekpo , ekko etc .

Edited by: Anup Deshmukh on Feb 9, 2010 6:59 AM

Read only

Former Member
0 Likes
2,173

Hi,

Hi,

ABAP READ_TEXT functions to read the SAP Long Text

Go through this sample code below:



TABLES: PBIM. 
* stxh, stxl, stxb - trans tables for text 
* ttxit - text on text-ids 
* ttxot - Short texts on text objects 
* Transaction MD63 
SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR, 
                S_WERKS FOR PBIM-WERKS. 
DATA: BEGIN OF HTEXT. 
        INCLUDE STRUCTURE THEAD. 
DATA: END OF HTEXT. 
DATA: BEGIN OF LTEXT OCCURS 50. 
        INCLUDE STRUCTURE TLINE. 
DATA: END OF LTEXT. 
DATA: BEGIN OF DTEXT OCCURS 50. 
DATA:   MATNR LIKE PBIM-MATNR. 
        INCLUDE STRUCTURE TLINE. 
DATA: END OF DTEXT. 
DATA: TNAME LIKE THEAD-TDNAME. 
SELECT * FROM PBIM WHERE WERKS IN S_WERKS. 
  MOVE PBIM-BDZEI TO TNAME. 
  CALL FUNCTION 'READ_TEXT' 
       EXPORTING 
*           CLIENT                  = SY-MANDT 
          ID                      = 'PB' 
          LANGUAGE                = 'E' 
          NAME                    = TNAME 
          OBJECT                  = 'PBPT' 
*         ARCHIVE_HANDLE          = 0 
     IMPORTING 
          HEADER                  = HTEXT 
     TABLES 
          LINES                   = LTEXT 
     EXCEPTIONS 
          ID                      = 1 
          LANGUAGE                = 2 
          NAME                    = 3 
          NOT_FOUND               = 4 
          OBJECT                  = 5 
          REFERENCE_CHECK         = 6 
          WRONG_ACCESS_TO_ARCHIVE = 7 
          OTHERS                  = 8. 
  LOOP AT LTEXT. 
    IF LTEXT-TDLINE NE ''. 
      MOVE LTEXT-TDLINE TO DTEXT-TDLINE. 
      MOVE PBIM-MATNR TO DTEXT-MATNR. 
      APPEND DTEXT. 
    ENDIF. 
  ENDLOOP. 
ENDSELECT. 
 
LOOP AT DTEXT. 
  WRITE:/ DTEXT-MATNR, DTEXT-TDLINE. 
ENDLOOP.
 

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
2,173
TABLES:VBAP.

SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.

PARAMETERS: P_POSNR LIKE VBAP-POSNR.

DATA:  BEGIN OF ITAB_VBAP OCCURS 0,
         VBELN LIKE VBAP-VBELN,
         POSNR LIKE VBAP-POSNR,
         ARKTX LIKE VBAP-ARKTX,
      END OF ITAB_VBAP.

DATA: BEGIN OF ITAB OCCURS 0.
        INCLUDE STRUCTURE TLINE.
DATA: END OF ITAB.

DATA: NAME LIKE THEAD-TDNAME.

SELECT VBELN POSNR ARKTX  FROM VBAP INTO TABLE ITAB_VBAP WHERE VBELN IN S_VBELN.

LOOP AT ITAB_VBAP.
  WRITE: / ITAB_VBAP-VBELN,ITAB_VBAP-POSNR,ITAB_VBAP-ARKTX.
ENDLOOP.

START-OF-SELECTION.
  CONCATENATE S_VBELN P_POSNR INTO NAME.


  CALL FUNCTION 'READ_TEXT'
    EXPORTING
     CLIENT                         = SY-MANDT
      ID                            = '0001'
      LANGUAGE                      = SY-LANGU
      NAME                          = NAME
      OBJECT                        = 'VBBK'
*   ARCHIVE_HANDLE                = 0
*   LOCAL_CAT                     = ' '
* IMPORTING
*   HEADER                        =
    TABLES
      LINES                         = ITAB
   EXCEPTIONS
     ID                            = 1
     LANGUAGE                      = 2
     NAME                          = 3
     NOT_FOUND                     = 4
     OBJECT                        = 5
     REFERENCE_CHECK               = 6
     WRONG_ACCESS_TO_ARCHIVE       = 7
     OTHERS                        = 8
            .


  IF SY-SUBRC EQ 0.

    LOOP AT ITAB.
      WRITE:/ ITAB-TDLINE.
    ENDLOOP.

  ELSE.
    WRITE:/ 'Sy-Subrc = ', SY-SUBRC.
  ENDIF.

Regards

Suri