RTTS is a great compact framework for dynamic programming approach. Sample code below shows how to get names and values of a structure components at runtime. "PERFORM get_fields" subroutine is ready to use. Values could be formatted by the help of type information provided.
DATA : ls_vekp TYPE vekp.
DATA : go_struct TYPE REF TO cl_abap_structdescr.
DATA : go_tc TYPE REF TO cl_abap_datadescr.
DATA : ls_comp TYPE abap_compdescr.
DATA : lv_value TYPE char255.
FIELD-SYMBOLS : .
SELECT SINGLE * FROM vekp INTO ls_vekp ...
PERFORM get_fields USING ls_vekp.
*&---------------------------------------------------------------------*
*& Form GET_FIELDS
*&---------------------------------------------------------------------*
FORM get_fields USING p_structure.
go_struct ?= cl_abap_typedescr=>describe_by_data( p_structure ).
LOOP AT go_struct->components INTO ls_comp.
CHECK ls_comp-name IS NOT INITIAL.
ASSIGN COMPONENT ls_comp-name OF STRUCTURE p_structure TO .
IF sy-subrc EQ 0.
lv_value = .
IF ls_comp-type_kind EQ cl_abap_typedescr=>typekind_date.
WRITE TO lv_value DD/MM/YYYY.
ENDIF.
IF ls_comp-type_kind EQ cl_abap_typedescr=>typekind_time.
WRITE TO lv_value.
ENDIF.
IF ls_comp-type_kind EQ cl_abap_typedescr=>typekind_decfloat OR
ls_comp-type_kind EQ cl_abap_typedescr=>typekind_decfloat16 OR
ls_comp-type_kind EQ cl_abap_typedescr=>typekind_decfloat34 OR
ls_comp-type_kind EQ cl_abap_typedescr=>typekind_packed.
WRITE TO lv_value DECIMALS 2 LEFT-JUSTIFIED.
ENDIF.
"ls_comp-name - FIELD NAME
"lv_value - FIELD VALUE
ENDIF.
ENDLOOP.
ENDFORM. " GET_FIELDS