MM
BAPI
RFC
Used the same way in S/4HANA
BAPI_SAG_GETDETAIL Get Scheduling Agreement Details
Reads the header, items, account assignments, conditions, partners, texts, delivery schedules and subcontracting components of a scheduling agreement. Developers use it in agreement reports, in interfaces that send data to supplier portals and to read current data before calling BAPI_SAG_CHANGE. Set the blocks you need to 'X' with flags such as ITEM_DATA, CONDITION_DATA and SCHEDULE_DATA; tables that are not flagged come back empty.
- Function group
- 2013
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| PURCHASINGDOCUMENT | BAPIMEOUTHEADER-NUMBER | Scheduling agreement number | Yes |
| ITEM_DATA | BAPIFLAG-BAPIFLAG | Return item data | — |
| ACCOUNT_DATA | BAPIFLAG-BAPIFLAG | Return account assignments | — |
| CONDITION_DATA | BAPIFLAG-BAPIFLAG | Return conditions | — |
| TEXT_DATA | BAPIFLAG-BAPIFLAG | Return texts | — |
| PARTNER_DATA | BAPIFLAG-BAPIFLAG | Return partners | — |
| SCHEDULE_DATA | BAPIFLAG-BAPIFLAG | Return delivery schedule | — |
| SC_COMPONENT_DATA | BAPIFLAG-BAPIFLAG | Return subcontracting components | — |
| SHIPPING_DATA | BAPIFLAG-BAPIFLAG | Return shipping data | — |
| EXPORT_DATA | BAPIFLAG-BAPIFLAG | Return foreign trade data | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| HEADER | BAPIMEOUTHEADER | Header data |
| HEAD_EXPORT_IMPORT | BAPIMEOUTEIKP | Header foreign trade data |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| ITEM | BAPIMEOUTITEM | Item data | — |
| ACCOUNT | BAPIMEOUTACCOUNT | Account assignments | — |
| HEAD_CONDITION | BAPIMEOUTHEADERCOND | Header conditions | — |
| ITEM_COND_VALIDITY | BAPIMEOUTVALIDITY | Item condition validity periods | — |
| ITEM_CONDITION | BAPIMEOUTCONDITION | Item conditions | — |
| ITEM_COND_SCALE_QUAN | BAPIMEOUTITEMSCALEQUAN | Item condition quantity scales | — |
| PARTNER | BAPIMEOUTPARTNER | Partners | — |
| SCHEDULE | BAPIMEOUTSCHEDULE | Delivery schedule lines | — |
| SC_COMPONENT | BAPIMEOUTCOMPONENT | Subcontracting components | — |
| HEADER_TEXT | BAPIMEOUTTEXT | Header texts | — |
| ITEM_TEXT | BAPIMEOUTITEMTEXT | Item texts | — |
| DELIVERY_ADDRESS | BAPIMEOUTADDRDELIVERY | Delivery addresses | — |
| EXTENSIONOUT | BAPIPAREX | Customer extension fields (output) | — |
| RETURN | BAPIRET2 | Return messages | — |
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'BAPI_SAG_GETDETAIL'
EXPORTING
purchasingdocument = lv_purchasingdocument
IMPORTING
header = lv_header
head_export_import = lv_head_export_import
TABLES
item = lt_item
account = lt_account
head_condition = lt_head_condition
item_cond_validity = lt_item_cond_validity
item_condition = lt_item_condition
item_cond_scale_quan = lt_item_cond_scale_quan
partner = lt_partner
schedule = lt_schedule
sc_component = lt_sc_component
header_text = lt_header_text.Related tables
Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.