cancel
Showing results for 
Search instead for 
Did you mean: 

Copying text from SO to PO

Former Member
0 Kudos

Hello!

We have a third party scenario where, based on the item category, the Sales order triggers off the Purchase req. and the PO. Certain text in the sales order relating to special shipping instructions etc. as received from the customer needs to move to the PO to the vendor to enable the vendor to follow them per the customer requirements.

Is there any way to achieve this? I can't find anything in the copy controls...

Thanks, a lot.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In a sales order, you can enter purchase order texts for each third-party item. When you create the corresponding purchase order, the texts are automatically copied into the purchase order.

Hope this helps,

Thanks and Regards,

Jagadish.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

How the SO is created from PO.

You can use the function module READ_TEXT to read the text from SO and then use the function module SAVE_TEXT to save the text on PO.

Let's say you want to read the "item note" text from the line item of Saleaorder and save it to item text of PO

DATA: l_vbeln LIKE vbak-vbeln,
      l_posnr LIKE vbap-posnr,
      l_ebeln LIKE ekko-ebeln,
      l_ebelp LIKE ekpo-ebeln.
DATA: l_objname     LIKE thead-tdname,            "Object Name
      l_tobjname    LIKE thead-tdname.            "Target Object Name
DATA: lit_textline  LIKE tline OCCURS 0 WITH HEADER LINE.
DATA: lst_header    LIKE thead.                   "Target Text Header

* move SO number
  l_vbeln = "sales order numb"
* move line item number
  l_posnr = "line item number"

* get the object name of the text to be read
  CONCATENATE l_vbent l_posnr INTO l_objname.

*     Read text from sales order
      CALL FUNCTION 'READ_TEXT'
           EXPORTING
                client   = sy-mandt
                id       = '0002'
                language = sy-langu
                name     = l_objname  
                object   = 'VBBP'
           TABLES
                lines    = lit_textline.

* move PO number
  l_ebeln = "PO number
* move PO line item number
  l_ebelp = "PO line item number"

*  get the object name of the text to be write
   CONCATENATE l_ebeln l_ebelp INTO l_tobjname.

        lst_header-tdobject = 'EKPO'.
        lst_header-tdname   = l_tobjname.
        lst_header-tdid     = 'F01'.
        lst_header-tdspras  = sy-langu.

*       save text
        CALL FUNCTION 'SAVE_TEXT'
             EXPORTING
                  client          = sy-mandt
                  header          = lst_header
                  insert          = 'X'
                  savemode_direct = 'X'
             TABLES
                  lines           = lit_textline.

I hope this will help you. Let me know if you need any other information.

Regards,

RS