cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

From GOS attachment to generate spool or pdf

former_member756406
Discoverer
0 Likes
307

Hello All,

Requirement Details:

User can attach any kind of document to FB03 manually from presentation server(GOS ATTACHMENT). I have to generate pdf / spool for that attachment. I have used binary_to_xstring then call fm otf_to_pdf. But the table binary_tab when I pass to otf_to_pdf, that m getting otf command '//' endpoint missing.Please help on this. Thanks in advance..

Accepted Solutions (0)

Answers (1)

Answers (1)

juveria_sap_integrity
Active Participant
0 Likes

The issue is conceptual rather than technical.

OTF_TO_PDF can only convert OTF data (output generated by SAPscript / SmartForms / SAP Spool).
A GOS attachment is not OTF, it is already a stored binary document (PDF, DOCX, XLS, JPG, etc.).

That is why you get the error “OTF command ‘//’ endpoint missing” — you are passing non‑OTF binary data to OTF_TO_PDF.

Important clarification

  • GOS attachments uploaded from presentation server are stored via ArchiveLink / Content Server

  • They are not spool requests

  • OTF_TO_PDF must not be used for generic attachments

What you should do instead

Case 1: Attachment is already a PDF

  • Retrieve it using:

    • ARCHIVOBJECT_GET_TABLE or

    • SO_DOCUMENT_READ_API1

  • Convert SOLIX  XSTRING

  • Directly:

    • Download it

    • Display it

    • Attach it to email
       No conversion required

Case 2: You need a Spool
You cannot create a spool from an arbitrary attachment unless:

  • The attachment was originally generated by SAP (SmartForm / SAPscript)

Spool creation is only possible from:

  • SmartForm

  • SAPscript

  • Adobe Form

  • ABAP list output

Case 3: Attachment is DOC / XLS / IMG
SAP does not provide any standard FM to convert these to PDF.
Options:

  • Use an external converter (OpenText, Adobe, PDFLib, etc.)

  • Or store/display the original file as-is

Summary

  • OTF_TO_PDF  cannot be used for GOS attachments

  • GOS attachments ≠ Spool output

  • If already PDF → just retrieve and display/download

  • Conversion to PDF requires external tools unless SAP-generated output

Hope this clarifies the limitation and correct approach.