1 1 1 1 1 Rating 0% (0 Votes)
We've got method to convert internal value to float, now it's time for next one which I didn't suppose it would be needed but when I was calling CTMS_DDB_SET_VALUE_ONLINE to show input screen with previously filled data by CTMS_DDB_SET_VALUE_INTERNAL then for multiple value characteristic I was always receiving one additional line to these which was passed by me in export parameters. The funny thing was that it wasn't the case when CTMS_DDB_SET_VAL_FROM_OBJECT was used. Of course this line was initial but the values were treated after as imputed by user. So as always I started to debug the code to see why it's happening. Finally I found that internal table WS in the function group CTMS was not refreshed during the call of CTMS_DDB_SET_VALUE_INTERNAL
As I couldn't refresh it in any call of FM from this function group I had to use old trick with assignment of data from program in memory. But firstly I check with FM CTMS_DDB_HAS_VALUES_INTERNAL if any values are already there.

IT_API_CHAR TYPE TT_API_CHAR -> Table type for structure api_char_tab


  method clear_initial_line_api_vari.

    field-symbols<ws> type any table.
    datamt_api_vali type  tt_api_vali.
    dataf_name type string value '(SAPLCTMS)WS[]'.
    call function 'CTMS_DDB_HAS_VALUES_INTERNAL'
        assigned_values      'X'
        allowed_values       ' '
        valid_values         ' '
        inconsistent_values  ' '
        first_assigned_value ' '
        default_values       ''
        language             sy-langu
        document_info        ' '
        excl_knowledge       ' '
        i_called_from_ddb    ' '
        imp_characteristics  it_api_char[]
        not_found            1
        others               2.
    if sy-subrc eq 0.
      assign (f_nameto <ws>.
      if sy-subrc eq 0.
        refresh <ws>.

  endmethod.                    "clear_initial_line_api_vari