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: 

Add attachment to Vendor in XK02/XK03 Pragmatically.

subbarao_ilam
Explorer
0 Kudos

Hi Friends,

I have a requirement to add add the attachments to vendor number pragmatically

I have the attachments available in content server and I have the attachment ID of the document which I need to add to the transaction

Could you please suggest me any class or function module which can serve the purpose. appreciate you help. thanks.

3 REPLIES 3

SandySingh
Active Contributor
0 Kudos

Hi Girish,

I assume you have the Archive link ID.  First the file contents from archive link then convert it in Xstring format and finally attach to Vendor GOS object.


Use the following FMs:

  1. CALL FUNCTION 'ARCHIV_GET_TABLE'
  2. CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
       
    EXPORTING
           input_length
    = lv_length
       
    IMPORTING
         
    buffer      = lv_file_content
       
    TABLES
           binary_tab 
    = lt_binary_data
       
    EXCEPTIONS
           failed     
    = 1
         
    OTHERS      = 2.
  3. CL_FITV_GOS=>SAVE

Refer to SDN thread

Regards

Sandy

SandySingh
Active Contributor
0 Kudos

hello

Is this issue resolved.

Close the thread with correct and helpful answers.


Regards

Sandy

former_member202771
Contributor
0 Kudos

Hi Girish,

Use FM SO_FOLDER_ROOT_ID_GET

then FM SO_DOCUMENT_INSERT.

we will find links on how to use them.

Check this sdn wiki :

Use of Generic object services to attach a URL to Business objects - Code Gallery - SCN Wiki

Thanks,

Anil