SAP Function Modules

CRM_CS_API_ORDER_CREATE SAP Function module







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

Associated Function Group: CRM_CS_API_ORDER
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM CRM_CS_API_ORDER_CREATE - CRM CS API ORDER CREATE





CALL FUNCTION 'CRM_CS_API_ORDER_CREATE' "
  EXPORTING
    i_caufvd =                  " caufvd
*   i_pmsdo =                   " pmsdo
*   i_post = 'X'                " riwo00-selec
*   i_commit = 'X'              " riwo00-selec
*   i_wait = 'X'                " riwo00-selec
*   i_calc_prio = ' '           " riwo00-selec
*   i_upd_key_ref = 'X'         " riwo00-selec
  IMPORTING
    e_caufvd =                  " caufvd
* TABLES
*   te_return =                 " bapiret2
*   ti_afvgd =                  " csapi_afvgd
*   ti_ihpa =                   " ihpa
*   ti_tline =                  " csapi_tline
*   ti_vbadr =                  " vbadr
*   t_key_ref =                 " csapi_order_links
    .  "  CRM_CS_API_ORDER_CREATE

ABAP code example for Function Module CRM_CS_API_ORDER_CREATE





The ABAP code below is a full code listing to execute function module CRM_CS_API_ORDER_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_e_caufvd  TYPE CAUFVD ,
it_te_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_te_return  LIKE LINE OF it_te_return ,
it_ti_afvgd  TYPE STANDARD TABLE OF CSAPI_AFVGD,"TABLES PARAM
wa_ti_afvgd  LIKE LINE OF it_ti_afvgd ,
it_ti_ihpa  TYPE STANDARD TABLE OF IHPA,"TABLES PARAM
wa_ti_ihpa  LIKE LINE OF it_ti_ihpa ,
it_ti_tline  TYPE STANDARD TABLE OF CSAPI_TLINE,"TABLES PARAM
wa_ti_tline  LIKE LINE OF it_ti_tline ,
it_ti_vbadr  TYPE STANDARD TABLE OF VBADR,"TABLES PARAM
wa_ti_vbadr  LIKE LINE OF it_ti_vbadr ,
it_t_key_ref  TYPE STANDARD TABLE OF CSAPI_ORDER_LINKS,"TABLES PARAM
wa_t_key_ref  LIKE LINE OF it_t_key_ref .

DATA(ld_i_caufvd) = 'Check type of data required'.
DATA(ld_i_pmsdo) = 'Check type of data required'.

DATA(ld_i_post) = some text here

DATA(ld_i_commit) = some text here

DATA(ld_i_wait) = some text here

DATA(ld_i_calc_prio) = some text here

DATA(ld_i_upd_key_ref) = some text here

"populate fields of struture and append to itab
append wa_te_return to it_te_return.

"populate fields of struture and append to itab
append wa_ti_afvgd to it_ti_afvgd.

"populate fields of struture and append to itab
append wa_ti_ihpa to it_ti_ihpa.

"populate fields of struture and append to itab
append wa_ti_tline to it_ti_tline.

"populate fields of struture and append to itab
append wa_ti_vbadr to it_ti_vbadr.

"populate fields of struture and append to itab
append wa_t_key_ref to it_t_key_ref. . CALL FUNCTION 'CRM_CS_API_ORDER_CREATE' EXPORTING i_caufvd = ld_i_caufvd * i_pmsdo = ld_i_pmsdo * i_post = ld_i_post * i_commit = ld_i_commit * i_wait = ld_i_wait * i_calc_prio = ld_i_calc_prio * i_upd_key_ref = ld_i_upd_key_ref IMPORTING e_caufvd = ld_e_caufvd * TABLES * te_return = it_te_return * ti_afvgd = it_ti_afvgd * ti_ihpa = it_ti_ihpa * ti_tline = it_ti_tline * ti_vbadr = it_ti_vbadr * t_key_ref = it_t_key_ref . " CRM_CS_API_ORDER_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_e_caufvd  TYPE CAUFVD ,
ld_i_caufvd  TYPE CAUFVD ,
it_te_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_te_return  LIKE LINE OF it_te_return,
ld_i_pmsdo  TYPE PMSDO ,
it_ti_afvgd  TYPE STANDARD TABLE OF CSAPI_AFVGD ,
wa_ti_afvgd  LIKE LINE OF it_ti_afvgd,
ld_i_post  TYPE RIWO00-SELEC ,
it_ti_ihpa  TYPE STANDARD TABLE OF IHPA ,
wa_ti_ihpa  LIKE LINE OF it_ti_ihpa,
ld_i_commit  TYPE RIWO00-SELEC ,
it_ti_tline  TYPE STANDARD TABLE OF CSAPI_TLINE ,
wa_ti_tline  LIKE LINE OF it_ti_tline,
ld_i_wait  TYPE RIWO00-SELEC ,
it_ti_vbadr  TYPE STANDARD TABLE OF VBADR ,
wa_ti_vbadr  LIKE LINE OF it_ti_vbadr,
ld_i_calc_prio  TYPE RIWO00-SELEC ,
it_t_key_ref  TYPE STANDARD TABLE OF CSAPI_ORDER_LINKS ,
wa_t_key_ref  LIKE LINE OF it_t_key_ref,
ld_i_upd_key_ref  TYPE RIWO00-SELEC .

ld_i_caufvd = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_te_return to it_te_return.
ld_i_pmsdo = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ti_afvgd to it_ti_afvgd.

ld_i_post = some text here

"populate fields of struture and append to itab
append wa_ti_ihpa to it_ti_ihpa.

ld_i_commit = some text here

"populate fields of struture and append to itab
append wa_ti_tline to it_ti_tline.

ld_i_wait = some text here

"populate fields of struture and append to itab
append wa_ti_vbadr to it_ti_vbadr.

ld_i_calc_prio = some text here

"populate fields of struture and append to itab
append wa_t_key_ref to it_t_key_ref.

ld_i_upd_key_ref = some text here

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