cancel
Showing results for 
Search instead for 
Did you mean: 

Class for reading the Staging tables in MDG material

Former Member
0 Kudos

Hi Everyone,

          

           Do we have any method to read class and characteristics values from staging tables?

           any sample code.....

Regards,

Bhuvaneswari

Accepted Solutions (0)

Answers (1)

Answers (1)

henk_verdaasdonk4
Active Participant
0 Kudos

Hi Bhuvaneswari,

Best is to use the MDG Convenience API - CL_USMD_CONV_SOM_GOV_API. Examples are described in the API guid:

For material model class CL_MDG_BS_MAT_BO could also be very handy. In your case READ_SA.

Henk

Former Member
0 Kudos

Hi Henk,

we have implemented the BADI in BAdI: Derivations Across Entity Types,  we are using below method to read data but  it is returning the data only after completion of two round trip but we need to read data in single round trip.

CALL METHOD io_model->read_char_value

     EXPORTING

       i_fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_valuation

       i_readmode  = if_usmd_model_ext=>GC_READMODE_DEFAULT

       it_sel      = lt_sel

     IMPORTING

       et_data     = <lt_data_valuation>

       et_message  = lt_usmd_message.


To achieve this do we have any class/interface?

Regards,

Bhuvaneswari

henk_verdaasdonk4
Active Participant
0 Kudos

Hi Bhuvaneswari,

And if you use:   i_readmode  = if_usmd_model_ext=>gc_readmode_all_inact?

Else try:

TRY.
    cl_usmd_gov_api=>get_instance( iv_model_name = 'MM' )->
get_crequest_data

( EXPORTING   iv_crequest_id          = id_crequest

    IMPORTING   et_entity_data_inactive = lts_data_entity ).

  CATCH cx_usmd_gov_api.
* Your handling
ENDTRY.

henk.