Hi Community.
I have a little problem and hope i can solve it with your help :)
I am creating a debit memo request with FM "SD_SALESDOCUMENT_CREATE".
Actually it is working but when i look under the tab i have no assignment to my contract

If i try it without bapi (transaction va01) i have an assignmen to the contract (sales order)t:

Item
ls_items = VALUE #( material = <outtab>-matnr
target_qty = <outtab>-menge
target_qu = <outtab>-meins
ref_doc = <outtab>-kontrakt
ref_doc_it = <outtab>-posnr
ref_doc_ca = 'G'
itm_number = <outtab>-posnr ).
ls_itemx = VALUE #( material = abap_true
target_qty = abap_true
target_qu = abap_true
ref_doc = abap_true
ref_doc_it = abap_true
ref_doc_ca = abap_true
itm_number = abap_true ).
Header
"Header
ls_header-doc_type = <outtab>-fkart.
ls_header-sales_org = <outtab>-vkorg.
ls_header-distr_chan = '01'.
ls_header-division = '01'.
ls_header-bill_date = <outtab>-budat.
ls_header-ref_doc = <outtab>-kontrakt.
ls_header-refdoc_cat = 'G'.
ls_header-ord_reason = <outtab>-augru.
ls_headerx-doc_type = abap_true.
ls_headerx-sales_org = abap_true.
ls_headerx-distr_chan = abap_true.
ls_headerx-division = abap_true.
ls_headerx-bill_date = abap_true.
ls_headerx-ref_doc = abap_true.
ls_headerx-refdoc_cat = abap_true.
ls_headerx-ord_reason = abap_true.
Hope you can help me :)
Thanks