Skip to Content
avatar image
Former Member

how to read a active cr data in flex mode

plz let me know

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 07, 2017 at 06:46 AM

    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

    Add comment
    10|10000 characters needed characters exceeded