Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Attachments from T-code VF03

0 Kudos
1,332

Hi folks,

I have a requirement to download all the attachments from T-code VF03 into my 'Z' program, I searched SDN a lot and I came to know that FM 'SO_OBJECT_READ' can be of some help. However, I could not understand how exactly I need to pass the parameters to it. Can I get some help how to use the FM 'SO_OBJECT_READ' or if there is any other way to download the attachments from VF03 into custom program?

Regards,

Rishi

1 REPLY 1

Former Member
0 Kudos
212

Hello Rishi,

You can try something like this -


***    get the selected invoice
    read table t_final into w_final index e_row_id-index.
    clear pdf.
**    get the documents attached
    select    instid_b  from srgbtbrel into  table t_obj_key where  instid_a = w_final-vbeln
                          and typeid_a = 'VBRK' and
                           catid_a = 'BO'
                          and reltype = 'ATTA'.

    loop at t_obj_key into w_obj_key.
      wa_folder_id =  w_obj_key(17).
      wa_object_id = w_obj_key+17(18).
      clear wa_sood2.
***      get the file details
      call function 'SO_OBJECT_READ'
        exporting
          folder_id         = wa_folder_id
          object_id         = wa_object_id
        importing
          object_hd_display = wa_sood2.

Let me know if you need further help.

Thanks,

Guru