Skip to Content
0

how to read a active cr data in flex mode

Jun 07, 2017 at 06:24 AM

113

avatar image
Former Member

plz let me know

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Pavan Bhamidipati Jun 07, 2017 at 06:46 AM
0

Hi,

Please find the below code

DATA lo_if_usmd_model TYPE REF TO if_usmd_model.
DATA lo_cl_usmd_model TYPE REF TO cl_usmd_model.
DATA lo_data TYPE REF TO data.
DATA lv_model TYPE usmd_model VALUE '0G'.
DATA lv_pl_flg TYPE wdy_boolean.
DATA lv_querymode TYPE usmd_querymode VALUE 2.
DATA ls_sel TYPE usmd_s_sel.
DATA lt_messages TYPE usmd_t_message.
DATA lt_sel TYPE usmd_ts_sel.
FIELD-SYMBOLS: <fs_t_data> TYPE ANY TABLE,
 <fs_s_data> TYPE any,
 <fs_v_val> TYPE any.
PARAMETERS: p_acc TYPE usmdz1_account,
 p_edtn TYPE usmd_edition.
CALL METHOD cl_usmd_model=>get_instance
 EXPORTING
 i_usmd_model = lv_model
 IMPORTING
 eo_instance = lo_if_usmd_model
 et_message = lt_messages.
lo_cl_usmd_model ?= lo_if_usmd_model.
CALL METHOD lo_cl_usmd_model->if_usmd_model_delta~create_data_reference
 EXPORTING
 i_fieldname = 'ACCOUNT'
 i_struct = 'KATTR'
 if_table = abap_true
 i_tabtype = 'S'
 RECEIVING
 er_data = lo_data.
ASSIGN lo_data->* TO <fs_t_data>.
*ACCOUNT
ls_sel-fieldname = 'ACCOUNT'.
ls_sel-low = p_acc.
ls_sel-option = 'EQ'.
ls_sel-sign = 'I'.
APPEND ls_sel TO lt_sel.
CALL METHOD lo_cl_usmd_model->if_usmd_model~query
 EXPORTING
 i_fieldname = 'ACCOUNT'
 it_sel = lt_sel
 i_querymode = lv_querymode
 if_use_edtn_slice = abap_false
 IMPORTING
 et_data = <fs_t_data>
 et_message = lt_messages.

You can also Make use of the READ_CHAR_VALUE of IF_USMD_MODEL in which you have the option to pass the ReadMode.

Make use of the CL_USMD_GOV_API . to read the CR Data.

Thanks, Pavan

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

thanks pavan

0

The usage of the CL_USMD_MODEL is actually forbidden. Please check the MDG Wiki -> Application Framework for details on using the different, public MDG APIs including examples.

0