* Create implementation for Badi using transaction code se19
Purchase Requisition Screen
Sample Code
Method if_ex_me_process_req_cust ~ Process_header.
* Set purchase requisition text
* Text object: ebanh (customer order header texts)
* Text ID: B01 (header note)
Data: lt_textlines type matrix,
Ls_textlines type.
Data: lv_obj type ref to object,
Lv_attr type string,
Lv_trtyp type trtyp.
Field-Symbols: <fs_lcl> type any.
** Get transaction state 'H'-New **
Lv_obj? = Im_header.
Move 'my _ state-> trtyp' to lv_attr.
Assign lv_obj-> (lv_attr) to <fs_lcl>.
Lv_trtyp = <fs_lcl>.
If lv_trtyp EQ 'H'. "New Purchase Requisition"
Refresh: lt_textlines.
Clear: ls_textlines.
Move 'ebanh 'to ls_textlines-tdobject.
Move 'b01 'to ls_textlines-tdid.
Move '*' to ls_textlines-tdformat.
Move 'test header note-line 1' to ls_textlines-tdline.
Append ls_textlines to lt_textlines.
Move 'ebanh 'to ls_textlines-tdobject.
Move 'b01 'to ls_textlines-tdid.
Move '*' to ls_textlines-tdformat.
Move 'test header note-line 2' to ls_textlines-tdline.
Append ls_textlines to lt_textlines.
* Call method to update header text **
* Im_count is be checked, otherwise this method will be
* Called again after calling below method.
If im_count LE 1.
Call method im_header-> if_longtexts_mm ~ Set_text (
Exporting
Im_tdid = 'b01'
Im_textlines = lt_textlines ).
Endif.
Endif.
Endmethod.
Source link: http://wiki.sdn.sap.com/wiki/display/stage/Purchase+Req.+Header+Long+Text+using+Badi+-+ME_PROCESS_REQ_CUST