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: 

User-Exit to include Plant specific text at the Header level of PO ?

Former Member
0 Kudos

User-exit for including plant specific text at the Delivery text tab at the Header level of Purchase Orders.This update is required to take place when the plant is entered on the PO line item while creating PO using ME21N.

2 REPLIES 2

Former Member
0 Kudos

Hi,

You can use ME_PROCESS_PO_CUST BADI to meet this requirement. In this you can use PROCESS_ITEM method. From here you can access header data using GET_HEADER. In side the the header interface you have a method to update the text that is IF_LONGTEXTS_MM~SET_TEXT.

rajkumar abbu

Former Member
0 Kudos

Hello Vtest,

This is how u do...

In user exit EXIT_SAPMM06E_004.

data: begin of th_head occurs 0.

include structure thead.

data: end of th_head.

data: begin of th_line occurs 0.

include structure tline.

data: end of th_line..

clear: th_head, th_line.

refresh: th_head, th_line.

th_head-tdobject = 'EKKO'.

th_head-tdid = 'F14'.

th_head-tdspras = sy-langu .

append th_head.

th_line = '*'.

th_line = 'this is first line'.

append th_line.

clear th_line.

th_line = '*'.

th_line = 'this is second line'.

append th_line.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

HEADER = th_head

  • INSERT = ' '

  • SAVEMODE_DIRECT = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • FUNCTION =

  • NEWHEADER =

TABLES

LINES = th_line

  • 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.

this should work for you.