cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting PDF data in smartform? Possible?

Former Member
0 Kudos

Hi guys,

I'm very new to this but i hope i can explain it correctly.

Lets say right now l have some pdf stored in SAP(Service Contract for example) and we're reading them as binary image files right?

Is it possible to retrieve such binary image and display them in an existing smartform?

I hope i'm explaining the right way...this has something to do with DMS ??

Below are some codes to further help in my questions.


CALL FUNCTION 'SCMS_UPLOAD'
    EXPORTING
      filename       =  '/usr/sap/XXXX/XXXXXX/test.pdf'
      binary         = 'X'
      frontend       = ' '
*   MIMETYPE       =
    IMPORTING
      filesize       = size
    TABLES
      data           = file_data
* EXCEPTIONS
*   ERROR          = 1
*   OTHERS         = 2
            .
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
 
  DATA: BEGIN OF content_bin OCCURS 1,
          line TYPE SDOK_SDATX,
        END   OF content_bin.
 
  DATA: BEGIN OF content_txt OCCURS 1,
          line TYPE sdokcntasc,
        END   OF content_txt.
 
  CALL FUNCTION 'SCMS_DOC_READ'
    EXPORTING
      mandt                       = sy-mandt
      stor_cat                    = ' '
      crep_id                     = crep_id
      doc_id                      = doc_id
    TABLES
*   ACCESS_INFO                 =
      content_txt                 = content_txt
      content_bin                 = content_bin
* EXCEPTIONS
*   BAD_STORAGE_TYPE            = 1
*   BAD_REQUEST                 = 2
*   UNAUTHORIZED                = 3
*   COMP_NOT_FOUND              = 4
*   NOT_FOUND                   = 5
*   FORBIDDEN                   = 6
*   CONFLICT                    = 7
*   INTERNAL_SERVER_ERROR       = 8
*   ERROR_HTTP                  = 9
*   ERROR_SIGNATURE             = 10
*   ERROR_CONFIG                = 11
*   ERROR_FORMAT                = 12
*   ERROR_PARAMETER             = 13
*   ERROR                       = 14
*   OTHERS                      = 15
            .
  IF sy-subrc  0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Basically, If I understand correctly, what I have now is are converted binary data from the PDF document?

Is there a way to take these data and displaying it meaningfully(may be through some other processes like conversion again) in a smartform? Is this possible?

Edited by: Slow ABAPer on Mar 17, 2008 2:45 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Sm1tje
Active Contributor
0 Kudos

...binary image and display them in an existing smartform..

1. What do you mean by image? It is not a picture you are storing, but a pdf file.

2. You want to display the smartform???? This does not really make sense you know.

Or do you want to upload the file from the server and display the PDF on the front end somehow?

Former Member
0 Kudos

Hi gurus...

Anyone? Thanks

Former Member
0 Kudos

Hi.

I have the same issue. Did you solve it?

Thanks in advance