Documents as attachments in the interface

Certain BAdIs allow the transfer of an attachment. This can be, for example, a PDF document, an image file, or another type of attachment.

DATA:
    attachment TYPE REF TO /aeb/if_aes_pb_attachment_do,
    pdf_stream TYPE /aeb/01_rawstring.

  pdf_stream = '12345678901234567890'.
  attachment = im_cons_data_object_factory->new_aes_pb_attachment_do( im_attachment_code = 'Invoice.pdf'
                                                                      im_data = pdf_stream ).
  im_value->add_attachment( attachment ).