SAP BAPI_INQUIRY_CREATEFROMDATA2 Function Module for Customer Inquiry: Create Customer Inquiry
BAPI_INQUIRY_CREATEFROMDATA2 is a standard bapi inquiry createfromdata2 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Customer Inquiry: Create Customer Inquiry 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 inquiry createfromdata2 FM, simply by entering the name BAPI_INQUIRY_CREATEFROMDATA2 into the relevant SAP transaction such as SE37 or SE38.
Function Group: 2030
Program Name: SAPL2030
Main Program: SAPL2030
Appliation area: V
Release date: 22-Feb-2005
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_INQUIRY_CREATEFROMDATA2 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_INQUIRY_CREATEFROMDATA2'"Customer Inquiry: Create Customer Inquiry.
EXPORTING
* SALESDOCUMENTIN = "Sales and Distribution Document Number
* CONVERT = ' ' "Conversion of Partner Function + Order Type
INQUIRY_HEADER_IN = "Data for Inquiry Header
* INQUIRY_HEADER_INX = "Checkbox for Header Data
* SENDER = "Logical System - Sender
* BINARY_RELATIONSHIPTYPE = "Binary Relationship Type (Private)
* INT_NUMBER_ASSIGNMENT = "Internal Item Number Assignment
* BEHAVE_WHEN_ERROR = "Error Handling
* LOGIC_SWITCH = "Internal Control Parameter
* TESTRUN = "Test Run
IMPORTING
SALESDOCUMENT = "Sales Document Number
TABLES
* RETURN = "Error Message Text
* INQUIRY_CFGS_INST = "Configuration: Instances
* INQUIRY_CFGS_PART_OF = "Configuration: Part-of Specifications
* INQUIRY_CFGS_VALUE = "Configuration: Characteristic Values
* INQUIRY_CFGS_BLOB = "Configuration: BLOB Internal Data (SCE)
* INQUIRY_CFGS_VK = "Configuration: Variant Condition Key
* INQUIRY_CFGS_REFINST = "Configuration: Reference Item / Instance
* INQUIRY_TEXT = "Texts
* INQUIRY_KEYS = "Output Table of Reference Keys
* EXTENSIONIN = "Customer Enhancement for VBAK, VBAP, VBEP
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Org./Company)
* INQUIRY_ITEMS_IN = "Item Data
* INQUIRY_ITEMS_INX = "Item Data Checkboxes
INQUIRY_PARTNERS = "Document Partner
* INQUIRY_SCHEDULES_IN = "Schedule Lines
* INQUIRY_SCHEDULES_INX = "Checkbox for Schedule Lines
* INQUIRY_CONDITIONS_IN = "Conditions
* INQUIRY_CONDITIONS_INX = "Communication Fields for Maintaining Conditions in the Order
* INQUIRY_CFGS_REF = "Configuration: Reference Data
IMPORTING Parameters details for BAPI_INQUIRY_CREATEFROMDATA2
SALESDOCUMENTIN - Sales and Distribution Document Number
Data type: BAPIVBELN-VBELNOptional: Yes
Call by Reference: No ( called with pass by value option)
CONVERT - Conversion of Partner Function + Order Type
Data type: BAPIFLAG-BAPIFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_HEADER_IN - Data for Inquiry Header
Data type: BAPISDHD1Optional: No
Call by Reference: No ( called with pass by value option)
INQUIRY_HEADER_INX - Checkbox for Header Data
Data type: BAPISDHD1XOptional: Yes
Call by Reference: No ( called with pass by value option)
SENDER - Logical System - Sender
Data type: BAPI_SENDEROptional: Yes
Call by Reference: No ( called with pass by value option)
BINARY_RELATIONSHIPTYPE - Binary Relationship Type (Private)
Data type: BAPIRELTYPE-RELTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
INT_NUMBER_ASSIGNMENT - Internal Item Number Assignment
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
BEHAVE_WHEN_ERROR - Error Handling
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
LOGIC_SWITCH - Internal Control Parameter
Data type: BAPISDLSOptional: Yes
Call by Reference: No ( called with pass by value option)
TESTRUN - Test Run
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_INQUIRY_CREATEFROMDATA2
SALESDOCUMENT - Sales Document Number
Data type: BAPIVBELN-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_INQUIRY_CREATEFROMDATA2
RETURN - Error Message Text
Data type: BAPIRET2Optional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_INST - Configuration: Instances
Data type: BAPICUINSOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_PART_OF - Configuration: Part-of Specifications
Data type: BAPICUPRTOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_VALUE - Configuration: Characteristic Values
Data type: BAPICUVALOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_BLOB - Configuration: BLOB Internal Data (SCE)
Data type: BAPICUBLBOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_VK - Configuration: Variant Condition Key
Data type: BAPICUVKOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CFGS_REFINST - Configuration: Reference Item / Instance
Data type: BAPICUREFOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_TEXT - Texts
Data type: BAPISDTEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_KEYS - Output Table of Reference Keys
Data type: BAPISDKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
EXTENSIONIN - Customer Enhancement for VBAK, VBAP, VBEP
Data type: BAPIPAREXOptional: Yes
Call by Reference: No ( called with pass by value option)
PARTNERADDRESSES - BAPI Reference Structure for Addresses (Org./Company)
Data type: BAPIADDR1Optional: Yes
Call by Reference: Yes
INQUIRY_ITEMS_IN - Item Data
Data type: BAPISDITMOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_ITEMS_INX - Item Data Checkboxes
Data type: BAPISDITMXOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_PARTNERS - Document Partner
Data type: BAPIPARNROptional: No
Call by Reference: No ( called with pass by value option)
INQUIRY_SCHEDULES_IN - Schedule Lines
Data type: BAPISCHDLOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_SCHEDULES_INX - Checkbox for Schedule Lines
Data type: BAPISCHDLXOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CONDITIONS_IN - Conditions
Data type: BAPICONDOptional: Yes
Call by Reference: No ( called with pass by value option)
INQUIRY_CONDITIONS_INX - Communication Fields for Maintaining Conditions in the Order
Data type: BAPICONDXOptional: Yes
Call by Reference: Yes
INQUIRY_CFGS_REF - Configuration: Reference Data
Data type: BAPICUCFGOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_INQUIRY_CREATEFROMDATA2 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_salesdocument | TYPE BAPIVBELN-VBELN, " | |||
| lv_salesdocumentin | TYPE BAPIVBELN-VBELN, " | |||
| lv_convert | TYPE BAPIFLAG-BAPIFLAG, " SPACE | |||
| lt_inquiry_cfgs_inst | TYPE STANDARD TABLE OF BAPICUINS, " | |||
| lt_inquiry_cfgs_part_of | TYPE STANDARD TABLE OF BAPICUPRT, " | |||
| lt_inquiry_cfgs_value | TYPE STANDARD TABLE OF BAPICUVAL, " | |||
| lt_inquiry_cfgs_blob | TYPE STANDARD TABLE OF BAPICUBLB, " | |||
| lt_inquiry_cfgs_vk | TYPE STANDARD TABLE OF BAPICUVK, " | |||
| lt_inquiry_cfgs_refinst | TYPE STANDARD TABLE OF BAPICUREF, " | |||
| lt_inquiry_text | TYPE STANDARD TABLE OF BAPISDTEXT, " | |||
| lt_inquiry_keys | TYPE STANDARD TABLE OF BAPISDKEY, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lt_partneraddresses | TYPE STANDARD TABLE OF BAPIADDR1, " | |||
| lt_inquiry_items_in | TYPE STANDARD TABLE OF BAPISDITM, " | |||
| lv_inquiry_header_in | TYPE BAPISDHD1, " | |||
| lt_inquiry_items_inx | TYPE STANDARD TABLE OF BAPISDITMX, " | |||
| lv_inquiry_header_inx | TYPE BAPISDHD1X, " | |||
| lv_sender | TYPE BAPI_SENDER, " | |||
| lt_inquiry_partners | TYPE STANDARD TABLE OF BAPIPARNR, " | |||
| lt_inquiry_schedules_in | TYPE STANDARD TABLE OF BAPISCHDL, " | |||
| lv_binary_relationshiptype | TYPE BAPIRELTYPE-RELTYPE, " | |||
| lt_inquiry_schedules_inx | TYPE STANDARD TABLE OF BAPISCHDLX, " | |||
| lv_int_number_assignment | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lv_behave_when_error | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lt_inquiry_conditions_in | TYPE STANDARD TABLE OF BAPICOND, " | |||
| lv_logic_switch | TYPE BAPISDLS, " | |||
| lt_inquiry_conditions_inx | TYPE STANDARD TABLE OF BAPICONDX, " | |||
| lv_testrun | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lt_inquiry_cfgs_ref | TYPE STANDARD TABLE OF BAPICUCFG. " |
|   CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2' "Customer Inquiry: Create Customer Inquiry |
| EXPORTING | ||
| SALESDOCUMENTIN | = lv_salesdocumentin | |
| CONVERT | = lv_convert | |
| INQUIRY_HEADER_IN | = lv_inquiry_header_in | |
| INQUIRY_HEADER_INX | = lv_inquiry_header_inx | |
| SENDER | = lv_sender | |
| BINARY_RELATIONSHIPTYPE | = lv_binary_relationshiptype | |
| INT_NUMBER_ASSIGNMENT | = lv_int_number_assignment | |
| BEHAVE_WHEN_ERROR | = lv_behave_when_error | |
| LOGIC_SWITCH | = lv_logic_switch | |
| TESTRUN | = lv_testrun | |
| IMPORTING | ||
| SALESDOCUMENT | = lv_salesdocument | |
| TABLES | ||
| RETURN | = lt_return | |
| INQUIRY_CFGS_INST | = lt_inquiry_cfgs_inst | |
| INQUIRY_CFGS_PART_OF | = lt_inquiry_cfgs_part_of | |
| INQUIRY_CFGS_VALUE | = lt_inquiry_cfgs_value | |
| INQUIRY_CFGS_BLOB | = lt_inquiry_cfgs_blob | |
| INQUIRY_CFGS_VK | = lt_inquiry_cfgs_vk | |
| INQUIRY_CFGS_REFINST | = lt_inquiry_cfgs_refinst | |
| INQUIRY_TEXT | = lt_inquiry_text | |
| INQUIRY_KEYS | = lt_inquiry_keys | |
| EXTENSIONIN | = lt_extensionin | |
| PARTNERADDRESSES | = lt_partneraddresses | |
| INQUIRY_ITEMS_IN | = lt_inquiry_items_in | |
| INQUIRY_ITEMS_INX | = lt_inquiry_items_inx | |
| INQUIRY_PARTNERS | = lt_inquiry_partners | |
| INQUIRY_SCHEDULES_IN | = lt_inquiry_schedules_in | |
| INQUIRY_SCHEDULES_INX | = lt_inquiry_schedules_inx | |
| INQUIRY_CONDITIONS_IN | = lt_inquiry_conditions_in | |
| INQUIRY_CONDITIONS_INX | = lt_inquiry_conditions_inx | |
| INQUIRY_CFGS_REF | = lt_inquiry_cfgs_ref | |
| . " BAPI_INQUIRY_CREATEFROMDATA2 | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_INQUIRY_CREATEFROMDATA2
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 VBELN FROM BAPIVBELN INTO @DATA(ld_salesdocument). | ||||
| "SELECT single VBELN FROM BAPIVBELN INTO @DATA(ld_salesdocumentin). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_convert). | ||||
| DATA(ld_convert) | = ' '. | |||
| "SELECT single RELTYPE FROM BAPIRELTYPE INTO @DATA(ld_binary_relationshiptype). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_int_number_assignment). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_behave_when_error). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_testrun). | ||||
Search for further information about these or an SAP related objects