01-09-2006 5:21 PM
Hi guys,
On the transaction ME22N, I'm trying to catch and save in a structure the texts from the items of a purchase order that are presented on the item detail section.
Does it exist any BAPI or any way to access this data?
I've tried the BAPI_PO_GETITEMS, but i'm not able to get those texts...
Do you have any ideas, or did anyone came across this problem?
Thanks in advance
01-09-2006 5:25 PM
01-09-2006 5:25 PM
01-09-2006 5:30 PM
As Vijay has suggested, use READ_TEXT. You will need to find out the object/id of the text that you want to get. For PO items, there is an object called EKPO, under that object, you have the following IDs.
A01 Item text
A03 Material PO text
A4 Additional text for item
F01 Item text
F02 Info record PO text
F03 Material PO text
F04 Delivery text
F05 Info record note
K01 Item text
K02 Info record PO text
K03 Material PO text
K04 Delivery text
K05 Info record note
L01 Item text
L02 Info record PO text
L03 Material PO text
L04 Delivery text
L05 Info record note
You will need to pass these values to the READ_TEXT function module along with the NAME which in this case will probably be a concatenation of purchase order number and item number. You can check this by looking at the STXH table for the particular object/id. The name field will be there and you can see how it is built.
Regards,
Rich Heilman
01-09-2006 5:37 PM
Here is a sample program, enter your purchase order and item on the selection screen and hit execute.
report zrich_0001.
data: textlines type table of tline with header line.
data: name type THEAD-TDNAME.
parameters: p_ebeln type ekko-ebeln,
p_ebelp type ekpo-ebelp.
concatenate p_ebeln p_ebelp into name.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'F01' " Item Text "
LANGUAGE = sy-langu
NAME = name
OBJECT = 'EKPO'
TABLES
LINES = textlines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
loop at textlines.
write:/ textlines-TDLINE.
endloop.
Regards,
RIch Heilman
01-09-2006 5:38 PM
Hi,
check these tables
T166K "Header Texts in Purchasing Document Printouts
T166A "Supplement Text in Purchasing Document Printouts
Regards
vijay
01-09-2006 6:29 PM
Thanks Rich,
it was exactly what I was needing.
Thanks. Problem Solved.
01-09-2006 6:32 PM