04-25-2007 9:39 AM
Hello,
How and where we use Text ID and Text Object's in the ABAP program?
Suppose If have a Text ID for a Text Object, in what condition I use these?
Please reply me.
Regards,
Shreekant
04-25-2007 9:46 AM
Hi Shreekant,
SAP stores comments (text fields) in a separate table. STXH is the text
"header" table (STXD SAPscript text file header). STXH-TDOBJECT =
'KNA1' will bring back all the customer comment headers. STXH-
TDNAME='0000010744' is the header record for the comment for customer
10744.
It is not always so simple to figure out what the TDOBJECT (object needed by function below - sometimes it is a table name, other times...), TDNAME (name needed by function below - sometimes it is a document number & line item or customer number, other times... ) & TDID (id needed by function below - it is always the long text id). There are several methods that can be used. You can create the long text that you are researching and using, SE16 for table STXH search TDLUSER = to your kerberos principal and TDLDATE = to today's date. This is modify date & user. Alternatively, you can find an existing item with the long text and figure out the date and user who last modified it and use this information in your search. Once you have STXH row for text of interest, use ZCAFTXT to test your research. Project Titles and WBS Titles are a bit more complex.
Changes to sales contract long text between 3.0F and 4.5B.
The following code is a function that will return a customer comment.
form get_comment using cur_kunnr.
call function 'READ_TEXT'
exporting
id = '0002'
language = sy-langu
object = 'KNA1'
name = cur_kunnr
importing
header = thead
tables
lines = tlinetab
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 = 0.
loop at tlinetab.
write / tlinetab-tdline.
add 1 to line_cnt.
endloop.
endif.
endform.
The above subroutine is called with the following code:
if p_cmnt = 'X'.
tdname = cur_cust-kunnr.
perform get_comment using tdname.
endif.
These data elements are defined as:
data: begin of tlinetab occurs 100. "table to process comments
include structure tline.
data: end of tlinetab.
data: tdname like thead-tdname.
Regards,
Raghav
04-25-2007 9:52 AM
hi
good
text id ->
http://help.sap.com/saphelp_nw04/helpdata/en/3f/bd1edf1b9a421da8b84be03c86b301/content.htm
text objects ->
http://help.sap.com/saphelp_nw04/helpdata/en/77/571d0e492011d1894a0000e829fbbd/content.htm
thanks
mrutyun^
04-25-2007 11:38 AM
Hi Raghavendra,
My requirement is:
Create the logic of Get Text for Ship ref number of ZOR order using below Text ID and Text object. **
Text ID ZP05  ShipRef.
Text object VBBP Sales Item texts.
How do I proceed to complete this assignment?
Please reply me.
Thanks,
Shreekant
04-25-2007 11:45 AM
Hi Shreekant,
We use <b>Text ID</b> and <b>Text Object</b> while reading <b>Long text</b> which is present for some header data or item level data.U give tht in function <b>'READ_TEXT' </b> as parameter.
<b>Reward points if it solves ur query</b>
Thanks
Chinmay
04-25-2007 11:48 AM
Hi,
declare the following paramters:
To create Long Text lines for READ_TEXT function module
DATA:BEGIN OF dt_lines OCCURS 0.
INCLUDE STRUCTURE tline. " Long Text
DATA:END OF dt_lines.
data v_text(70).
Variable declarations for READ_TEXT function module
DATA : v_name TYPE thead-tdname, " Object Name
v_lan TYPE thead-tdspras. " Language
Constants
CONSTANTS:
Object ID for Long Text of fun module
c_id TYPE thead-tdid VALUE 'ZP05',
c_object TYPE thead-tdobject VALUE ''VBBP'. " Object
and in the loop of the Orders data:
loop at ITAB.
concatenate itab-vbeln itab-posnr into v_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
OBJECT = c_object
NAME = v_name
ID = c_id
LANGUAGE = sy-langu
ARCHIVE_HANDLE = 0
IMPORTING HEADER =
TABLES LINES = tline
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7.
clear : v_text, v_name.
if sy-subrc = 0.
loop at tline.
v_text = tline-tdline.
endllop.
endif.
endloop.
reward points if useful
regards,
Anji