Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jigang_Zhang张吉刚
Active Contributor
GOS is available for many standard transactions we can upload files to the attachment list, how to send those attachment files through email easily?


 

1. Find the object type name for the standard transaction


Take the Purchase order as an example, enter 'Purchase*' as STEXT for table TOJTT at SE11 like below:


Then we can get the below lists for transactions related to purchases:


For my case, I find the object type name 'FIPP' very quickly by searching 'Park' for FBV3 parked document. Btw, table TOJTB(Business object repository: Basic data) contains the details for those business objects.

2. Find the attachment ID inside the standard transaction


Generally, it's shown as 'AttachmentForXXXX' at the window of the attachment list. Take a billing document as an example, the attachment ID will be the document directly.


For parked documents, the attachment ID will be the combination of company code, document number, and fiscal year.


Don't know whether exists some standard rules for this attachment ID, no idea where to check this anyway. Please let me know if exists.

3. Fetch the contents of files and send them out as attachments using BCS



  • With the business object name and attachment ID from the above steps, we can get the attachment list by method 'get_atta_list' of class 'cl_gos_api';

  • The deep structure gos_s_attcont contains all the details of the attachment file and its content in Cstring/Xstring format;

  • Convert the Xstring format into Table Type SOLIX_TAB(binary);

  • Use method 'add_attachment ' of BCS class 'cl_document_bcs' to add as email attachment.



Please check this link from Jerry Wang as a code reference.

 
4 Comments
rob_ariaans
Contributor
0 Kudos
Regarding your question:
Don’t know whether exists some standard rules for this attachment ID, no idea where to check this anyway. Please let me know if exists.

These are the key fields of the header table that stores your object where the attachment relates to. Table BKPF in this example - since you are dealing with parked vendor invoice.
Jigang_Zhang张吉刚
Active Contributor
0 Kudos
rob.ariaans

That makes sense! Thanks for sharing 🙂
FrankN
Newcomer
0 Kudos
No. Actually that are the key fields of the business object (FIPP) as seen in transaction SWO1, in that order. They do not have to be identical to the key fields of underlying table, e.g. object BUS1505 and table VICNCN have different keys.
P2003572583
Explorer
0 Kudos
I come across same business requirement. The GOS object only allow to upload pdf attachments in change mode of document. Can anyone please help out how we can enable GOS object at the time of creation document so that attachment will be send along with email output once we save document
Labels in this area