You are on page 1of 5

Copy PR Header Note Text to PO Header Text using Userexit

By Thangaraj Paulraj, HLL Lifecare Ltd


Introduction This document explains, how the PR Header Note text is copied to PO Header Text through User exit EXIT_SAPMM06E_012 Steps to be followed 1. Identify the user exit 2. Create PR with header note text 3. Build a logic to copy PR header note text to PO header text in the user exit 4. Create PO and save it, then the PR header note will be copied to PO header text STEP 1 Identifying the user exit Find the program name for transaction ME21N -> Program Name SAPLMEGUI ME21N -> System -> status -> Program Go to attribute for the program and get the Package SAPLMEGUI ->Goto ->Attributes ->Package

Go to Transaction CMOD -> Utilities -> SAP Enhancements

STEP 2 Create a Purchase Requisition with header Note text in ME51N transaction

Double Click on the text to get the text information

Click here to continue.. STEP 3 Build logic to copy the PR header note text to PO header text in Include ZXM06U43. There are two function modules used here

1.READ_TEXT -> Read the header note text from the PR 2.SAVE_TEXT -> Save the PR header note text to PO header text while saving the Purchase Order Source Code DATA : lt_tekpo TYPE TABLE OF bekpo, ls_tekpo TYPE bekpo, lt_lines TYPE TABLE OF tline, lv_tdname TYPE thead-tdname, ls_header TYPE thead. lt_tekpo[] = tekpo[]. LOOP AT lt_tekpo INTO ls_tekpo. lv_tdname = ls_tekpo-banfn. CALL FUNCTION 'READ_TEXT' EXPORTING client = sy-mandt id = 'B01' language = sy-langu name = lv_tdname object = 'EBANH' TABLES lines = lt_lines 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 <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ls_header-tdobject = 'EKKO'. ls_header-tdid = 'F01'. ls_header-tdspras = sy-langu. CALL FUNCTION 'SAVE_TEXT' EXPORTING client = sy-mandt header = ls_header insert = 'X' TABLES lines = lt_lines EXCEPTIONS id =1 language = 2

name = 3 object = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDLOOP. STEP 4 Create PO and save it through ME21N, then the PR header note text will be copied to PO header Text

Header text information for the Purchase order is

While calling the function module SAVE_TEXT, we have to specify the above data.

You might also like