SAP ALE_SALESORDER_CREATEFROMDAT2 Function Module for BAPI -> IDoc: ALE_SALESORDER_CREATEFROMDAT2
ALE_SALESORDER_CREATEFROMDAT2 is a standard ale salesorder createfromdat2 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for BAPI -> IDoc: ALE_SALESORDER_CREATEFROMDAT2 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 ale salesorder createfromdat2 FM, simply by entering the name ALE_SALESORDER_CREATEFROMDAT2 into the relevant SAP transaction such as SE37 or SE38.
Function Group: 2032
Program Name: SAPL2032
Main Program: SAPL2032
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ALE_SALESORDER_CREATEFROMDAT2 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 'ALE_SALESORDER_CREATEFROMDAT2'"BAPI -> IDoc: ALE_SALESORDER_CREATEFROMDAT2.
EXPORTING
* SALESDOCUMENTIN = "Sales and Distribution Document Number
* CONVERT = ' ' "Conversion of Partner Function and Order Type
* OBJ_TYPE = 'BUS2032' "
* SERIAL_ID = '0' "
ORDERHEADERIN = "
* ORDERHEADERINX = "
* SENDER = "Logical System - Sender
* BINARYRELATIONSHIPTYPE = "
* INTNUMBERASSIGNMENT = "
* BEHAVEWHENERROR = "
* LOGICSWITCH = "
* TESTRUN = "Test Run
TABLES
* ORDERITEMSIN = "
* ORDERCFGSPARTOF = "
* ORDERCFGSVALUE = "
* ORDERCFGSBLOB = "
* ORDERCFGSVK = "
* ORDERCFGSREFINST = "
* ORDERCCARD = "
* ORDERTEXT = "
* ORDERKEYS = "
* EXTENSIONIN = "
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Org./Company)
* ORDERITEMSINX = "
RECEIVERS = "
* COMMUNICATION_DOCUMENTS = "
* APPLICATION_OBJECTS = "
ORDERPARTNERS = "
* ORDERSCHEDULESIN = "
* ORDERSCHEDULESINX = "
* ORDERCONDITIONSIN = "
* ORDERCONDITIONSINX = "
* ORDERCFGSREF = "
* ORDERCFGSINST = "
EXCEPTIONS
ERROR_CREATING_IDOCS = 1
IMPORTING Parameters details for ALE_SALESORDER_CREATEFROMDAT2
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 and Order Type
Data type: BAPIFLAG-BAPIFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJ_TYPE -
Data type: SERIAL-OBJ_TYPEDefault: 'BUS2032'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SERIAL_ID -
Data type: SERIAL-CHNUMDefault: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ORDERHEADERIN -
Data type: BAPISDHD1Optional: No
Call by Reference: No ( called with pass by value option)
ORDERHEADERINX -
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)
BINARYRELATIONSHIPTYPE -
Data type: BAPIRELTYPE-RELTYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
INTNUMBERASSIGNMENT -
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
BEHAVEWHENERROR -
Data type: BAPIFLAG-BAPIFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
LOGICSWITCH -
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)
TABLES Parameters details for ALE_SALESORDER_CREATEFROMDAT2
ORDERITEMSIN -
Data type: BAPISDITMOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSPARTOF -
Data type: BAPICUPRTOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSVALUE -
Data type: BAPICUVALOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSBLOB -
Data type: BAPICUBLBOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSVK -
Data type: BAPICUVKOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSREFINST -
Data type: BAPICUREFOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCCARD -
Data type: BAPICCARDOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERTEXT -
Data type: BAPISDTEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERKEYS -
Data type: BAPISDKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
EXTENSIONIN -
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: No ( called with pass by value option)
ORDERITEMSINX -
Data type: BAPISDITMXOptional: Yes
Call by Reference: No ( called with pass by value option)
RECEIVERS -
Data type: BDI_LOGSYSOptional: No
Call by Reference: No ( called with pass by value option)
COMMUNICATION_DOCUMENTS -
Data type: SWOTOBJIDOptional: Yes
Call by Reference: No ( called with pass by value option)
APPLICATION_OBJECTS -
Data type: SWOTOBJIDOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERPARTNERS -
Data type: BAPIPARNROptional: No
Call by Reference: No ( called with pass by value option)
ORDERSCHEDULESIN -
Data type: BAPISCHDLOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERSCHEDULESINX -
Data type: BAPISCHDLXOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCONDITIONSIN -
Data type: BAPICONDOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCONDITIONSINX -
Data type: BAPICONDXOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSREF -
Data type: BAPICUCFGOptional: Yes
Call by Reference: No ( called with pass by value option)
ORDERCFGSINST -
Data type: BAPICUINSOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR_CREATING_IDOCS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for ALE_SALESORDER_CREATEFROMDAT2 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_orderitemsin | TYPE STANDARD TABLE OF BAPISDITM, " | |||
| lv_salesdocumentin | TYPE BAPIVBELN-VBELN, " | |||
| lv_error_creating_idocs | TYPE BAPIVBELN, " | |||
| lv_convert | TYPE BAPIFLAG-BAPIFLAG, " SPACE | |||
| lt_ordercfgspartof | TYPE STANDARD TABLE OF BAPICUPRT, " | |||
| lv_obj_type | TYPE SERIAL-OBJ_TYPE, " 'BUS2032' | |||
| lt_ordercfgsvalue | TYPE STANDARD TABLE OF BAPICUVAL, " | |||
| lv_serial_id | TYPE SERIAL-CHNUM, " '0' | |||
| lt_ordercfgsblob | TYPE STANDARD TABLE OF BAPICUBLB, " | |||
| lt_ordercfgsvk | TYPE STANDARD TABLE OF BAPICUVK, " | |||
| lt_ordercfgsrefinst | TYPE STANDARD TABLE OF BAPICUREF, " | |||
| lt_orderccard | TYPE STANDARD TABLE OF BAPICCARD, " | |||
| lt_ordertext | TYPE STANDARD TABLE OF BAPISDTEXT, " | |||
| lt_orderkeys | TYPE STANDARD TABLE OF BAPISDKEY, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lt_partneraddresses | TYPE STANDARD TABLE OF BAPIADDR1, " | |||
| lv_orderheaderin | TYPE BAPISDHD1, " | |||
| lt_orderitemsinx | TYPE STANDARD TABLE OF BAPISDITMX, " | |||
| lt_receivers | TYPE STANDARD TABLE OF BDI_LOGSYS, " | |||
| lt_communication_documents | TYPE STANDARD TABLE OF SWOTOBJID, " | |||
| lt_application_objects | TYPE STANDARD TABLE OF SWOTOBJID, " | |||
| lt_orderpartners | TYPE STANDARD TABLE OF BAPIPARNR, " | |||
| lv_orderheaderinx | TYPE BAPISDHD1X, " | |||
| lv_sender | TYPE BAPI_SENDER, " | |||
| lt_orderschedulesin | TYPE STANDARD TABLE OF BAPISCHDL, " | |||
| lt_orderschedulesinx | TYPE STANDARD TABLE OF BAPISCHDLX, " | |||
| lv_binaryrelationshiptype | TYPE BAPIRELTYPE-RELTYPE, " | |||
| lt_orderconditionsin | TYPE STANDARD TABLE OF BAPICOND, " | |||
| lv_intnumberassignment | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lv_behavewhenerror | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lt_orderconditionsinx | TYPE STANDARD TABLE OF BAPICONDX, " | |||
| lv_logicswitch | TYPE BAPISDLS, " | |||
| lt_ordercfgsref | TYPE STANDARD TABLE OF BAPICUCFG, " | |||
| lv_testrun | TYPE BAPIFLAG-BAPIFLAG, " | |||
| lt_ordercfgsinst | TYPE STANDARD TABLE OF BAPICUINS. " |
|   CALL FUNCTION 'ALE_SALESORDER_CREATEFROMDAT2' "BAPI -> IDoc: ALE_SALESORDER_CREATEFROMDAT2 |
| EXPORTING | ||
| SALESDOCUMENTIN | = lv_salesdocumentin | |
| CONVERT | = lv_convert | |
| OBJ_TYPE | = lv_obj_type | |
| SERIAL_ID | = lv_serial_id | |
| ORDERHEADERIN | = lv_orderheaderin | |
| ORDERHEADERINX | = lv_orderheaderinx | |
| SENDER | = lv_sender | |
| BINARYRELATIONSHIPTYPE | = lv_binaryrelationshiptype | |
| INTNUMBERASSIGNMENT | = lv_intnumberassignment | |
| BEHAVEWHENERROR | = lv_behavewhenerror | |
| LOGICSWITCH | = lv_logicswitch | |
| TESTRUN | = lv_testrun | |
| TABLES | ||
| ORDERITEMSIN | = lt_orderitemsin | |
| ORDERCFGSPARTOF | = lt_ordercfgspartof | |
| ORDERCFGSVALUE | = lt_ordercfgsvalue | |
| ORDERCFGSBLOB | = lt_ordercfgsblob | |
| ORDERCFGSVK | = lt_ordercfgsvk | |
| ORDERCFGSREFINST | = lt_ordercfgsrefinst | |
| ORDERCCARD | = lt_orderccard | |
| ORDERTEXT | = lt_ordertext | |
| ORDERKEYS | = lt_orderkeys | |
| EXTENSIONIN | = lt_extensionin | |
| PARTNERADDRESSES | = lt_partneraddresses | |
| ORDERITEMSINX | = lt_orderitemsinx | |
| RECEIVERS | = lt_receivers | |
| COMMUNICATION_DOCUMENTS | = lt_communication_documents | |
| APPLICATION_OBJECTS | = lt_application_objects | |
| ORDERPARTNERS | = lt_orderpartners | |
| ORDERSCHEDULESIN | = lt_orderschedulesin | |
| ORDERSCHEDULESINX | = lt_orderschedulesinx | |
| ORDERCONDITIONSIN | = lt_orderconditionsin | |
| ORDERCONDITIONSINX | = lt_orderconditionsinx | |
| ORDERCFGSREF | = lt_ordercfgsref | |
| ORDERCFGSINST | = lt_ordercfgsinst | |
| EXCEPTIONS | ||
| ERROR_CREATING_IDOCS = 1 | ||
| . " ALE_SALESORDER_CREATEFROMDAT2 | ||
ABAP code using 7.40 inline data declarations to call FM ALE_SALESORDER_CREATEFROMDAT2
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_salesdocumentin). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_convert). | ||||
| DATA(ld_convert) | = ' '. | |||
| "SELECT single OBJ_TYPE FROM SERIAL INTO @DATA(ld_obj_type). | ||||
| DATA(ld_obj_type) | = 'BUS2032'. | |||
| "SELECT single CHNUM FROM SERIAL INTO @DATA(ld_serial_id). | ||||
| DATA(ld_serial_id) | = '0'. | |||
| "SELECT single RELTYPE FROM BAPIRELTYPE INTO @DATA(ld_binaryrelationshiptype). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_intnumberassignment). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_behavewhenerror). | ||||
| "SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_testrun). | ||||
Search for further information about these or an SAP related objects