Application Development and Automation 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: 
Read only

BDS - Print attachments.

Former Member
0 Likes
1,688

I have a report that, among other things, has vendor invoices as one of the fields.  Currently the report looks at the BDS to determine if there is an attachment (using FM BDS_ALL_CONNECTIONS_GET).  If there is an attachment then it simply tells the user that via a field in the ALV.  The next step is to allow the user to print the attachments using a button on the ALV. First the user will highlight the row that corresponds to the invoice in question and click the button. 

My issue is that I am unable to find a way to print these documents.  The FM that I use returns to me the document ID.  I can take that document ID to FM SO_DOCUMENT_READ_API1 and that gives me the contents in two different tables.  One is in Hex form and the other is what I assume is binary but I could be wrong.

I am wondering, how do I take this Hex format and print it?  Is there a FM to print the BDS document directly?

Regards.

I have a report that, among other things, has vendor invoices as one of the fields.  Currently the report looks at the BDS to determine if there is an attachment (using FM BDS_ALL_CONNECTIONS_GET).  If there is an attachment then it simply tells the user that via a field in the ALV.  The next step is to allow the user to print the attachments using a button on the ALV. First the user will highlight the row that corresponds to the invoice in question and click the button. 

My issue is that I am unable to find a way to print these documents.  The FM that I use returns to me the document ID.  I can take that document ID to FM SO_DOCUMENT_READ_API1 and that gives me the contents in two different tables.  One is in Hex form and the other is what I assume is binary but I could be wrong.

I am wondering, how do I take this Hex format and print it?  Is there a FM to print the BDS document directly?

Regards.

4 REPLIES 4
Read only

Former Member
0 Likes
1,297

Adam,

     If possible, take the binary content and convert it to pdf format so that you can download it and take the print.

~Athreya

Read only

arindam_m
Active Contributor
0 Likes
1,297

Hi,

Please try to use the FM BDS_OBJECT_DISPLAY to get the file content in table CONTENT, You also have the ASCII format in ASCII_CONTENT. Then to achieve your functionality of print can you put this in Application server or presentation server using FM SXPG_COMMAND_EXECUTE and print from there.

Hope this helps.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,297

Arindam,

Thanks for the suggestion.  I am running into a problem finding the URL of the document for FM BDS_OBJECT_DISPLAY.  I have tried to use FM BDS_BUSINESSDOCUMENT_GET_URL but it says that nothing is found when I pass the correct parameters (the same parameters that I pass to BDS_ALL_CONNECTIONS_GET.

Read only

arindam_m
Active Contributor
0 Likes
1,297

Hi,

Try the FM BDS_BUILD_URL_FOR_AL to build the URL for the doc. Also check BDS_BUSINESSDOCUMENT_GET_URL if URL exists.

Cheers,

Arindam