SAP Function Modules

BS01_QUOTATION_CREATE SAP Function module - Quoation: Create with BOS







BS01_QUOTATION_CREATE 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 BS01_QUOTATION_CREATE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: BOS01
Released Date: 25.06.2001
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BS01_QUOTATION_CREATE - BS01 QUOTATION CREATE





CALL FUNCTION 'BS01_QUOTATION_CREATE' "Quoation: Create with BOS
  EXPORTING
*   salesdocument =             " bapivbeln-vbeln  Quotation Number
    quotation_header_in =       " bapisdhd1     Document Header Data
*   quotation_header_inx =      " bapisdhd1x    Checkbox for header data
*   sender =                    " bapi_sender   Logical system - Sender
*   binary_relationshiptype = SPACE  " breltyp-reltype  Binary Relationship Type (Private)
*   int_number_assignment = SPACE  " bapiflag-bapiflag  Internal item number assignment
*   behave_when_error = SPACE   " bapiflag-bapiflag  Error Handling
*   logic_switch = SPACE        " bapisdls      Internal control parameter
*   testrun =                   " bapiflag-bapiflag  Test run
  IMPORTING
    salesdocument_ex =          " bapivbeln-vbeln  Number of Generated Document
  TABLES
    return =                    " bapiret2      Return Messages
*   quotation_items_in =        " bapisditmbos  Item Data
*   quotation_items_inx =       " bapisditmxbos  Checkbox Item Data
*   quotation_partners =        " bapiparnr     Document partner
*   quotation_schedules_in =    " bapischdl     Schedule line data
*   quotation_schedules_inx =   " bapischdlx    Checkbox Schedule Line Data
*   quotation_conditions_in =   " bapicond      Conditions
*   quotation_cfgs_ref =        " bapicucfg     Configuration: Reference data
*   quotation_cfgs_inst =       " bapicuins     Configuration: Instances
*   quotation_cfgs_part_of =    " bapicuprt     Configuration: Part-of specifications
*   quotation_cfgs_value =      " bapicuval     Configuration: Characteristic values
*   quotation_cfgs_blob =       " bapicublb     Configuration: BLOB internal data (SCE)
*   quotation_cfgs_vk =         " bapicuvk      Configuration: Variant condition key
*   quotation_cfgs_refinst =    " bapicuref     Configuration: Reference item / instance
*   quotation_text =            " bapisdtext    Texts
*   quotation_keys =            " bapisdkey     Output Table of Reference Keys
*   extensionin =               " bapiparex     Customer Enhancment Import
*   quotation_services =        " bapisdesllcbos  Services
*   quotation_services_text =   " bapieslltx    Service Line Text
*   quotation_services_cond =   " bapiboscd     Service Line Conditions
    .  "  BS01_QUOTATION_CREATE

ABAP code example for Function Module BS01_QUOTATION_CREATE





The ABAP code below is a full code listing to execute function module BS01_QUOTATION_CREATE 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).

