SAP BAPI_DANGEROUSGOOD_GETDETAIL Function Module for EHS: Read Dang.Good
BAPI_DANGEROUSGOOD_GETDETAIL is a standard bapi dangerousgood getdetail SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for EHS: Read Dang.Good 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 bapi dangerousgood getdetail FM, simply by entering the name BAPI_DANGEROUSGOOD_GETDETAIL into the relevant SAP transaction such as SE37 or SE38.
Function Group: 1078
Program Name: SAPL1078
Main Program: SAPL1078
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:
Function BAPI_DANGEROUSGOOD_GETDETAIL 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 'BAPI_DANGEROUSGOOD_GETDETAIL'"EHS: Read Dang.Good.
EXPORTING
* KEY_DATE = SY-DATUM "Key Date
* FLG_READ_CARR = "Indicator: Read Table CCDUTCARR
* FLG_READ_DGREL = "Indicator: Read Table CCDUTDGREL
* FLG_READ_ACTIVE_ONLY = 'X' "Only Read Active DG Master Records
* FLG_READ_UNDELETED_ONLY = 'X' "Only Read DG Master Records That Are Not Marked for Deletion
* FLG_RETURN_WHOLE_INTERVAL = "Read Whole Time Interval From Key Date
* FLG_READ_HEADER = 'X' "Indicator: Read DGMTD/DGTM2 Tables
* FLG_READ_PACK_OLD = "Indicator: Read DGTPK Table
* FLG_READ_PACK = "Indicator: Read Table CCDUTPACK
* FLG_READ_SPROV = "Indicator: Read Table CCDUTSPROV
* FLG_READ_TRAPPR = "Indicator: Read Table CCDUTTRAPPR
IMPORTING
FLG_ABORT_ON_ERROR = "Cancel Processing
TABLES
RETURN = "Error Messages
* PROV_CARRIAGE = "Provisions for Carriage
* PRODUCT_RELEASE = "Product Release
* EXTENSION_OUT = "Export customer enhancements
* LOGKEY_TAB = "Logical Key for Selection Using Dangerous Goods Data
* MATERIAL_TAB = "Material for Selection Using Dangerous Goods Data
* REGULATION_TAB = "Dangerous Goods Regulation for Selection Using Dangerous Goods Data
* DANGEROUSGOODDATA = "Dangerous Goods Master (Header)
* DANGEROUSGOODPACK = "Dangerous Goods Packing Requirement
* PACK_REQUIREMENT = "Dangerous Goods Packaging Requirements (New)
* SPEC_PACK_PROV = "Special Packing Provisions
* TRANSP_APPROVAL = "Transport Restrictions
IMPORTING Parameters details for BAPI_DANGEROUSGOOD_GETDETAIL
KEY_DATE - Key Date
Data type: RCGADDINF-VALDATDefault: SY-DATUM
Optional: No
Call by Reference: No ( called with pass by value option)
FLG_READ_CARR - Indicator: Read Table CCDUTCARR
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_DGREL - Indicator: Read Table CCDUTDGREL
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_ACTIVE_ONLY - Only Read Active DG Master Records
Data type: BAPISTDTYP-BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_UNDELETED_ONLY - Only Read DG Master Records That Are Not Marked for Deletion
Data type: BAPISTDTYP-BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_RETURN_WHOLE_INTERVAL - Read Whole Time Interval From Key Date
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_HEADER - Indicator: Read DGMTD/DGTM2 Tables
Data type: BAPISTDTYP-BOOLEANDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_PACK_OLD - Indicator: Read DGTPK Table
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_PACK - Indicator: Read Table CCDUTPACK
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_SPROV - Indicator: Read Table CCDUTSPROV
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_READ_TRAPPR - Indicator: Read Table CCDUTTRAPPR
Data type: BAPISTDTYP-BOOLEANOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_DANGEROUSGOOD_GETDETAIL
FLG_ABORT_ON_ERROR - Cancel Processing
Data type: BAPISTDTYP-BOOLEANOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_DANGEROUSGOOD_GETDETAIL
RETURN - Error Messages
Data type: BAPIRET2Optional: No
Call by Reference: Yes
PROV_CARRIAGE - Provisions for Carriage
Data type: BAPI1078_PROV_CARRIAGEOptional: Yes
Call by Reference: Yes
PRODUCT_RELEASE - Product Release
Data type: BAPI1078_PRODUCT_RELEASEOptional: Yes
Call by Reference: Yes
EXTENSION_OUT - Export customer enhancements
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
LOGKEY_TAB - Logical Key for Selection Using Dangerous Goods Data
Data type: BAPI1078_LOGKEYSELOptional: Yes
Call by Reference: Yes
MATERIAL_TAB - Material for Selection Using Dangerous Goods Data
Data type: BAPI1078_MATSELOptional: Yes
Call by Reference: Yes
REGULATION_TAB - Dangerous Goods Regulation for Selection Using Dangerous Goods Data
Data type: BAPI1078_REGSELOptional: Yes
Call by Reference: Yes
DANGEROUSGOODDATA - Dangerous Goods Master (Header)
Data type: BAPI1078_DANGEROUSGOODDATAOptional: Yes
Call by Reference: Yes
DANGEROUSGOODPACK - Dangerous Goods Packing Requirement
Data type: BAPI1078_DANGEROUSGOODPACKOptional: Yes
Call by Reference: Yes
PACK_REQUIREMENT - Dangerous Goods Packaging Requirements (New)
Data type: BAPI1078_PACK_REQUIREMENTOptional: Yes
Call by Reference: Yes
SPEC_PACK_PROV - Special Packing Provisions
Data type: BAPI1078_SPEC_PACK_PROVOptional: Yes
Call by Reference: Yes
TRANSP_APPROVAL - Transport Restrictions
Data type: BAPI1078_TRANSP_APPROVALOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_DANGEROUSGOOD_GETDETAIL 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: | ||||
lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
lv_key_date | TYPE RCGADDINF-VALDAT, " SY-DATUM | |||
lv_flg_abort_on_error | TYPE BAPISTDTYP-BOOLEAN, " | |||
lv_flg_read_carr | TYPE BAPISTDTYP-BOOLEAN, " | |||
lt_prov_carriage | TYPE STANDARD TABLE OF BAPI1078_PROV_CARRIAGE, " | |||
lv_flg_read_dgrel | TYPE BAPISTDTYP-BOOLEAN, " | |||
lt_product_release | TYPE STANDARD TABLE OF BAPI1078_PRODUCT_RELEASE, " | |||
lt_extension_out | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
lt_logkey_tab | TYPE STANDARD TABLE OF BAPI1078_LOGKEYSEL, " | |||
lv_flg_read_active_only | TYPE BAPISTDTYP-BOOLEAN, " 'X' | |||
lt_material_tab | TYPE STANDARD TABLE OF BAPI1078_MATSEL, " | |||
lv_flg_read_undeleted_only | TYPE BAPISTDTYP-BOOLEAN, " 'X' | |||
lt_regulation_tab | TYPE STANDARD TABLE OF BAPI1078_REGSEL, " | |||
lv_flg_return_whole_interval | TYPE BAPISTDTYP-BOOLEAN, " | |||
lv_flg_read_header | TYPE BAPISTDTYP-BOOLEAN, " 'X' | |||
lt_dangerousgooddata | TYPE STANDARD TABLE OF BAPI1078_DANGEROUSGOODDATA, " | |||
lt_dangerousgoodpack | TYPE STANDARD TABLE OF BAPI1078_DANGEROUSGOODPACK, " | |||
lv_flg_read_pack_old | TYPE BAPISTDTYP-BOOLEAN, " | |||
lv_flg_read_pack | TYPE BAPISTDTYP-BOOLEAN, " | |||
lt_pack_requirement | TYPE STANDARD TABLE OF BAPI1078_PACK_REQUIREMENT, " | |||
lv_flg_read_sprov | TYPE BAPISTDTYP-BOOLEAN, " | |||
lt_spec_pack_prov | TYPE STANDARD TABLE OF BAPI1078_SPEC_PACK_PROV, " | |||
lv_flg_read_trappr | TYPE BAPISTDTYP-BOOLEAN, " | |||
lt_transp_approval | TYPE STANDARD TABLE OF BAPI1078_TRANSP_APPROVAL. " |
  CALL FUNCTION 'BAPI_DANGEROUSGOOD_GETDETAIL' "EHS: Read Dang.Good |
