SD_SALES_DOCUMENT_FROM_SM is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name SD_SALES_DOCUMENT_FROM_SM into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
V46H
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'SD_SALES_DOCUMENT_FROM_SM' "
* EXPORTING
* i_vbeln_v = " vbap-vbeln
* i_vbeln = " vbap-vbeln
* i_sdsm_header = " sdsm_header
* i_sdsm_main_item = " sdsm_main_item
* i_simulation = SPACE " char1
* i_xkonv_determine = SPACE " boole_d
* i_no_dialog = SPACE " char1
IMPORTING
e_vbeln = " vbak-vbeln
e_sdsm_main_item = " sdsm_main_item
e_komk = " komk
* TABLES
* fvbpakom = " vbpakom
* fsdsm_dli = " sdsm_dli Table with Item Information
* fxkonv = " konv Conditions (Transaction Data)
* fkomk = " komk Communication Header for Pricing
* fkomp = " komp Communication Item for Pricing
* fsdsm_main_item = " sdsm_main_item Main Item for Generating Sales Documents from Dynamic Items
* fsales_text = " bapisdtext Communication Fields: SD Texts
EXCEPTIONS
INCONSISTENT_IMPORT_PARAMETERS = 1 "
ERROR_OCCURRED = 2 " An error occurred during creation
. " SD_SALES_DOCUMENT_FROM_SM
The ABAP code below is a full code listing to execute function module SD_SALES_DOCUMENT_FROM_SM including all data declarations. The code uses 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 original method of declaring data variables up front. 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).
| ld_e_vbeln | TYPE VBAK-VBELN , |
| ld_e_sdsm_main_item | TYPE SDSM_MAIN_ITEM , |
| ld_e_komk | TYPE KOMK , |
| it_fvbpakom | TYPE STANDARD TABLE OF VBPAKOM,"TABLES PARAM |
| wa_fvbpakom | LIKE LINE OF it_fvbpakom , |
| it_fsdsm_dli | TYPE STANDARD TABLE OF SDSM_DLI,"TABLES PARAM |
| wa_fsdsm_dli | LIKE LINE OF it_fsdsm_dli , |
| it_fxkonv | TYPE STANDARD TABLE OF KONV,"TABLES PARAM |
| wa_fxkonv | LIKE LINE OF it_fxkonv , |
| it_fkomk | TYPE STANDARD TABLE OF KOMK,"TABLES PARAM |
| wa_fkomk | LIKE LINE OF it_fkomk , |
| it_fkomp | TYPE STANDARD TABLE OF KOMP,"TABLES PARAM |
| wa_fkomp | LIKE LINE OF it_fkomp , |
| it_fsdsm_main_item | TYPE STANDARD TABLE OF SDSM_MAIN_ITEM,"TABLES PARAM |
| wa_fsdsm_main_item | LIKE LINE OF it_fsdsm_main_item , |
| it_fsales_text | TYPE STANDARD TABLE OF BAPISDTEXT,"TABLES PARAM |
| wa_fsales_text | LIKE LINE OF it_fsales_text . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_e_vbeln | TYPE VBAK-VBELN , |
| ld_i_vbeln_v | TYPE VBAP-VBELN , |
| it_fvbpakom | TYPE STANDARD TABLE OF VBPAKOM , |
| wa_fvbpakom | LIKE LINE OF it_fvbpakom, |
| ld_e_sdsm_main_item | TYPE SDSM_MAIN_ITEM , |
| ld_i_vbeln | TYPE VBAP-VBELN , |
| it_fsdsm_dli | TYPE STANDARD TABLE OF SDSM_DLI , |
| wa_fsdsm_dli | LIKE LINE OF it_fsdsm_dli, |
| ld_e_komk | TYPE KOMK , |
| ld_i_sdsm_header | TYPE SDSM_HEADER , |
| it_fxkonv | TYPE STANDARD TABLE OF KONV , |
| wa_fxkonv | LIKE LINE OF it_fxkonv, |
| ld_i_sdsm_main_item | TYPE SDSM_MAIN_ITEM , |
| it_fkomk | TYPE STANDARD TABLE OF KOMK , |
| wa_fkomk | LIKE LINE OF it_fkomk, |
| ld_i_simulation | TYPE CHAR1 , |
| it_fkomp | TYPE STANDARD TABLE OF KOMP , |
| wa_fkomp | LIKE LINE OF it_fkomp, |
| ld_i_xkonv_determine | TYPE BOOLE_D , |
| it_fsdsm_main_item | TYPE STANDARD TABLE OF SDSM_MAIN_ITEM , |
| wa_fsdsm_main_item | LIKE LINE OF it_fsdsm_main_item, |
| ld_i_no_dialog | TYPE CHAR1 , |
| it_fsales_text | TYPE STANDARD TABLE OF BAPISDTEXT , |
| wa_fsales_text | LIKE LINE OF it_fsales_text. |
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SD_SALES_DOCUMENT_FROM_SM or its description.