‎2007 Apr 12 12:45 PM
hi
<b>i want all matnr , maktx and long description for each and every material no
but in my output in read text functionnal module its passing only one matnr so
only for one material no long text is coming even though another matnr also having material long descrtiption</b>.
check below code
Form Get_Data.
SELECT AMATNR AWERKS B~MAKTX FROM
EKPO AS A
INNER JOIN MAKT AS B ON BMATNR = AMATNR
INTO CORRESPONDING
FIELDS OF TABLE INT_OUT WHERE A~WERKS IN S_WERKS.
sort int_OUT by WERKS.
LOOP AT INT_OUT.
thread-tdname = INT_OUT-MATNR.
ENDLOOP.
thread-tdid = 'BEST'.
thread-tdobject = 'MATERIAL'.
*
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = thread-tdid
LANGUAGE = sy-langu
NAME = thread-tdname
OBJECT = thread-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_tlines.
LOOP AT it_tlines.
read table INT_OUT with key matnr = INT_OUT-MATNR.
IF sy-tabix <> 1.
CLEAR :int_out-matnr, int_out-maktx.
ENDIF.
int_out-tdline = it_tlines-tdline.
delete adjacent duplicates from INT_OUT .
APPEND int_out.
modify INT_OUT index sy-tabix.
ENDLOOP.
suggest me please.
thanks
‎2007 Apr 12 12:52 PM
<b>LOOP AT it_tlines.
read table INT_OUT with key matnr = INT_OUT-MATNR.</b>
what is this ? check this statement , and one more thing , it_tlines will not any ant matnr.u have to pass complete object number.
Regards
Prabhu
‎2007 Apr 12 12:52 PM
Hi,
use the code:
LOOP AT INT_OUT.
thread-tdname = INT_OUT-MATNR.
ENDLOOP.
thread-tdid = 'BEST'.
thread-tdobject = 'MATERIAL'.
*
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = thread-tdid
LANGUAGE = sy-langu
NAME = thread-tdname
OBJECT = thread-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_tlines.
<b>clear it_lines.
read table it_lines index 1. (Only 1st line of text will come)
IF sy-tabix = 0.
int_out-tdline = it_tlines-tdline.
endif.</b>modify INT_OUT index sy-tabix.
ENDLOOP.
to get more lines of long text fetch them into different variables and pass that to int_out-tdline.
in the above only one line of text is passed into table.
reward points if useful
regards,
ANJI
‎2007 Apr 12 1:08 PM
now long text not coming for single material no .
suggest me man.
thanks
‎2007 Apr 12 1:21 PM
‎2007 Apr 12 12:57 PM
Hi,
write ur FM in loop and insted of thread-tdname, give the variable for matnr
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = thread-tdid
LANGUAGE = sy-langu
<b>NAME = thread-tdname</b>
<b>NAME = matnr</b>
OBJECT = thread-tdobject
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
TABLES
LINES = it_tlines.
hope it works.
Regards,
Sonika