SAP MDG: AR - How to make default value for Internal Logistics Data: Transportation Group

sowmya surekha manukonda's photo
·

1 min read


Scenario:

Process:

Code:

  METHOD if_ex_usmd_rule_service~derive_entity.


    DATA: lo_data TYPE REF TO data.
    FIELD-SYMBOLS : <ls_trans> TYPE any,
                    <lv_value> TYPE any.

    CREATE DATA lo_data LIKE LINE OF ct_data.

    ASSIGN lo_data TO <ls_trans>.
    IF lines( ct_data ) EQ 1.

      LOOP AT ct_data ASSIGNING <ls_trans>.
        ASSIGN COMPONENT 'TRAGR' OF STRUCTURE <ls_trans> TO FIELD-SYMBOL(<lv_tran>).
        IF <lv_tran> IS ASSIGNED.
          <lv_tran> = '0006'.
        ENDIF.
      ENDLOOP.
    ENDIF.

  ENDMETHOD.

Thank You :)