2011 Nov 28 8:54 AM
Hi ,
My requirement is to get the attachments of PO and send them via email .
I am looking for a FM which gets me the attachments in a PO (we can view attachments in PO display transaction ME23n. Select line item and click on button which has attachment icon. This will take you to the document display screen. You can also check your attachments through CV03n transaction. This is document display tcode in DMS.) .
My search in the forum says BDS_GOS_CONNECTIONS_GET can be used to get attchment list but it i don't get results in my system .
And FM BDS_BUSINESSDOCUMENT_GET_TAB which gets attchements
my importing values
LOGICAL_SYSTEM CSC_D20130
CLASSNAME Z2BUS2012
CLASSTYPE BO
CLIENT 130
OBJECT_KEY 1430000581
BINARY_FLAG X
TEXT_AS_STREAM X
still no result . Did I miss something or any config required ?
Please help
Rhea.
2011 Nov 28 9:07 AM
2011 Nov 28 9:14 AM
Hi Rhea,
the method cl_binary_relation=>read_links will give you the list you are after.
Cheers
Graham Robbo
2011 Nov 28 9:41 AM
Graham ,
I see that CALL METHOD cl_binary_relation=>read_links_of_binrels is called in BDS_GOS_CONNECTIONS_GET fm but lt_links is empty .
Any idea.
Rhea.
2011 Nov 28 9:45 AM
Did you check the function I have mentioned , initially do a select from DRAW and pass the values to the function. The content will be available in the return table.Search in SCN for more information about the function
2011 Nov 28 10:35 AM
2011 Nov 28 11:00 AM
Kesav ,
The tables this fm fetches doesn't have data for these docs.
Rhea.
2011 Nov 28 11:04 AM
Have a look here for the usage of CV120_DOC_CHECKOUT. it also uses CV120_GET_APPL_TYPE. You can check the content.
2011 Nov 28 11:22 PM
The method I mentioned was cl_binary_relation=>read_links not cl_binary_relation=>read_links_of_binrels. It works fine for me. Not sure what else to suggest. Are you sure you are passing the correct details? Are you sure your PO actually has attachments?
Cheers
Graham Robbo
2011 Nov 29 2:51 AM
Rhea,
I guess, a sample code will help you here. And as you rightly mentioned, use cl_binary_relation=>read_links_of_binrel for this.
Try something like this.
gs_lporb-instid = 'Your PO number'.
gs_lporb-typeid = 'BUS2012'.
gs_lporb-catid = 'BO'.
CALL METHOD cl_binary_relation=>read_links_of_binrel
EXPORTING
is_object = gs_lporb
ip_relation = 'ATTA'
ip_role = 'GOSAPPLOBJ'
IMPORTING
et_links = lt_links.
if you want to check what you have to pass in ip_relation, check table MDOBLREL and field RELTYPE_O.
If you want to read the attachment by using function module SO_OBJECT_READ, you can do that by using lt_links-instid_b. By splitting it 17 characters in to folder_id & object_id (two parameters you required to read it in that function module).
Regards,
Gokul
2024 Feb 27 11:14 AM
Hi Rhea,
I have the same requirement, To send the PO attachments via mail. Which approach you used for this.
Kindly share some sample code if possible