DATA:
ld_salesdocument_ex  TYPE BAPIVBELN-VBELN ,
it_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_return  LIKE LINE OF it_return ,
it_quotation_items_in  TYPE STANDARD TABLE OF BAPISDITMBOS,"TABLES PARAM
wa_quotation_items_in  LIKE LINE OF it_quotation_items_in ,
it_quotation_items_inx  TYPE STANDARD TABLE OF BAPISDITMXBOS,"TABLES PARAM
wa_quotation_items_inx  LIKE LINE OF it_quotation_items_inx ,
it_quotation_partners  TYPE STANDARD TABLE OF BAPIPARNR,"TABLES PARAM
wa_quotation_partners  LIKE LINE OF it_quotation_partners ,
it_quotation_schedules_in  TYPE STANDARD TABLE OF BAPISCHDL,"TABLES PARAM
wa_quotation_schedules_in  LIKE LINE OF it_quotation_schedules_in ,
it_quotation_schedules_inx  TYPE STANDARD TABLE OF BAPISCHDLX,"TABLES PARAM
wa_quotation_schedules_inx  LIKE LINE OF it_quotation_schedules_inx ,
it_quotation_conditions_in  TYPE STANDARD TABLE OF BAPICOND,"TABLES PARAM
wa_quotation_conditions_in  LIKE LINE OF it_quotation_conditions_in ,
it_quotation_cfgs_ref  TYPE STANDARD TABLE OF BAPICUCFG,"TABLES PARAM
wa_quotation_cfgs_ref  LIKE LINE OF it_quotation_cfgs_ref ,
it_quotation_cfgs_inst  TYPE STANDARD TABLE OF BAPICUINS,"TABLES PARAM
wa_quotation_cfgs_inst  LIKE LINE OF it_quotation_cfgs_inst ,
it_quotation_cfgs_part_of  TYPE STANDARD TABLE OF BAPICUPRT,"TABLES PARAM
wa_quotation_cfgs_part_of  LIKE LINE OF it_quotation_cfgs_part_of ,
it_quotation_cfgs_value  TYPE STANDARD TABLE OF BAPICUVAL,"TABLES PARAM
wa_quotation_cfgs_value  LIKE LINE OF it_quotation_cfgs_value ,
it_quotation_cfgs_blob  TYPE STANDARD TABLE OF BAPICUBLB,"TABLES PARAM
wa_quotation_cfgs_blob  LIKE LINE OF it_quotation_cfgs_blob ,
it_quotation_cfgs_vk  TYPE STANDARD TABLE OF BAPICUVK,"TABLES PARAM
wa_quotation_cfgs_vk  LIKE LINE OF it_quotation_cfgs_vk ,
it_quotation_cfgs_refinst  TYPE STANDARD TABLE OF BAPICUREF,"TABLES PARAM
wa_quotation_cfgs_refinst  LIKE LINE OF it_quotation_cfgs_refinst ,
it_quotation_text  TYPE STANDARD TABLE OF BAPISDTEXT,"TABLES PARAM
wa_quotation_text  LIKE LINE OF it_quotation_text ,
it_quotation_keys  TYPE STANDARD TABLE OF BAPISDKEY,"TABLES PARAM
wa_quotation_keys  LIKE LINE OF it_quotation_keys ,
it_extensionin  TYPE STANDARD TABLE OF BAPIPAREX,"TABLES PARAM
wa_extensionin  LIKE LINE OF it_extensionin ,
it_quotation_services  TYPE STANDARD TABLE OF BAPISDESLLCBOS,"TABLES PARAM
wa_quotation_services  LIKE LINE OF it_quotation_services ,
it_quotation_services_text  TYPE STANDARD TABLE OF BAPIESLLTX,"TABLES PARAM
wa_quotation_services_text  LIKE LINE OF it_quotation_services_text ,
it_quotation_services_cond  TYPE STANDARD TABLE OF BAPIBOSCD,"TABLES PARAM
wa_quotation_services_cond  LIKE LINE OF it_quotation_services_cond .


DATA(ld_salesdocument) = some text here
DATA(ld_quotation_header_in) = 'Check type of data required'.
DATA(ld_quotation_header_inx) = 'Check type of data required'.
DATA(ld_sender) = 'Check type of data required'.

DATA(ld_binary_relationshiptype) = some text here

DATA(ld_int_number_assignment) = some text here

DATA(ld_behave_when_error) = some text here
DATA(ld_logic_switch) = 'Check type of data required'.

DATA(ld_testrun) = some text here

"populate fields of struture and append to itab
append wa_return to it_return.

"populate fields of struture and append to itab
append wa_quotation_items_in to it_quotation_items_in.

"populate fields of struture and append to itab
append wa_quotation_items_inx to it_quotation_items_inx.

"populate fields of struture and append to itab
append wa_quotation_partners to it_quotation_partners.

"populate fields of struture and append to itab
append wa_quotation_schedules_in to it_quotation_schedules_in.

"populate fields of struture and append to itab
append wa_quotation_schedules_inx to it_quotation_schedules_inx.

"populate fields of struture and append to itab
append wa_quotation_conditions_in to it_quotation_conditions_in.

"populate fields of struture and append to itab
append wa_quotation_cfgs_ref to it_quotation_cfgs_ref.

"populate fields of struture and append to itab
append wa_quotation_cfgs_inst to it_quotation_cfgs_inst.

"populate fields of struture and append to itab
append wa_quotation_cfgs_part_of to it_quotation_cfgs_part_of.

"populate fields of struture and append to itab
append wa_quotation_cfgs_value to it_quotation_cfgs_value.

"populate fields of struture and append to itab
append wa_quotation_cfgs_blob to it_quotation_cfgs_blob.

"populate fields of struture and append to itab
append wa_quotation_cfgs_vk to it_quotation_cfgs_vk.

