Badi-purchase requisition header long text using Badi-me_process_req_cust.

Source: Internet
Author: User
* Create implementation for Badi using transaction code se19
  • Click on method-process_header
  • Check the process mode using the local class parameter trtyp
  • Populate the text only if trtyp is eqal to H (Creation)
  • Use the interface method if_longtexts_mm ~ Set_text of importing parameter im_header to create long text.
  • Use Text object ebanh, text ID B01 as parameters for above step.

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.