SAP BAPI_SALESDOCU_CREATEWITHDIA Function Module for Creating a Sales and Distribution Document









BAPI_SALESDOCU_CREATEWITHDIA is a standard bapi salesdocu createwithdia SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Creating a Sales and Distribution Document 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 salesdocu createwithdia FM, simply by entering the name BAPI_SALESDOCU_CREATEWITHDIA into the relevant SAP transaction such as SE37 or SE38.

Function Group: VBAK
Program Name: SAPLVBAK
Main Program: SAPLVBAK
Appliation area: V
Release date: 02-Nov-1999
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_SALESDOCU_CREATEWITHDIA 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_SALESDOCU_CREATEWITHDIA'"Creating a Sales and Distribution Document
EXPORTING
* SALESDOCUMENT = "Sales and Distribution Document Number
SALES_HEADER_IN = "Document Header Data
* SALES_HEADER_INX = "Checkbox for Header Data
* SENDER = "Logical System - Sender
* BINARY_RELATIONSHIPTYPE = 'VORL' "Binary Relationship Type (Private)
* CONVERT_PARVW_AUART = ' ' "Conversion of Partner Function + Order Type
* SYNCHRONOUS = ' ' "Single-Character Indicator
* INT_NUMBER_ASSIGNMENT = ' ' "Internal Item Number Assignment
* MESSAGE_TYPE = 'S' "Message Type in SAVE

IMPORTING
SALESDOCUMENT_EX = "Number of Generated Document

TABLES
* RETURN = "Return Messages
* SALES_CFGS_INST = "Configuration: Instances
* SALES_CFGS_PART_OF = "Configuration: Part-of specifications
* SALES_CFGS_VALUE = "Configuration: Characteristic values
* SALES_CFGS_BLOB = "Configuration: BLOB Internal Data (SCE)
* SALES_CCARD = "Credit Card Data
* PARTNERADDRESSES = "BAPI Reference Structure for Addresses (Organization/Company)
* SALES_ITEMS_IN = "Item Data
* SALES_ITEMS_INX = "Item Data Checkboxes
* SALES_PARTNERS = "Document Partner
* SALES_SCHEDULES_IN = "Schedule Line Data
* SALES_SCHEDULES_INX = "Checkbox Schedule Line Data
* SALES_CONDITIONS_IN = "Conditions
* SALES_CONDITIONS_INX = "Conditions Checkbox
* SALES_CFGS_REF = "Configuration: Reference Data
.



IMPORTING Parameters details for BAPI_SALESDOCU_CREATEWITHDIA

SALESDOCUMENT - Sales and Distribution Document Number

Data type: BAPIVBELN-VBELN
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_HEADER_IN - Document Header Data

Data type: BAPISDHEAD1
Optional: No
Call by Reference: No ( called with pass by value option)

SALES_HEADER_INX - Checkbox for Header Data

Data type: BAPISDHEAD1X
Optional: Yes
Call by Reference: No ( called with pass by value option)

SENDER - Logical System - Sender

Data type: BAPI_SENDER
Optional: Yes
Call by Reference: No ( called with pass by value option)

BINARY_RELATIONSHIPTYPE - Binary Relationship Type (Private)

Data type: BAPIRELTYPE-RELTYPE
Default: 'VORL'
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONVERT_PARVW_AUART - Conversion of Partner Function + Order Type

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SYNCHRONOUS - Single-Character Indicator

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

INT_NUMBER_ASSIGNMENT - Internal Item Number Assignment

Data type: BAPIFLAG-BAPIFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MESSAGE_TYPE - Message Type in SAVE

Data type: BAPIFLAG-BAPIFLAG
Default: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_SALESDOCU_CREATEWITHDIA

SALESDOCUMENT_EX - Number of Generated Document

Data type: BAPIVBELN-VBELN
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_SALESDOCU_CREATEWITHDIA

RETURN - Return Messages

Data type: BAPIRET2
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CFGS_INST - Configuration: Instances

Data type: BAPICUINS
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CFGS_PART_OF - Configuration: Part-of specifications

Data type: BAPICUPRT
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CFGS_VALUE - Configuration: Characteristic values

Data type: BAPICUVAL
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CFGS_BLOB - Configuration: BLOB Internal Data (SCE)

Data type: BAPICUBLB
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CCARD - Credit Card Data

Data type: BAPICCARD
Optional: Yes
Call by Reference: No ( called with pass by value option)

PARTNERADDRESSES - BAPI Reference Structure for Addresses (Organization/Company)

Data type: BAPIADDR1
Optional: Yes
Call by Reference: Yes

SALES_ITEMS_IN - Item Data

Data type: BAPISDITEM
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_ITEMS_INX - Item Data Checkboxes

Data type: BAPISDITEMX
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_PARTNERS - Document Partner

Data type: BAPIPARTNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_SCHEDULES_IN - Schedule Line Data

Data type: BAPISCHEDULE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_SCHEDULES_INX - Checkbox Schedule Line Data

