
The GET_HISTORY_ID method of the service object determines a global history ID. Either a reference to a data object or an individual string as the history ID (history_txt) must also be passed 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) or a data object with direct reference to a data element ( DATA:var TYPE dtelname) can be passed.
| Importing Parameter: | |
| DATA_OBJECT_REF | Reference to a data object |
| HISTORY_TXT | History ID |
| Returning Parameter: | |
| HISTORY_ID | Global History ID |
| Exceptions: | |
| CX_BSP_SERVICES_PARAM | |
| CX_BSP_SERVICES_NOTFOUND | |
Event OnInitialization
* declaration
data: dataref type ref to data.
data: flightstruct type sflight.
* fill data reference
get reference of flightstruct-carrid into dataref.
* get global history id
try.
carrid_his = runtime->ddic_utils->get_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.Carrid'.
endtry.
Layout
<form method="post">
<input type="text"
name="carrid_value"
vcard_name=" <%=carrid_his%> "
value=" " />
<input type="submit"
name="OnInputValue(OK)"
value="OK"/>
</form>