10-28-2008 3:51 PM
Hi all,
Please help me, I was able to develop a program that using READ_TEXT function module to read the Production Order long text.
Now my requirement is to read the text in the Production memo tabe of production order.
Can some one tell mee how to do it? the same program is now not working.
do i need to do any changes?
10-28-2008 4:04 PM
the text ID and Text_object and other things you pass into the FM read_text need to be changed..
10-28-2008 4:54 PM
Jay, Thanks for your reply,
How to check the Text Object and Text ID for Text in Production Memo tab of Production order.
I did check in the TTXOB, TTXID tables for relevant text id's and text objects and also in tha tables STXH and STXL tables.
I am using object id as AUFK and Text ID as KOPF, but that is not working with me.
Can you tell me what is the text id, object id that i should use to read the text in Production Memo tab of production order.
Regards,
Jessica
10-28-2008 5:03 PM
Hi,
Goto the Production Memo tab of Production order, double click the text in the text editor. A SAP script window pop up, in that in the Menu Goto-> Header. You can find Text Name Text ID and Text Object.
10-28-2008 5:31 PM
Hey Anil,
Thanks for your reply, i tried doing what you said(double click the text in the text editor. A SAP script window pop up, in that in the Menu Goto-> Header. You can find Text Name Text ID and Text Object.),
but if i go to the production memo tab and double click on that the Production Memo text no pop up is comming?
How should i check the text id and object for the text in production memo tab of production order?
Regards,
Jessica
10-28-2008 5:43 PM
One other alternative to find TEXT ID and TEXT OBJECT is to use ST05. Activate the trace in QA, Ediit one Order which has a text. Display the trace, you should find the values of the id and object.
10-28-2008 5:56 PM
Hi,
1) Is the production order memo tab a custome tab?
2) Do you have a paper and a pencil icon next to the order number? If yes is your text available when you click that?
10-28-2008 6:13 PM
No, i dont see pen and pencil icon;s there.
Actually in the Sales order line item, if we double click on material and go to texts tab, then we can see the Sales note, delivery note, shipping note, and production memo.
If i enter some text in this production memo in sales order that is getting replicated to Production memo tab of production order and i need to read this text in production memo tab of production order.
Since i am unable to do it, i tried using the READ_TEXT function module to extract the data in Sales order , production note tab with following code and it is working fine.
But the problem is i have hard coded the NAME here seeing the entry in STXH table. now i dont know what to use in place of NAME in read_text Function module. if i try using sales document number it is showing an error.
Am i missing something
this my code
data: xaufk type aufk.
data: l_name type thead-tdname.
data: ilines type table of tline with header line.
DATA: XKDAUF type afpo-kdauf.
parameters: p_aufnr type aufk-aufnr.
SELECT kdauf INTO xkdauf FROM AFPO where aufnr = p_aufnr.
ENDSELECT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = '0006'
LANGUAGE = SY-LANGU
NAME = '0000000221000010'
OBJECT = 'VBBP'
TABLES
LINES = ilines
.
LOOP AT ILINES.
WRITE: ILINES-TDLINE.
ENDLOOP.
here i hard coded the NAME = '0000000221000010' by seeing the entries in STXH table.
now to see the text for any sales order i should put something in place of NAME, what could that be?
10-28-2008 6:19 PM
You have to concatenate the document number and the item to obtain the Name.
10-28-2008 6:23 PM
i added this to my code
concatenate xkdauf posnr into l_name.
still i get an error saying the text doesnot exist
Can u post the code to concatenate the Sales order number and posnr to make use of in NAME
10-28-2008 6:35 PM
Hi,
If it is a sales order text.
Concatenate sales order number and position.
Table : STXH
TDOBJECT : VBBK ( For Header Text) VBBP ( For Item Text)
TDNAME : sales order + Item ( With Leading Zero's)
TDID : Check from Menu header or STXH table entries
TDSPRAS : Sy-langu
If it is a Production order text.
Concatenate client number and production order.
Table : STXH
TDOBJECT : AUFK
TDNAME : client number+ production order ( With Leading Zero's)
TDID : KOPF
TDSPRAS : Sy-langu
Edited by: senthil kumar on Oct 29, 2008 12:07 AM
10-28-2008 5:15 PM
Hi,
TDOBJECT --> AUFK
TDID -->KOPF
IF your given same means it's correct i think check your coding
i will give u sample coding analyze .
REPORT z_test1.
TABLES:
thead.
PARAMETERS:
p_vbeln TYPE vbak-vbeln.
PARAMETERS:
p_textid TYPE thead-tdid.
DATA:
BEGIN OF t_thead OCCURS 0.
INCLUDE STRUCTURE thead.
DATA:
END OF t_thead.
DATA:
w_line TYPE i,
w_idx TYPE i,
w_flag TYPE i.
DATA:
BEGIN OF t_tline OCCURS 0.
INCLUDE STRUCTURE tline.
DATA:
END OF t_tline.
DATA:
w_test TYPE thead-tdname,
w_temp TYPE string VALUE 'TEST'.
START-OF-SELECTION.
w_test = p_vbeln.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = p_textid
language = sy-langu
name = w_test
object = 'VBBK'
TABLES
lines = t_tline
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 NE 0.
MESSAGE 'HEADER TEXT NOT FOUND' TYPE 'I'.
ENDIF.
END-OF-SELECTION.
LOOP AT t_tline.
IF t_tline-tdline = w_temp.
w_flag = 1.
ENDIF.
ENDLOOP.
IF w_flag NE 1.
t_tline-tdline = w_temp.
APPEND t_tline.
ENDIF.
REFRESH t_thead.
t_thead-tdobject = 'VBBK'.
t_thead-tdname = w_test.
t_thead-tdid = p_textid.
t_thead-tdspras = sy-langu.
APPEND t_thead.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = t_thead
savemode_direct = 'X'
TABLES
lines = t_tline
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4.
IF sy-subrc NE 0.
WRITE: / 'ERROR'.
ELSE.
COMMIT WORK.
WRITE: / 'TEXT SAVED'.
ENDIF.
LOOP AT t_tline.
WRITE: / t_tline-tdline.
ENDLOOP.
Regards
swamy
10-28-2008 6:45 PM
concatenate xkdauf kdpos into l_name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = '0006'
LANGUAGE = SY-LANGU
NAME = l_NAME
OBJECT = 'VBBK'
10-29-2008 2:17 PM
Thanks to Sethil, Swamy, Aparna and all people who helped me resolve the issue, finally i was able to read the text from production memo of sales order