Data type: BAPISCHEDULEX
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CONDITIONS_IN - Conditions

Data type: BAPICONDITION
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CONDITIONS_INX - Conditions Checkbox

Data type: BAPICONDITIONX
Optional: Yes
Call by Reference: No ( called with pass by value option)

SALES_CFGS_REF - Configuration: Reference Data

Data type: BAPICUCFG
Optional: Yes
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_SALESDOCU_CREATEWITHDIA 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_salesdocument_ex  TYPE BAPIVBELN-VBELN, "   
lt_sales_cfgs_inst  TYPE STANDARD TABLE OF BAPICUINS, "   
lt_sales_cfgs_part_of  TYPE STANDARD TABLE OF BAPICUPRT, "   
lt_sales_cfgs_value  TYPE STANDARD TABLE OF BAPICUVAL, "   
lt_sales_cfgs_blob  TYPE STANDARD TABLE OF BAPICUBLB, "   
lt_sales_ccard  TYPE STANDARD TABLE OF BAPICCARD, "   
lt_partneraddresses  TYPE STANDARD TABLE OF BAPIADDR1, "   
lt_sales_items_in  TYPE STANDARD TABLE OF BAPISDITEM, "   
lv_sales_header_in  TYPE BAPISDHEAD1, "   
lt_sales_items_inx  TYPE STANDARD TABLE OF BAPISDITEMX, "   
lv_sales_header_inx  TYPE BAPISDHEAD1X, "   
lv_sender  TYPE BAPI_SENDER, "   
lt_sales_partners  TYPE STANDARD TABLE OF BAPIPARTNR, "   
lt_sales_schedules_in  TYPE STANDARD TABLE OF BAPISCHEDULE, "   
lv_binary_relationshiptype  TYPE BAPIRELTYPE-RELTYPE, "   'VORL'
lv_convert_parvw_auart  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lt_sales_schedules_inx  TYPE STANDARD TABLE OF BAPISCHEDULEX, "   
lv_synchronous  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lt_sales_conditions_in  TYPE STANDARD TABLE OF BAPICONDITION, "   
lt_sales_conditions_inx  TYPE STANDARD TABLE OF BAPICONDITIONX, "   
lv_int_number_assignment  TYPE BAPIFLAG-BAPIFLAG, "   SPACE
lv_message_type  TYPE BAPIFLAG-BAPIFLAG, "   'S'
lt_sales_cfgs_ref  TYPE STANDARD TABLE OF BAPICUCFG. "   

  CALL FUNCTION 'BAPI_SALESDOCU_CREATEWITHDIA'  "Creating a Sales and Distribution Document
    EXPORTING
         SALESDOCUMENT = lv_salesdocument
         SALES_HEADER_IN = lv_sales_header_in
         SALES_HEADER_INX = lv_sales_header_inx
         SENDER = lv_sender
         BINARY_RELATIONSHIPTYPE = lv_binary_relationshiptype
         CONVERT_PARVW_AUART = lv_convert_parvw_auart
         SYNCHRONOUS = lv_synchronous
         INT_NUMBER_ASSIGNMENT = lv_int_number_assignment
         MESSAGE_TYPE = lv_message_type
    IMPORTING
         SALESDOCUMENT_EX = lv_salesdocument_ex
    TABLES
         RETURN = lt_return
         SALES_CFGS_INST = lt_sales_cfgs_inst
         SALES_CFGS_PART_OF = lt_sales_cfgs_part_of
         SALES_CFGS_VALUE = lt_sales_cfgs_value
         SALES_CFGS_BLOB = lt_sales_cfgs_blob
         SALES_CCARD = lt_sales_ccard
         PARTNERADDRESSES = lt_partneraddresses
         SALES_ITEMS_IN = lt_sales_items_in
         SALES_ITEMS_INX = lt_sales_items_inx
         SALES_PARTNERS = lt_sales_partners
         SALES_SCHEDULES_IN = lt_sales_schedules_in
         SALES_SCHEDULES_INX = lt_sales_schedules_inx
         SALES_CONDITIONS_IN = lt_sales_conditions_in
         SALES_CONDITIONS_INX = lt_sales_conditions_inx
         SALES_CFGS_REF = lt_sales_cfgs_ref
. " BAPI_SALESDOCU_CREATEWITHDIA




ABAP code using 7.40 inline data declarations to call FM BAPI_SALESDOCU_CREATEWITHDIA

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_salesdocument_ex).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
"SELECT single RELTYPE FROM BAPIRELTYPE INTO @DATA(ld_binary_relationshiptype).
DATA(ld_binary_relationshiptype) = 'VORL'.
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_convert_parvw_auart).
DATA(ld_convert_parvw_auart) = ' '.
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_synchronous).
DATA(ld_synchronous) = ' '.
 
 
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_int_number_assignment).
DATA(ld_int_number_assignment) = ' '.
 
"SELECT single BAPIFLAG FROM BAPIFLAG INTO @DATA(ld_message_type).
DATA(ld_message_type) = 'S'.
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!