Purchase Order Document Type Determination – Quick Reference Cheat Sheet

Fast lookup for EKKO‑BSART logic across classic transactions, Fiori apps, and BAPI processing.
 
SAP MM BSART T160 / T161A / T161W ME21N / ME59N / MD04 / ME57 / ME58 

Fiori F0842A / F1048 BAPI_PO_CREATE1
 

Table of Contents
  • 1. Key Customizing Tables
  • 2. ME21N
  • 3. ME57 (ALV)
  • 4. ME57 (Non‑ALV)
  • 5. MD04
  • 6. ME59
  • 7. BAPI_PO_CREATE1
  • 8. Fiori Applications
  • 9. ME58

1. Key Customizing Tables

 
Table Purpose
T161A Allowed PO Document Types
T160 Default Document Types per Transaction Code
T161W STO Settings (Doc Type, One‑Step, Underdelivery)
ESDUS User Personal Defaults (e.g., BSART)
Tip: Check authorization object M_BEST_BSA (ACTVT = 01) if a proposed BSART does not appear in the dropdown. 

2. ME21N

Default Proposal Order

  1. Last‑used BSART
  2. T160 default for ME21N (fallback ME21)
  3. First entry in T161
Validated by authorization M_BEST_BSA.

Overwrites

  • User defaults via ESDUS (action PurchaseOrder, setting POHeaderProposer → BSART)
  • BAdI MEPOBADI_OPEN

Header Logic

  • MEPO_HEADER_FILL_BSART → checks T160 then T161 by BSTYP
  • Dropdown is built from MEPO_TOPLINE‑BSART
Debug paths include: LMEGUICJI → OPEN, LMEPOF11 → MEPO_DEFAULT_TOPLINE, LMEPOF00 → MEPO_HEADER_READ_BSART

3. ME57 (ALV)

STO PRs

PO doc type from T161W.

Other PRs – T161A Matching Priority

  1. Exact match: PR doc type + PR item cat (and compatible PO doc type + PO item cat)
  2. If only one allowed combination exists → take it
  3. Match by PR item category
  4. Match by PR document type
  5. Default from T160 (ME21)
  6. Any compatible BSART
Enhancement: BAdI ME_BSART_DET (not processed for STO).

4. ME57 (Non‑ALV)

  1. T160 default for ME57
  2. T160 default for ME21N/ME21
  3. Fallback to PR document type

5. MD04

STO PRs

PO doc type from T161W.

Other PRs – Selection Order via T161A

  1. Exact match (doc type + item category)
  2. Item category match
  3. Document type match
  4. Default from T160
  5. Any valid type
Debug: ME_PROCESS_REQUISITIONS → LMESHOWF01 → FORM bsart_best

6. ME59N

FM: MM_PROPOSE_DOC_TYPE
  1. Read allowed types from T161A
  2. Check BAdI ME_BSART_DET
  3. Try to match PR document type
  4. If PR type allowed → select it
  5. If PR type not allowed → use T160 default
  6. If no default → first allowed BSART
See also: KBA 3108114 (Default doc type not used when creating PO via ME59N). 

7. BAPI_PO_CREATE1

Mapping

BAPIMEPOHEADER‑DOC_TYPE → MEPOHEADER‑BSART via MAP2I_BAPIHEADER_TO_HEADER.

Processing

  • Uses ME21N logic: LMEPOF00 → MEPO_HEADER_FILL_BSART
  • MEPO_HEADER_READ_BSART reads T161

8. Fiori Applications

A) Process Purchase Requisitions (F1048)

  • Determination in CL_MM_PUR_PR_PROCESS_API → IF_MM_PUR_PR_FOD_PO~CREATE_PO_DRAFT
  • Calls MM_PROPOSE_DOC_TYPE (first item)

B) Manage Purchase Orders (F0842A)

  • Lightweight / restricted
  • Shows only PO types: 
    • Copied from NB
    • Field selection key = NBF
Need wider creation options? Use Create Purchase Order Advanced (WebGUI for ME21N). 

9. ME58

Default Proposal Sequence

  1. T160 → ME58
  2. T160 → ME21N
  3. T160 → ME21
  4. Fallback: PR document type
Debug: FM06BF05_GENERIEREN_BESTELLUNG → FORM GENERIEREN_BESTELLUNG

No BAdI available. Consider ME59N with BAdI ME_BSART_DET for enhancements. 
 

Quick Reference – PO Doc Type Determination (BSART). Optimized for screen & print. 

SAP MM Tips

 


See also
Purchasing Customizing

Get help for your SAP MM problems
SAP MM Forums - Do you have a SAP MM Question?

SAP MM Books
SAP Material Management Certification, Interview and Configuration Reference Books

SAP Material Management Tips
SAP MM Configuration Tips and Materials Management

Main Index
SAP ERP Modules, Basis, ABAP and Other IMG Stuff

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.