SAP APO_BAPI_MAP_RESOURCES Function Module for Resource: Mapping
APO_BAPI_MAP_RESOURCES is a standard apo bapi map resources SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Resource: Mapping processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for apo bapi map resources FM, simply by entering the name APO_BAPI_MAP_RESOURCES into the relevant SAP transaction such as SE37 or SE38.
Function Group: SCMB_BAPI_MD_MAPPING
Program Name: SAPLSCMB_BAPI_MD_MAPPING
Main Program: SAPLAPO_BAPI_GEN_PPDS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function APO_BAPI_MAP_RESOURCES pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'APO_BAPI_MAP_RESOURCES'"Resource: Mapping.
EXPORTING
* IV_EXT_RESNAME = "Externer Name der Ressource
* IV_EXT_CAT = "Resource category from external system
* IV_LOGQS = "Betriebswirtschaftlicher Systemverbund
* IV_RESID_22 = "Interner Schlüssel (UID) einer Ressource
* IV_RESID_32 = "Ressourcen GUID (Länge 32)
* IV_RESNAME = "Name der Ressource
* IV_NO_CREATE = "Auswahl einer Option (ja = 'X', nein = ' ')
* IT_RESID_22 = "Schittstellentabelle mit beliebigen GUIDs
* IV_RESDIMCHECK_FLG = "Auswahl einer Option (ja = 'X', nein = ' ')
* IV_SINGLERESCHECK_FLG = "Auswahl einer Option (ja = 'X', nein = ' ')
IMPORTING
ES_RES_MAP = "Ressource: Mapping
TABLES
* IT_MAP_INFO = "Ressource: Mapping
* IT_RESTYPE_RANGE = "Rangesstruktur für Ressourcentyp
* IT_RESNAME_INT = "Ressource: Schlüssel, intern
* IT_RESNAME_EXT = "Ressource: Schlüssel, extern
* IT_RES_MAP = "Ressource: Mapping
* ET_RETURN = "Returnparameter
* ET_RESMAP = "Umschlüsselung Ressource in UID
* ET_RESMAP_EXTENSION = "Ressource: Erweiterung zur Mappinginformation
* IT_MODEL_RANGE = "RANGES-Tabelle für Supply-Chain-Modellname
* IT_RES_RANGE = "Rangesstruktur für Ressourcenname
* IT_LOC_RANGE = "Ranges-Struktur für LOCNO
* IT_LOCTYPE_RANGE = "Ranges-Struktur für LOCTYPE
EXCEPTIONS
MAPPING_ERROR = 1
IMPORTING Parameters details for APO_BAPI_MAP_RESOURCES
IV_EXT_RESNAME - Externer Name der Ressource
Data type: /SAPAPO/CRES_NAMEOptional: Yes
Call by Reference: Yes
IV_EXT_CAT - Resource category from external system
Data type: /SCMB/CRES_EXT_CATEGORYOptional: Yes
Call by Reference: Yes
IV_LOGQS - Betriebswirtschaftlicher Systemverbund
Data type: /SAPAPO/LOGQSOptional: Yes
Call by Reference: Yes
IV_RESID_22 - Interner Schlüssel (UID) einer Ressource
Data type: /SAPAPO/RESUIDOptional: Yes
Call by Reference: Yes
IV_RESID_32 - Ressourcen GUID (Länge 32)
Data type: BAPI10004RESID_32Optional: Yes
Call by Reference: Yes
IV_RESNAME - Name der Ressource
Data type: /SAPAPO/CRES_NAMEOptional: Yes
Call by Reference: Yes
IV_NO_CREATE - Auswahl einer Option (ja = 'X', nein = ' ')
Data type: BAPIYESNOOptional: Yes
Call by Reference: Yes
IT_RESID_22 - Schittstellentabelle mit beliebigen GUIDs
Data type: BAPISCMBGUID22TABOptional: Yes
Call by Reference: Yes
IV_RESDIMCHECK_FLG - Auswahl einer Option (ja = 'X', nein = ' ')
Data type: BAPIYESNOOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_SINGLERESCHECK_FLG - Auswahl einer Option (ja = 'X', nein = ' ')
Data type: BAPIYESNOOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for APO_BAPI_MAP_RESOURCES
ES_RES_MAP - Ressource: Mapping
Data type: BAPI10004RESMAPOptional: No
Call by Reference: Yes
TABLES Parameters details for APO_BAPI_MAP_RESOURCES
IT_MAP_INFO - Ressource: Mapping
Data type: BAPI10004RESMAPOptional: Yes
Call by Reference: Yes
IT_RESTYPE_RANGE - Rangesstruktur für Ressourcentyp
Data type: BAPIRESTYPERANGEOptional: Yes
Call by Reference: Yes
IT_RESNAME_INT - Ressource: Schlüssel, intern
Data type: BAPI10004RESKEYINTOptional: Yes
Call by Reference: Yes
IT_RESNAME_EXT - Ressource: Schlüssel, extern
Data type: BAPI10004RESKEYEXTOptional: Yes
Call by Reference: Yes
IT_RES_MAP - Ressource: Mapping
Data type: /SAPAPO/CRES_RES_MAP_EXT_STRUOptional: Yes
Call by Reference: Yes
ET_RETURN - Returnparameter
Data type: BAPIRET2Optional: Yes
Call by Reference: Yes
ET_RESMAP - Umschlüsselung Ressource in UID
Data type: /SAPAPO/RESKEYOptional: Yes
Call by Reference: Yes
ET_RESMAP_EXTENSION - Ressource: Erweiterung zur Mappinginformation
Data type: BAPI10004RESMAPEXTENSIONOptional: Yes
Call by Reference: Yes
IT_MODEL_RANGE - RANGES-Tabelle für Supply-Chain-Modellname
Data type: BAPIMODELRANGEOptional: Yes
Call by Reference: Yes
IT_RES_RANGE - Rangesstruktur für Ressourcenname
Data type: BAPIRESRANGEOptional: Yes
Call by Reference: Yes
IT_LOC_RANGE - Ranges-Struktur für LOCNO
Data type: BAPILOCRANGEOptional: Yes
Call by Reference: Yes
IT_LOCTYPE_RANGE - Ranges-Struktur für LOCTYPE
Data type: BAPILOCTYPERANGEOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
MAPPING_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for APO_BAPI_MAP_RESOURCES Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_es_res_map | TYPE BAPI10004RESMAP, " | |||
| lt_it_map_info | TYPE STANDARD TABLE OF BAPI10004RESMAP, " | |||
| lv_mapping_error | TYPE BAPI10004RESMAP, " | |||
| lv_iv_ext_resname | TYPE /SAPAPO/CRES_NAME, " | |||
| lv_iv_ext_cat | TYPE /SCMB/CRES_EXT_CATEGORY, " | |||
| lt_it_restype_range | TYPE STANDARD TABLE OF BAPIRESTYPERANGE, " | |||
| lt_it_resname_int | TYPE STANDARD TABLE OF BAPI10004RESKEYINT, " | |||
| lt_it_resname_ext | TYPE STANDARD TABLE OF BAPI10004RESKEYEXT, " | |||
| lv_iv_logqs | TYPE /SAPAPO/LOGQS, " | |||
| lt_it_res_map | TYPE STANDARD TABLE OF /SAPAPO/CRES_RES_MAP_EXT_STRU, " | |||
| lt_et_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_iv_resid_22 | TYPE /SAPAPO/RESUID, " | |||
| lt_et_resmap | TYPE STANDARD TABLE OF /SAPAPO/RESKEY, " | |||
| lv_iv_resid_32 | TYPE BAPI10004RESID_32, " | |||
| lv_iv_resname | TYPE /SAPAPO/CRES_NAME, " | |||
| lt_et_resmap_extension | TYPE STANDARD TABLE OF BAPI10004RESMAPEXTENSION, " | |||
| lv_iv_no_create | TYPE BAPIYESNO, " | |||
| lt_it_model_range | TYPE STANDARD TABLE OF BAPIMODELRANGE, " | |||
| lv_it_resid_22 | TYPE BAPISCMBGUID22TAB, " | |||
| lt_it_res_range | TYPE STANDARD TABLE OF BAPIRESRANGE, " | |||
| lt_it_loc_range | TYPE STANDARD TABLE OF BAPILOCRANGE, " | |||
| lv_iv_resdimcheck_flg | TYPE BAPIYESNO, " | |||
| lt_it_loctype_range | TYPE STANDARD TABLE OF BAPILOCTYPERANGE, " | |||
| lv_iv_singlerescheck_flg | TYPE BAPIYESNO. " |
|   CALL FUNCTION 'APO_BAPI_MAP_RESOURCES' "Resource: Mapping |
| EXPORTING | ||
| IV_EXT_RESNAME | = lv_iv_ext_resname | |
| IV_EXT_CAT | = lv_iv_ext_cat | |
| IV_LOGQS | = lv_iv_logqs | |
| IV_RESID_22 | = lv_iv_resid_22 | |
| IV_RESID_32 | = lv_iv_resid_32 | |
| IV_RESNAME | = lv_iv_resname | |
| IV_NO_CREATE | = lv_iv_no_create | |
| IT_RESID_22 | = lv_it_resid_22 | |
| IV_RESDIMCHECK_FLG | = lv_iv_resdimcheck_flg | |
| IV_SINGLERESCHECK_FLG | = lv_iv_singlerescheck_flg | |
| IMPORTING | ||
| ES_RES_MAP | = lv_es_res_map | |
| TABLES | ||
| IT_MAP_INFO | = lt_it_map_info | |
| IT_RESTYPE_RANGE | = lt_it_restype_range | |
| IT_RESNAME_INT | = lt_it_resname_int | |
| IT_RESNAME_EXT | = lt_it_resname_ext | |
| IT_RES_MAP | = lt_it_res_map | |
| ET_RETURN | = lt_et_return | |
| ET_RESMAP | = lt_et_resmap | |
| ET_RESMAP_EXTENSION | = lt_et_resmap_extension | |
| IT_MODEL_RANGE | = lt_it_model_range | |
| IT_RES_RANGE | = lt_it_res_range | |
| IT_LOC_RANGE | = lt_it_loc_range | |
| IT_LOCTYPE_RANGE | = lt_it_loctype_range | |
| EXCEPTIONS | ||
| MAPPING_ERROR = 1 | ||
| . " APO_BAPI_MAP_RESOURCES | ||
ABAP code using 7.40 inline data declarations to call FM APO_BAPI_MAP_RESOURCES
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.Search for further information about these or an SAP related objects