SAP Function Modules

SPH_SOFTPHONE SAP Function module







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

Associated Function Group: PHOS
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SPH_SOFTPHONE - SPH SOFTPHONE





CALL FUNCTION 'SPH_SOFTPHONE' "
* EXPORTING
*   number =                    " sph_telno     SAPphone: Telephone numbers with name and description
*   address =                   " addr_key      Structure with Reference Key Fields and Address Type
*   handle =                    " sp_handle     Call identifier assigned by WS software
*   action =                    "
* TABLES
*   alternative_numbers =       " sph_telno     SAPphone: Telephone numbers with name and description
*   alternative_addresses =     " addr_key      Structure with Reference Key Fields and Address Type
*   additional_fields =         " sphfields     Structure for transferring field names and values
*   callstate =                 " sph_tcstat    SAPphone: Call Overview for all the DNs of a Work Center
*   calldata =                  " sph_iocont    SAPphone: Container for information object
  EXCEPTIONS
    ERROR_CONFIGURATION = 1     "
    ERROR_IMC_MODE_CREATION = 2  "
    .  "  SPH_SOFTPHONE

ABAP code example for Function Module SPH_SOFTPHONE





The ABAP code below is a full code listing to execute function module SPH_SOFTPHONE 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:
it_alternative_numbers  TYPE STANDARD TABLE OF SPH_TELNO,"TABLES PARAM
wa_alternative_numbers  LIKE LINE OF it_alternative_numbers ,
it_alternative_addresses  TYPE STANDARD TABLE OF ADDR_KEY,"TABLES PARAM
wa_alternative_addresses  LIKE LINE OF it_alternative_addresses ,
it_additional_fields  TYPE STANDARD TABLE OF SPHFIELDS,"TABLES PARAM
wa_additional_fields  LIKE LINE OF it_additional_fields ,
it_callstate  TYPE STANDARD TABLE OF SPH_TCSTAT,"TABLES PARAM
wa_callstate  LIKE LINE OF it_callstate ,
it_calldata  TYPE STANDARD TABLE OF SPH_IOCONT,"TABLES PARAM
wa_calldata  LIKE LINE OF it_calldata .

DATA(ld_number) = 'Check type of data required'.
DATA(ld_address) = 'Check type of data required'.
DATA(ld_handle) = 'Check type of data required'.
DATA(ld_action) = 'some text here'.

"populate fields of struture and append to itab
append wa_alternative_numbers to it_alternative_numbers.

"populate fields of struture and append to itab
append wa_alternative_addresses to it_alternative_addresses.

"populate fields of struture and append to itab
append wa_additional_fields to it_additional_fields.

"populate fields of struture and append to itab
append wa_callstate to it_callstate.

"populate fields of struture and append to itab
append wa_calldata to it_calldata. . CALL FUNCTION 'SPH_SOFTPHONE' * EXPORTING * number = ld_number * address = ld_address * handle = ld_handle * action = ld_action * TABLES * alternative_numbers = it_alternative_numbers * alternative_addresses = it_alternative_addresses * additional_fields = it_additional_fields * callstate = it_callstate * calldata = it_calldata EXCEPTIONS ERROR_CONFIGURATION = 1 ERROR_IMC_MODE_CREATION = 2 . " SPH_SOFTPHONE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here 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_number  TYPE SPH_TELNO ,
it_alternative_numbers  TYPE STANDARD TABLE OF SPH_TELNO ,
wa_alternative_numbers  LIKE LINE OF it_alternative_numbers,
ld_address  TYPE ADDR_KEY ,
it_alternative_addresses  TYPE STANDARD TABLE OF ADDR_KEY ,
wa_alternative_addresses  LIKE LINE OF it_alternative_addresses,
ld_handle  TYPE SP_HANDLE ,
it_additional_fields  TYPE STANDARD TABLE OF SPHFIELDS ,
wa_additional_fields  LIKE LINE OF it_additional_fields,
ld_action  TYPE STRING ,
it_callstate  TYPE STANDARD TABLE OF SPH_TCSTAT ,
wa_callstate  LIKE LINE OF it_callstate,
it_calldata  TYPE STANDARD TABLE OF SPH_IOCONT ,
wa_calldata  LIKE LINE OF it_calldata.

ld_number = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_alternative_numbers to it_alternative_numbers.
ld_address = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_alternative_addresses to it_alternative_addresses.
ld_handle = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_additional_fields to it_additional_fields.
ld_action = 'some text here'.

"populate fields of struture and append to itab
append wa_callstate to it_callstate.

"populate fields of struture and append to itab
append wa_calldata to it_calldata.

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