Skip to Content
Author's profile photo Kapil Changrani

Vendor Material Number / Supplier Material Default in Purchase Requisition

Problem Description
While Creating Purchase Requisition in ME51n, Purchase Info Record number gets populated automatically, however supplier material is not assigned even though its maintained in the Purchase Info Record.

See below supplier material number is maintained in Info Record.

Solution
Implement BADI – ME_PROCESS_REQ_CUST
Method PROCESS_ITEM

  METHOD if_ex_me_process_req_cust~process_item.
    DATA: l_preq   TYPE mereq_item,
          lv_idnlf TYPE idnlf.

    CALL METHOD im_item->get_data
      RECEIVING
        re_data = l_preq.

    IF ( l_preq-infnr IS NOT INITIAL ) AND ( l_preq-idnlf IS INITIAL ) . " if info record is found.
      " Add idnlf from purchase info record

      SELECT SINGLE idnlf INTO l_preq-idnlf  FROM eina
        WHERE infnr = l_preq-infnr .
      IF sy-subrc = 0.
        CALL METHOD im_item->set_data
          EXPORTING
            im_data = l_preq.
      ENDIF.
    ENDIF.
  ENDMETHOD.

Above  method will fetch supplier material from Purchase Info Record to Purchase Requisition.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Ankit Vohra
      Ankit Vohra

      Thanks for the insights. Very helpful.

      Does anyone know whether this BAdI is available for S/4HANA Public Cloud as well?

       

      Thanks in advance!