Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the texts of the purchase orders?

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Hi,

use FM..

<b>READ_TEXT</b>

regards

vijay

6 REPLIES 6

former_member188685
Active Contributor
0 Kudos

Hi,

use FM..

<b>READ_TEXT</b>

regards

vijay

0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

check these tables

T166K "Header Texts in Purchasing Document Printouts

T166A "Supplement Text in Purchasing Document Printouts

Regards

vijay

0 Kudos

Thanks Rich,

it was exactly what I was needing.

Thanks. Problem Solved.

0 Kudos

Vijay Thanks for the attention and quickness in replying.