cancel
Showing results for 
Search instead for 
Did you mean: 

Access Attachment URL

gadirov
Participant
0 Kudos

Dear SAP Cloud Experts,

we want to access the URL for a specific attachment through BO fields in script. It must be displayed in a field and further, a link based navigation to the respective attachment should also possible from the follow-up object like Sales Quote to the attachments of its opportunity predecessor.

Via ABSL we just get the File Content URI (corresponding BO field in Attachment Folder node) with a SAP internal port number and are not able to access the file. is there a way how we can solve this?

Thank you for your support.

Best regards

Rufat

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member226
Employee
Employee

Hi,

Yes, this is possible. As you know the data stored in BO AttachmentFolder contains SAP Internal PortID + Hostname and those cannot be accessed over the internet.

To overcome this you need to use "SesssionURL". This session URL is accessible over the internet and stored in UI Designer Root->$system->SessionURL.

sessionurl.png

You can use an event handler and assign this session URL value to a field using "DataOperation" and Finally trigger a BOAction which can read the value assign from UI designer:

url.png

Now in PDI you can use BO Query and retrieve the association AttachmentFolder and get the document URL. This URL will not be accessible over the internet. But when you club it with session URL then this work by concatenating the value of session URL and part starting from /ap/ds/wd*****

Let say session URL is: https://my3XXXXX.crm.ondemand.com/sap(cz1TSUQlM2FBTk9OJTNhdmFhaTAza2dzX0tHU18wMCUzYW1ESVQzT1hqNXFCVl...

This is the URL from FileContent
http://XYZ.byd.sap.corp:50000/sap/ap/ds/wd/doc/00163E6BB3EA1EDA8FAD8E1693AC0570/download.png?sap-client=095&Ctxt=UERNX01BVEVSSUFMOkFUVEFDSE1FTlRfRk9MREVS&Shm=00163E6BB3EA1EDA8FAD8E1693AC0570

So the URL which can be accessed over the internet will look like:

https://my3XXXXX.crm.ondemand.com/sap(cz1TSUQlM2FBTk9OJTNhdmFhaTAza2dzX0tHU18wMCUzYW1ESVRXaHlLb0FvcH...

YanGerzon
Participant
0 Kudos

Hi,

Does the solution described above still work?
When I try to link to attachments in Journal Entry voucher BO from a field in my custom BO, the result is a field of type link i created with the content(example):
"https://myXXXXXX.sapbydesign.com/sap(cz1TSUQlM2FBTk9OJTNhdmhieWRsdnZjaV9MVlZfMDAlM2FHN3gtLVJfZXB4TEszUjFPdmgwRjd2NElsR29EZHdQenpWWGx4RFJMLUFUVA==)/ap/ds/wd/doc/2701C0B6FC991EEDBA9C5361C4C3642F/test1.txt?sap-client=352"

When I click the link in the field it does nothing.
If i copy the url into a browser it doesnt find the destination.

Thanks.

VenkateshG
Explorer
0 Kudos

Hi Rufat,

Did you find any answer for your above query? We do have similar requirement. Can you please share information on how you addressed this requirement.

Regards

Venkatesh

former_member226
Employee
Employee

Pls see my comment below

VenkateshG
Explorer
0 Kudos

kabras

Thanks for this answer. Though i did not refer your answer in 2020, we have the same use case now and found it. 🙂

YanGerzon
Participant
0 Kudos

Hi,

So Saurabh Kabra's solution above worked for you?