‎2010 Feb 09 5:46 AM
Hi
What parameter do i need to pass to read the purchase order line item text to the READ_TEXT functional module.
Regard
Raj.
‎2010 Feb 09 5:52 AM
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
‎2010 Feb 09 5:53 AM
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'
‎2010 Feb 09 5:54 AM
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.
‎2010 Feb 09 5:55 AM
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 ?
‎2010 Feb 09 5:58 AM
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
‎2010 Feb 09 6:04 AM
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
‎2010 Feb 09 1:14 PM
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