Skip to Content
avatar image
Former Member

Archive a pdf document in a folder in Business Workplace

Good Morning!

I've a question about archiving a pdf document in a folder in the business workplace.

I want to the it with the fm SO_OBJECT_INSERT.

But here is a problem. I upload the pdf with gui_upload into the table lt_pdfbin.

This table has the type solix_tab.

But in the fm the table content needs a table of the type soli.

What can i do?Are there other possibilities to archive the document in an folder?

Thanks for your help!

DATA: lt_pdfbin TYPE solix_tab.

CALL METHOD cl_gui_frontend_services=>gui_upload
    EXPORTING
      filename                = l_file
      filetype                = 'BIN'
      has_field_separator     = space
      header_length           = 0
      read_by_line            = 'X'
      dat_mode                = space
      codepage                = space
      ignore_cerr             = abap_true
      replacement             = '#'
*      virus_scan_profile      =
*    IMPORTING
*      filelength              =
*      header                  =
    CHANGING
      data_tab                = lt_pdfbin
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      not_supported_by_gui    = 17
      error_no_gui            = 18
      OTHERS                  = 19

CALL FUNCTION 'SO_OBJECT_INSERT'
    EXPORTING
      folder_id                        = so_obj_id
*     OBJECT_FL_CHANGE                 = ' '
*     OBJECT_HD_CHANGE                 = ' '
      object_type                      = 'PDF'
*     ORIGINATOR_ID                    = ' '
*     OWNER                            = ' '
*   IMPORTING
*     OBJECT_FL_DISPLAY                =
*     OBJECT_HD_DISPLAY                =
*     OBJECT_ID                        =
    tables
      objcont                              = lt_pdfbin                           
      objhead                             = objhead

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 22, 2010 at 05:33 AM

    Has nobody an idea?

    I found something here:

    [How to send PDF document as attachment in the send mail step|How to send PDF document as attachment in the send mail step]

    Data: lt_pdfbin type solix_tab stands higher in the code, but it is there 😊

    It works...that something will be archived into my folder, but not a pdf document 😊

    With the object type 'RAW' there are only chinese symbols...hmm

    With 'PDF' there is an error, with 'BIN' i can't see anything

    Are there other opportunities?

      DATA: so_obj_id type soodk.
    
      DATA: objtp type so_obj_tp,
            objyr type so_obj_yr,
            objno type so_obj_no.
    
      DATA: objhead type standard table of soli,
            lt_mappe type standard table of soli.
    
      DATA: wa_soli type soli,
            wa_solix type solix.
    
      FIELD-SYMBOLS: <ptr_text> type soli,
                     <ptr_x>    type any,
                     <ptr_hex>  type solix.
    
      objtp = 'FOL'.
      objyr = 35.
      objno = '000000000457'.
    
    * Zusammensetzung zur Folder_ID
      CONCATENATE objtp objyr objno INTO so_obj_id.
    
    * Umwandlung solix zu soli
        refresh lt_mappe.
          loop at lt_pdfbin into wa_solix.
            clear wa_soli.
            assign wa_soli to <ptr_hex> casting.
            move wa_solix to <ptr_hex>.
            append wa_soli to lt_mappe.
          endloop.
    
      CALL FUNCTION 'SO_OBJECT_INSERT'
        EXPORTING
          folder_id                        = so_obj_id
    *     OBJECT_FL_CHANGE                 = ' '
    *     OBJECT_HD_CHANGE                 = ' '
          object_type                      = 'RAW'
        tables
          objcont                          = lt_mappe                             
          objhead                          = objhead    

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I solved the problem!

      data: l_objdata type sood1,
                 l_objdata-file_ext = 'PDF'.
      
        call function 'SO_OBJECT_INSERT'
          exporting
            folder_id                        = so_obj_id
            object_hd_change                 = l_objdata
            object_type                      = 'EXT'

      Then it works!

      Maybe it helps somebody 😉