BAPI Part 6: Mapping Header, Item, Partner and Schedule Data
Preview · a free account unlocks the full lesson
Map external data into complex BAPI structures: header/item/partner/schedule/condition tables, item number consistency, partner roles and conversions, units and currencies, date formats, change BAPIs with UPDATEFLAG (I/U/D), and a reusable mapping layer.
In this lessonShow sectionsHide sections
Visual overview
Explanation
Part 2 created an order with a minimal structure. Real interfaces bring many items, partners, schedules and prices, and this part covers mapping all of that consistently into BAPI structures.
Complex BAPIs link their various tables together by keys. Complex BAPIs link tables by keys: item number (ITM_NUMBER) connects items, schedules, conditions and X structures. So ORDER_ITEMS_IN with ITM_NUMBER '000010' must match ORDER_SCHEDULES_IN-ITM_NUMBER and ORDER_CONDITIONS_IN-ITM_NUMBER for the same line. The X structures repeat these same keys (ITM_NUMBER, SCHED_LINE) alongside their flags. Header-level partners use ITM_NUMBER '000000', while item-level partners carry the actual item number.
Partner data has its own conventions. Internally, partner functions are coded as AG (sold-to), WE (ship-to), RE (bill-to) and RG (payer), though an English logon often displays them as SP, SH, BP and PY — CONVERSION_EXIT_PARVW_INPUT converts between the two. Partner numbers also need their leading zeros applied through the standard ALPHA conversion.
Units, currencies and amounts each need their own internal format. Units go through CONVERSION_EXIT_CUNIT_INPUT, which converts an external unit like 'PC' into its internal form, such as 'ST', with the mapping depending on language. Values must be in internal format: ALPHA-converted numbers, internal units (CUNIT), partner functions (AG/WE), currency amounts with the right decimals.
Amounts passed into BAPIs are usually in external format (BAPICURR); where a conversion between internal and external amount format is actually needed, BAPI_CURRENCY_CONV_TO_EXTERNAL and BAPI_CURRENCY_CONV_TO_INTERNAL handle currencies like JPY that have no decimal places. Dates are passed as YYYYMMDD in DATS fields.
Create a free account to keep reading
You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.
- Full explanation
- Code example
- Real project scenario
- Common mistakes
- Best practices
- Interview angle
One tap with Google works too. Every topic keeps its first lesson open to everyone.
Keep exploring
Interview questions on this topic
Related SAP topics
Referenced SAP objects
Reviewed reference pages for the objects this page mentions.
Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.