SAP Function Modules

SO_OBJECT_UPLOAD SAP Function module







SO_OBJECT_UPLOAD is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name SO_OBJECT_UPLOAD into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SO30
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM SO_OBJECT_UPLOAD - SO OBJECT UPLOAD





CALL FUNCTION 'SO_OBJECT_UPLOAD' "
* EXPORTING
*   default_filename = SPACE    "               Default file name for F4 help
*   filetype = 'ASC'            "               BIN for binary, ASC for ASCII
*   path_and_file = SPACE       "
*   no_dialog = SPACE           " sonv-flag
  IMPORTING
    filelength =                " soxwd-doc_length  Length of uploaded file
    f_cancelled =               " sonv-flag     Flag: Upload was cancelled
    act_filetype =              "               Actual file type
    act_filename =              "               Actual file name
    act_objtype =               " soodk-objtp
    file_put_to_kpro =          " sonv-flag
  TABLES
    objcont =                   " soli          Contents of downloaded file
  EXCEPTIONS
    FILE_READ_ERROR = 1         "
    INVALID_TYPE = 2            "               Invalid file type parameter
    X_ERROR = 3                 "               Unknown error
    OBJECT_TYPE_NOT_ALLOWED = 4  "
    KPRO_INSERT_ERROR = 5       "
    .  "  SO_OBJECT_UPLOAD

ABAP code example for Function Module SO_OBJECT_UPLOAD





The ABAP code below is a full code listing to execute function module SO_OBJECT_UPLOAD including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_filelength  TYPE SOXWD-DOC_LENGTH ,
ld_f_cancelled  TYPE SONV-FLAG ,
ld_act_filetype  TYPE STRING ,
ld_act_filename  TYPE STRING ,
ld_act_objtype  TYPE SOODK-OBJTP ,
ld_file_put_to_kpro  TYPE SONV-FLAG ,
it_objcont  TYPE STANDARD TABLE OF SOLI,"TABLES PARAM
wa_objcont  LIKE LINE OF it_objcont .

DATA(ld_default_filename) = 'some text here'.
DATA(ld_filetype) = 'some text here'.
DATA(ld_path_and_file) = 'some text here'.

DATA(ld_no_dialog) = some text here

"populate fields of struture and append to itab
append wa_objcont to it_objcont. . CALL FUNCTION 'SO_OBJECT_UPLOAD' * EXPORTING * default_filename = ld_default_filename * filetype = ld_filetype * path_and_file = ld_path_and_file * no_dialog = ld_no_dialog IMPORTING filelength = ld_filelength f_cancelled = ld_f_cancelled act_filetype = ld_act_filetype act_filename = ld_act_filename act_objtype = ld_act_objtype file_put_to_kpro = ld_file_put_to_kpro TABLES objcont = it_objcont EXCEPTIONS FILE_READ_ERROR = 1 INVALID_TYPE = 2 X_ERROR = 3 OBJECT_TYPE_NOT_ALLOWED = 4 KPRO_INSERT_ERROR = 5 . " SO_OBJECT_UPLOAD
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_filelength  TYPE SOXWD-DOC_LENGTH ,
ld_default_filename  TYPE STRING ,
it_objcont  TYPE STANDARD TABLE OF SOLI ,
wa_objcont  LIKE LINE OF it_objcont,
ld_f_cancelled  TYPE SONV-FLAG ,
ld_filetype  TYPE STRING ,
ld_act_filetype  TYPE STRING ,
ld_path_and_file  TYPE STRING ,
ld_act_filename  TYPE STRING ,
ld_no_dialog  TYPE SONV-FLAG ,
ld_act_objtype  TYPE SOODK-OBJTP ,
ld_file_put_to_kpro  TYPE SONV-FLAG .

ld_default_filename = 'some text here'.

"populate fields of struture and append to itab
append wa_objcont to it_objcont.
ld_filetype = 'some text here'.
ld_path_and_file = 'some text here'.

ld_no_dialog = some text here

SAP Documentation for FM SO_OBJECT_UPLOAD


The module loads the contents (i.e. table OBJCONT) of a SAPoffice

document from a PC. (X terminal: transport from sequential file.)
...See here for full SAP fm documentati








Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name SO_OBJECT_UPLOAD or its description.