Show TOC

GET_LOCAL_HISTORY_IDLocate this document in the navigation structure

Use

The GET_LOCAL_HISTORY_ID method of the service object determines a local history ID. Either one reference to a data object or an individual string as history ID (history_txt) must also be transferred as the importing parameter. If a data object is specified, this must have a direct or indirect reference to an elementary dictionary type (data element), since the parameter ID specified for this data element is used as the history ID. For example, a reference to a data object with a reference to an elementary component of a dictionary structure ( DATA: var TYPE strucname-compname) could be passed, or a data object with direct reference to a data element ( DATA: var TYPE dtelname).

Features

Parameters and Exceptions

Importing Parameter:
DATA_OBJECT_REF Reference to a data object
HISTORY_TXT History ID
Returning Parameter:
HISTORY_ID Local history ID
Exceptions:
CX_BSP_SERVICES_PARAM
CX_BSP_SERVICES_NOTFOUND
Example

Event OnInitialization

* declaration

data: dataref type ref to data.
data: flightstruct type sflight.

* fill data reference

get reference of flightstruct-carrid into dataref.

* get local history id

try.

    carrid_local_his   = runtime->ddic_utils->get_local_history_id(
                         data_object_ref    = dataref ).
catch cx_bsp_services into l_ex_services.

*   catch exception into message object

    errortext = l_ex_services->get_text( ).
    call method messages->add_message
         exporting condition = 'HISTORY_ID'
                   message = errortext
                   severity = CL_BSP_MESSAGES=>CO_SEVERITY_ERROR.
    carrid_his = 'sap.myapplication.carrid'.

endtry.

            

Layout

<form method="post">
 <input type="text" 
             name="carrid_value" 
             vcard_name=" <%=carrid_local_his%> " 
             value=" " />

<input type="submit" 
               name="OnInputValue(OK)" 
               value="OK"/>
</form>

            
More Information