Skip to Content
Author's profile photo Mansoor Ahmed

Attachment Issue in Approve Purchase Order and Purchase Requisition Fiori Apps

Hi Fiori Consultants!

Let’s come straight to the point. Yup, there is a problem with Fiori PO and PR apps attachments. When attachment is stored in Content Server. Attachment stored in content server are not displayed in the said apps. I came across a post on SCN addressing the same problem.

I really liked that approach but we had the same issue and we catered it with somewhat a different approach. I am going to explain that and that somewhat simpler one.

So here we are, we have an attachment problem in SAP Fiori Standard PO and PR apps. Please find below the steps to know how to get attachments to these apps from Content Server.

I am assuming that you are done with the BADI implementation for the apps, we get methods there to address our changes in those methods, also shown below.

PO app 1.png

Now if we are done with the above step then we will move ahead, if not then follow this document.

Moving towards the next step. Now go to method CHANGE_HEADER_DETAILS_INFO_API of your class as shown below:

PO app 2.png

Now go to Structure of CS_HEADER_DETAILS_X that is: GBAPPS_APV_PO_IT_X_HNI as shown below:

PO app 2.png

Now go to attachment Table Type as shown below and add a field for your attachment URL.

PO app 2.png

Now we are done with adding a field in our attachment structure and that field in now the part of structure GBAPPS_APV_PO_IT_X_HNI.

Next step is to go in BADI implementation for Field extensibility as shown below:

PO app 2.png


PO app 2.png

Here you have to register your field you just added to your Attachment structure so that it should be visible in Fiori App. From now onwards we are going to fetch attachments and send to Fiori app.

For this purpose, we have to go back to method IF_GBAPP_EX_APV_PO_RDP~CHANGE_HEADER_DETAILS_INFO_API and call the standard FM: ARCHIVOBJECT_GET_URI. Here we will pass BUSOBJECT, PO Number, Location to this FM and it will return all the attachments stored against the respective PO Number.

PO app 2.png

LT_URI contains all the attachments against one PO. Now just loop through the internal to fill in the details.

PO app 2.png

And finally move the attachment table to original Header table.


In Frontend we just have to map the new custom field to attachment control and attachment would be visible!


Hurray! We are done with the attachment issue in PO. Repeat the same procedure for Approve Purchase Requisition app.

Please let me know how did you find this post.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Kevin Xu
      Kevin Xu

      Hi Mansoor,
      You mentioned about BADI Enhancement for Fiori PR/PO, also using Fiori package "GBAPP_APV_PO" installation.

      Currently, we don't have install fiori software "GBAPP_APV_PO" as S/4 HANA 1511 backend system.

      Because this software obsoleted in S/4 HANA 1511 version.

      So is this solution only for ERP suite version?

      Author's profile photo Kevin Barter
      Kevin Barter

      Thanks for the write up.  I do have one question though.  I am pretty new to extending Fiori apps, so I hope the answer is not obvious!

      The last step you mention is: In Frontend we just have to map the new custom field to attachment control and attachment would be visible!

      When I look at the extensions available in the Fiori app, I do not see anywhere to change the AttachmentListItems.  Does this mean that I have to replace the entire view?  Or is there a better way to map the new custom field to the attachment control?


      Author's profile photo Muhammad Raza Hasan
      Muhammad Raza Hasan

      Hi Kevin, there is no better way when SAP did not provide any standard "CONTROLLER HOOK" in there applications. Just replace the whole view with same code and do your stuff.

      Author's profile photo Kevin Barter
      Kevin Barter

      Thanks for the response.  What you suggest is what I wound up doing.  Glad to hear that it was the right way to do it.


      Author's profile photo Farkathulla Cikkanther
      Farkathulla Cikkanther

      Dear Mansoor,

      The file is not found on the link you shared below.

      Could you share the file?