Aller au contenu

Abap - Ajouter lignes en DEV dans un aDso

REPORT ztstcra2.

DATA: lt_data TYPE STANDARD TABLE OF /bic/azfi_a0272,
lt_msg  TYPE rs_t_msg.

APPEND VALUE #( bill_num = '0000000001'
                bill_item = '000001'
                calday = '20250101'
                /bic/zkn_zc04 = '12'
                doc_currcy = 'EUR'
                loc_currcy = 'EUR') 
        TO lt_data.

CALL FUNCTION 'RSDSO_WRITE_API'
    EXPORTING
        i_adsonm            = 'ZFI_A027'
        i_allow_new_sids    = 'X'
        i_activate_data = 'X'
        it_data             = lt_data
    IMPORTING
        et_msg              = lt_msg
    EXCEPTIONS
        write_failed        = 1
        datastore_not_found = 2
        OTHERS              = 3.

IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

cl_demo_output=>display(
    EXPORTING
        data = lt_msg).