EXPORTING | ||
KEY_DATE | = lv_key_date | |
FLG_READ_CARR | = lv_flg_read_carr | |
FLG_READ_DGREL | = lv_flg_read_dgrel | |
FLG_READ_ACTIVE_ONLY | = lv_flg_read_active_only | |
FLG_READ_UNDELETED_ONLY | = lv_flg_read_undeleted_only | |
FLG_RETURN_WHOLE_INTERVAL | = lv_flg_return_whole_interval | |
FLG_READ_HEADER | = lv_flg_read_header | |
FLG_READ_PACK_OLD | = lv_flg_read_pack_old | |
FLG_READ_PACK | = lv_flg_read_pack | |
FLG_READ_SPROV | = lv_flg_read_sprov | |
FLG_READ_TRAPPR | = lv_flg_read_trappr | |
IMPORTING | ||
FLG_ABORT_ON_ERROR | = lv_flg_abort_on_error | |
TABLES | ||
RETURN | = lt_return | |
PROV_CARRIAGE | = lt_prov_carriage | |
PRODUCT_RELEASE | = lt_product_release | |
EXTENSION_OUT | = lt_extension_out | |
LOGKEY_TAB | = lt_logkey_tab | |
MATERIAL_TAB | = lt_material_tab | |
REGULATION_TAB | = lt_regulation_tab | |
DANGEROUSGOODDATA | = lt_dangerousgooddata | |
DANGEROUSGOODPACK | = lt_dangerousgoodpack | |
PACK_REQUIREMENT | = lt_pack_requirement | |
SPEC_PACK_PROV | = lt_spec_pack_prov | |
TRANSP_APPROVAL | = lt_transp_approval | |
. " BAPI_DANGEROUSGOOD_GETDETAIL |
ABAP code using 7.40 inline data declarations to call FM BAPI_DANGEROUSGOOD_GETDETAIL
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."SELECT single VALDAT FROM RCGADDINF INTO @DATA(ld_key_date). | ||||
DATA(ld_key_date) | = SY-DATUM. | |||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_abort_on_error). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_carr). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_dgrel). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_active_only). | ||||
DATA(ld_flg_read_active_only) | = 'X'. | |||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_undeleted_only). | ||||
DATA(ld_flg_read_undeleted_only) | = 'X'. | |||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_return_whole_interval). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_header). | ||||
DATA(ld_flg_read_header) | = 'X'. | |||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_pack_old). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_pack). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_sprov). | ||||
"SELECT single BOOLEAN FROM BAPISTDTYP INTO @DATA(ld_flg_read_trappr). | ||||
Search for further information about these or an SAP related objects