09-17-2008 9:31 AM
Dear all,
actually i want to list out all the material whose long text is not maintained.
how can i ??? Plz give me solution.
Bye & Thanx
09-17-2008 9:34 AM
Hi
Call the READ_TEXT function module in loop for all the materials and check whether TLINES is having value.
Regards
MD
09-17-2008 9:38 AM
Thanx but,
through read text it is mandatory to pass all the required values, like ID, Object, name, etc.
suppose i want to find out all material in Production server without passing material number through read text function.
can this possible through Read Text?????????????
09-17-2008 9:39 AM
Hi,
Use the function module 'READ_TEXT' to extract the text of the material.
Thanks,
Khushboo.
09-17-2008 9:43 AM
First Select all Materials and then Query on STXH table
pass the material number to a variable of type tdname , concatenate '%' at the end.
it should look like this..
v_tdname = '0023423423%'.
now
select * from stxh
up to 1 rows
into wa_stxh
where tdname like v_tdname.
endselect.
Check the sy-subrc then accordingly you can write the report or collect the material for which the long text not maintained.
09-17-2008 9:52 AM
Hi Anshuman,
Use this logic. Though this sample code is for sales document, but you can use READ_TEXT function module to fetch material text. This program will show those sales document for which text hasn't been maintained.
Now apply this logic.
REPORT z_sdn.
TABLES:
vbak.
DATA:
w_line TYPE i,
w_idx TYPE i VALUE 1,
w_name TYPE thead-tdname.
DATA:
BEGIN OF fs_tline,
tdformat TYPE tline-tdformat, " Tag column
tdline TYPE tdline, " Text Line
END OF fs_tline.
DATA:
i_tline LIKE
TABLE OF
fs_tline.
SELECT-OPTIONS:
s_vbeln FOR vbak-vbeln.
PARAMETERS:
p_textid TYPE thead-tdid.
DATA:
BEGIN OF fs_vbak,
vbeln TYPE vbak-vbeln, " Sales Document
END OF fs_vbak.
DATA:
i_vbak LIKE
TABLE OF
fs_vbak.
DATA:
i_vbak1 LIKE
TABLE OF
fs_vbak.
START-OF-SELECTION.
SELECT vbeln " Sales Document
FROM vbak
INTO TABLE i_vbak
WHERE vbeln IN s_vbeln.
DESCRIBE TABLE i_vbak LINES w_line.
DO w_line TIMES.
READ TABLE i_vbak INTO fs_vbak INDEX w_idx.
w_name = fs_vbak-vbeln.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = p_textid
language = sy-langu
name = w_name
object = 'VBBK'
TABLES
lines = i_tline
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7.
IF sy-subrc NE 0.
APPEND fs_vbak TO i_vbak1.
ENDIF.
w_idx = w_idx + 1.
ENDDO.
CLEAR fs_vbak.
LOOP AT i_vbak1 INTO fs_vbak.
WRITE: / fs_vbak-vbeln.
ENDLOOP.
Regards
Abhijeet