2013 May 23 2:45 AM
Hi Experts,
I am print previewing ME23N. In that it has 2 columns 1) Shipping Address and 2) Ship to:.
1) Shipping Address : it has to fetch the text data from Item text's Shipping Instructions data.
2) Ship to: It has to fetch text data from Item text's Vendor instructions data.
So I am using FM : Select_Text: And my problem is For Ship to Column it is printing the Item text's Vendor Instructions data plus Shipping Instructions data.
I am coding like this:
TYPES: BEGIN OF TY_TEXT.
INCLUDE STRUCTURE THEAD.
TYPES: TDTEXT LIKE TTXIT-TDTEXT,
END OF TY_TEXT.
DATA: ls_t166p TYPE t166p.
DATA: ls_text TYPE ty_text.
DATA: lt_texts TYPE TABLE OF ty_text.
ls_text-tdobject = 'EKPO'.
ls_text-tdspras = gv_language.
ls_text-tdname = <fs>-ebeln.
ls_text-tdname+10(5) = <fs>-ebelp.
CLEAR gt_itm_texts.
CALL FUNCTION 'SELECT_TEXT'
EXPORTING
object = ls_text-tdobject
name = ls_text-tdname
id = '*'
language = ls_text-tdspras
TABLES
selections = lt_texts.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SORT lt_texts BY tdid.
* append texts allowed to GT_ITM_TEXTS
* Item Text Part
CLEAR ls_text.
LOOP AT lt_texts INTO ls_text.
SELECT SINGLE * FROM t166p INTO ls_t166p
WHERE druvo = iv_druvo AND
bstyp = is_ekko-bstyp AND
bsart = is_ekko-bsart AND
pstyp = <fs>-pstyp AND
tdid = ls_text-tdid.
IF sy-subrc = 0.
APPEND ls_text TO gt_itm_texts.
ENDIF.
CLEAR ls_text.
ENDLOOP.
Please help me
2013 May 23 5:41 AM
I think You Need to Pass the TEXT ID in the functional Module which is '*' Now. you can Find the TEXT ID for your section i.e Text Item by double click on Selection and then go to -> Header.
Hope It can help you.
Thanks
2013 May 23 7:38 AM
hi vinod,
as I understand your problem you are fetching more data than required and its overlapping your scenario.. Your query is still vague ..
can you check Function modlue READ_TEXT to clearly differentiate your text for ship to , vendor instructions or some other into separate internal tables and then use it properly. You need to check for header and item separately here..
The way you are handling logic to fetch text's is not good enough .
br,
Vijay
2013 May 23 7:42 AM
Hi Use READ_TEXT Function MOdule. Hope it will solve your Problem. Regards, PRudhvi Choudary.
2013 May 23 8:13 AM
Hi vinod,
Please find my screen shot for your yesterday question
in that screen shot , how you find all text id's in se75 transaction
and please read guiseppe comments more than one time...
Still you not getting any clue means,
GO to SE37 - give the function module name READ_TEXT and click utilities -> where used list- here u can find other programs using that FM.
Cheers
Kannan
Message was edited by: kannan bhavish
2013 May 23 9:20 AM
Hi,
You can separate the messages based on TDID.
I could see that A06,F06,K06,L06 can be used for Shipping Instructions. Check which one you need use.
Similarly check for the required one for Vendor Instructions.
Thanks and Regards,
Sriranjani Chimakurthy.
2013 May 23 10:01 AM
Hi,
If you have a requirement to read text from certain node, then you can use 'READ_TEXT' FM.
* Get the vehicle full description from Read text FM
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = """""" you need to check this in SE75 (A01 / A03 / A4 / AA2 / F01..etc)
language = ls_text-tdspras
name = ls_text-tdname
object = ls_text-tdobject
TABLES
lines = lt_texts
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
hope this will solve your query.