/AWS1/IF_CWL=>GETLOGFIELDS()¶
About GetLogFields¶
Discovers available fields for a specific data source and type. The response includes any field modifications introduced through pipelines, such as new fields or changed field types.
Method Signature¶
METHODS /AWS1/IF_CWL~GETLOGFIELDS
IMPORTING
!IV_DATASOURCENAME TYPE /AWS1/CWLDATASOURCENAME OPTIONAL
!IV_DATASOURCETYPE TYPE /AWS1/CWLDATASOURCETYPE OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_cwlgetlogfieldsrsp
RAISING
/AWS1/CX_CWLINVALIDPARAMETEREX
/AWS1/CX_CWLOPERATIONABORTEDEX
/AWS1/CX_CWLRESOURCENOTFOUNDEX
/AWS1/CX_CWLSERVICEUNAVAILEX
/AWS1/CX_CWLCLIENTEXC
/AWS1/CX_CWLSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_datasourcename TYPE /AWS1/CWLDATASOURCENAME /AWS1/CWLDATASOURCENAME¶
The name of the data source to retrieve log fields for.
iv_datasourcetype TYPE /AWS1/CWLDATASOURCETYPE /AWS1/CWLDATASOURCETYPE¶
The type of the data source to retrieve log fields for.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_cwlgetlogfieldsrsp /AWS1/CL_CWLGETLOGFIELDSRSP¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->getlogfields(
iv_datasourcename = |string|
iv_datasourcetype = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_logfields( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_logfieldname = lo_row_1->get_logfieldname( ).
lo_logfieldtype = lo_row_1->get_logfieldtype( ).
IF lo_logfieldtype IS NOT INITIAL.
lv_datatype = lo_logfieldtype->get_type( ).
lo_logfieldtype_1 = lo_logfieldtype->get_element( ).
IF lo_logfieldtype_1 IS NOT INITIAL.
lv_datatype = lo_logfieldtype_1->get_type( ).
" Skipping lo_logfieldtype->get_element( ) to avoid recursion
LOOP AT lo_logfieldtype_1->get_fields( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_logfieldname = lo_row_3->get_logfieldname( ).
" Skipping lo_row_2 to avoid recursion
ENDIF.
ENDLOOP.
ENDIF.
LOOP AT lo_logfieldtype->get_fields( ) into lo_row_2.
lo_row_3 = lo_row_2.
IF lo_row_3 IS NOT INITIAL.
lv_logfieldname = lo_row_3->get_logfieldname( ).
" Skipping lo_row_2 to avoid recursion
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.