applies to document no in sales credit memo is blank why

When i want to return invoiced sales order it is accept to return order and applied to doc no is blank and applies document type is blank.

I think the posted invoiced is not applies so that i make the following steps :

1- go to Vendor card select Vendor no no to invoice i need to return

2-select vendor ledger entries then select purchase invoice no

3- press function apply entries

4-then go to return order form i select function copy document then document type : posted invoice then i write posted purchase invoice

5-then ok then i see applies to document no applies to document type also is blank

what is wrong in my steps

please help me

this is my picture

Im sorry for mention sales this post related to purchasing invoiced purchase order not sales