"populate fields of struture and append to itab
append wa_quotation_cfgs_refinst to it_quotation_cfgs_refinst.

"populate fields of struture and append to itab
append wa_quotation_text to it_quotation_text.

"populate fields of struture and append to itab
append wa_quotation_keys to it_quotation_keys.

"populate fields of struture and append to itab
append wa_extensionin to it_extensionin.

"populate fields of struture and append to itab
append wa_quotation_services to it_quotation_services.

"populate fields of struture and append to itab
append wa_quotation_services_text to it_quotation_services_text.

"populate fields of struture and append to itab
append wa_quotation_services_cond to it_quotation_services_cond. . CALL FUNCTION 'BS01_QUOTATION_CREATE' EXPORTING * salesdocument = ld_salesdocument quotation_header_in = ld_quotation_header_in * quotation_header_inx = ld_quotation_header_inx * sender = ld_sender * binary_relationshiptype = ld_binary_relationshiptype * int_number_assignment = ld_int_number_assignment * behave_when_error = ld_behave_when_error * logic_switch = ld_logic_switch * testrun = ld_testrun IMPORTING salesdocument_ex = ld_salesdocument_ex TABLES return = it_return * quotation_items_in = it_quotation_items_in * quotation_items_inx = it_quotation_items_inx * quotation_partners = it_quotation_partners * quotation_schedules_in = it_quotation_schedules_in * quotation_schedules_inx = it_quotation_schedules_inx * quotation_conditions_in = it_quotation_conditions_in * quotation_cfgs_ref = it_quotation_cfgs_ref * quotation_cfgs_inst = it_quotation_cfgs_inst * quotation_cfgs_part_of = it_quotation_cfgs_part_of * quotation_cfgs_value = it_quotation_cfgs_value * quotation_cfgs_blob = it_quotation_cfgs_blob * quotation_cfgs_vk = it_quotation_cfgs_vk * quotation_cfgs_refinst = it_quotation_cfgs_refinst * quotation_text = it_quotation_text * quotation_keys = it_quotation_keys * extensionin = it_extensionin * quotation_services = it_quotation_services * quotation_services_text = it_quotation_services_text * quotation_services_cond = it_quotation_services_cond . " BS01_QUOTATION_CREATE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

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_salesdocument_ex  TYPE BAPIVBELN-VBELN ,
ld_salesdocument  TYPE BAPIVBELN-VBELN ,
it_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_return  LIKE LINE OF it_return,
ld_quotation_header_in  TYPE BAPISDHD1 ,
it_quotation_items_in  TYPE STANDARD TABLE OF BAPISDITMBOS ,
wa_quotation_items_in  LIKE LINE OF it_quotation_items_in,
ld_quotation_header_inx  TYPE BAPISDHD1X ,
it_quotation_items_inx  TYPE STANDARD TABLE OF BAPISDITMXBOS ,
wa_quotation_items_inx  LIKE LINE OF it_quotation_items_inx,
ld_sender  TYPE BAPI_SENDER ,
it_quotation_partners  TYPE STANDARD TABLE OF BAPIPARNR ,
wa_quotation_partners  LIKE LINE OF it_quotation_partners,
it_quotation_schedules_in  TYPE STANDARD TABLE OF BAPISCHDL ,
wa_quotation_schedules_in  LIKE LINE OF it_quotation_schedules_in,
ld_binary_relationshiptype  TYPE BRELTYP-RELTYPE ,
ld_int_number_assignment  TYPE BAPIFLAG-BAPIFLAG ,
it_quotation_schedules_inx  TYPE STANDARD TABLE OF BAPISCHDLX ,
wa_quotation_schedules_inx  LIKE LINE OF it_quotation_schedules_inx,
ld_behave_when_error  TYPE BAPIFLAG-BAPIFLAG ,
it_quotation_conditions_in  TYPE STANDARD TABLE OF BAPICOND ,
wa_quotation_conditions_in  LIKE LINE OF it_quotation_conditions_in,
ld_logic_switch  TYPE BAPISDLS ,
it_quotation_cfgs_ref  TYPE STANDARD TABLE OF BAPICUCFG ,
wa_quotation_cfgs_ref  LIKE LINE OF it_quotation_cfgs_ref,
ld_testrun  TYPE BAPIFLAG-BAPIFLAG ,
it_quotation_cfgs_inst  TYPE STANDARD TABLE OF BAPICUINS ,
wa_quotation_cfgs_inst  LIKE LINE OF it_quotation_cfgs_inst,
it_quotation_cfgs_part_of  TYPE STANDARD TABLE OF BAPICUPRT ,
wa_quotation_cfgs_part_of  LIKE LINE OF it_quotation_cfgs_part_of,
it_quotation_cfgs_value  TYPE STANDARD TABLE OF BAPICUVAL ,
wa_quotation_cfgs_value  LIKE LINE OF it_quotation_cfgs_value,
it_quotation_cfgs_blob  TYPE STANDARD TABLE OF BAPICUBLB ,
wa_quotation_cfgs_blob  LIKE LINE OF it_quotation_cfgs_blob,
it_quotation_cfgs_vk  TYPE STANDARD TABLE OF BAPICUVK ,
wa_quotation_cfgs_vk  LIKE LINE OF it_quotation_cfgs_vk,
it_quotation_cfgs_refinst  TYPE STANDARD TABLE OF BAPICUREF ,
wa_quotation_cfgs_refinst  LIKE LINE OF it_quotation_cfgs_refinst,
it_quotation_text  TYPE STANDARD TABLE OF BAPISDTEXT ,
wa_quotation_text  LIKE LINE OF it_quotation_text,
it_quotation_keys  TYPE STANDARD TABLE OF BAPISDKEY ,
wa_quotation_keys  LIKE LINE OF it_quotation_keys,
it_extensionin  TYPE STANDARD TABLE OF BAPIPAREX ,
wa_extensionin  LIKE LINE OF it_extensionin,
it_quotation_services  TYPE STANDARD TABLE OF BAPISDESLLCBOS ,
wa_quotation_services  LIKE LINE OF it_quotation_services,
it_quotation_services_text  TYPE STANDARD TABLE OF BAPIESLLTX ,
wa_quotation_services_text  LIKE LINE OF it_quotation_services_text,
it_quotation_services_cond  TYPE STANDARD TABLE OF BAPIBOSCD ,
wa_quotation_services_cond  LIKE LINE OF it_quotation_services_cond.


