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: 

Create attachment using GOS

Former Member
0 Kudos

Hi All,

I am working in SAP GTS (Global trade service) project.

My requirement is to attach a document (doc, pdf, xls, jpeg) to the customs declaration document.

I had to do this via a report program. This program will run every night. It will attach the document for the document number created for the day.

How do I proceed....

I read some threads relating to this requirement, but I do I implement it in a program...

1. First I had to do the attachment

2. I had to link the attachment to the document no

How to proceed... please help......

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Where are these files, on application server?

REgards,

RIch Heilman

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Where are these files, on application server?

REgards,

RIch Heilman

0 Kudos

Hi ,

The files are PC files.. These files are stored in a server and the file name corresponds to the document no....

So... I have to read the document nos from the table and have to attach the document ( which is in the PC folder) which corresponds to the doc. number

Thanks....

0 Kudos

Your first issue is that this program will not be able to run in background if the files are on the frontend PC or other server. If that is ok, then I have a funciton module which you pass the file path and name, the business object id, and key and it will automatically upload to the GOS of that document number. Can this program be ran in foreground?

Regards,

RIch Heilman

0 Kudos

Hi...

Thanks....

Give me the function module.... I'll try it out...

Thanks really....

0 Kudos

It is ok to run this in the foreground? If not, this funciton will do you absolutly no good.

Regards,

Rich Heilman

0 Kudos

ok.... give me the function module name....

I'll try it out....

0 Kudos

Actually it appears that I do not have access to the system at the moment, if you send me an email(on my business card) I can get it to you in the morning.

Also,if you are interested, the code within this function module uses alot of the code seen here, just modified to upload from a filepath/filename.

/people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background

REgards,

RIch Heilman

0 Kudos

BTW, it is a custom function module, it will not exist in your system.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

Thanks for your immediate replies.

I got a clue now... and now I am proceeding with the code...

If I have any doubts, I will post it to the same thread....

Please help...

Thanks,

Jaffer Ali.S

0 Kudos

check out this function module (for foreground only)

BDS_BUSINESSDOCUMENT_CREATEF

on how to use this fm, search this forum, i have already given sample codes