ld_salesdocument = some text here

"populate fields of struture and append to itab
append wa_return to it_return.
ld_quotation_header_in = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_quotation_items_in to it_quotation_items_in.
ld_quotation_header_inx = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_quotation_items_inx to it_quotation_items_inx.
ld_sender = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_quotation_partners to it_quotation_partners.

"populate fields of struture and append to itab
append wa_quotation_schedules_in to it_quotation_schedules_in.

ld_binary_relationshiptype = some text here

ld_int_number_assignment = some text here

"populate fields of struture and append to itab
append wa_quotation_schedules_inx to it_quotation_schedules_inx.

ld_behave_when_error = some text here

"populate fields of struture and append to itab
append wa_quotation_conditions_in to it_quotation_conditions_in.
ld_logic_switch = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_quotation_cfgs_ref to it_quotation_cfgs_ref.

ld_testrun = some text here

"populate fields of struture and append to itab
append wa_quotation_cfgs_inst to it_quotation_cfgs_inst.

"populate fields of struture and append to itab
append wa_quotation_cfgs_part_of to it_quotation_cfgs_part_of.

"populate fields of struture and append to itab
append wa_quotation_cfgs_value to it_quotation_cfgs_value.

"populate fields of struture and append to itab
append wa_quotation_cfgs_blob to it_quotation_cfgs_blob.

"populate fields of struture and append to itab
append wa_quotation_cfgs_vk to it_quotation_cfgs_vk.

"populate fields of struture and append to itab
append wa_quotation_cfgs_refinst to it_quotation_cfgs_refinst.

"populate fields of struture and append to itab
append wa_quotation_text to it_quotation_text.

"populate fields of struture and append to itab
append wa_quotation_keys to it_quotation_keys.

"populate fields of struture and append to itab
append wa_extensionin to it_extensionin.

"populate fields of struture and append to itab
append wa_quotation_services to it_quotation_services.

"populate fields of struture and append to itab
append wa_quotation_services_text to it_quotation_services_text.

"populate fields of struture and append to itab
append wa_quotation_services_cond to it_quotation_services_cond.

SAP Documentation for FM BS01_QUOTATION_CREATE


You can use this function module to create customer quotations that contain a BOS. ...See here for full SAP fm documentation

Contribute (Add Comments)

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 BS01_QUOTATION_CREATE or its description.