2010 Nov 19 9:51 AM
Hi all,
I am having problem in using this FM. I want to download any file to my local desktop from the file attachment list of an employee in PA20/PA30. I kept on getting Access via 'NULL' object reference not possible error message.
This is how I use it. The filename is obtained through the a pop up box asking user to input a file name with a file path.
CALL FUNCTION 'SO_OBJECT_DOWNLOAD'
EXPORTING
BIN_FILESIZE = 0
DEFAULT_FILENAME = ' '
filetype = 'BIN'
path_and_file = lo_stru_output_param-file_name "C:\Users\sc\Desktop\xyz.pdf
EXTCT = ' '
no_dialog = ' '
CODEPAGE =
IMPORTING
FILELENGTH =
F_CANCELLED =
ACT_FILETYPE =
ACT_FILENAME =
TABLES
objcont = lt_object_cont
EXCEPTIONS
file_write_error = 1
invalid_type = 2
x_error = 3
kpro_error = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hi all,
I am having problem in using this FM. I want to download any file to my local desktop from the file attachment list of an employee in PA20/PA30. I kept on getting Access via 'NULL' object reference not possible error message.
This is how I use it. The filename is obtained through the a pop up box asking user to input a file name with a file path.
CALL FUNCTION 'SO_OBJECT_DOWNLOAD'
EXPORTING
BIN_FILESIZE = 0
DEFAULT_FILENAME = ' '
filetype = 'BIN'
path_and_file = lo_stru_output_param-file_name "C:\Users\sc\Desktop\xyz.pdf
EXTCT = ' '
no_dialog = ' '
CODEPAGE =
IMPORTING
FILELENGTH =
F_CANCELLED =
ACT_FILETYPE =
ACT_FILENAME =
TABLES
objcont = lt_object_cont
EXCEPTIONS
file_write_error = 1
invalid_type = 2
x_error = 3
kpro_error = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2010 Nov 19 4:33 PM
Have you executed in debug to see what value you're missing? Something needed is not there...thus the NULL.
2010 Nov 22 7:26 AM
Use this:
DATA lr_conv TYPE REF TO cl_abap_conv_out_ce.
DATA lv_data TYPE string.
DATA lv_xfile TYPE xstring.
lv_data = 'Example text, which will be opened in MS Word.'.
cl_abap_conv_out_ce=>create( RECEIVING conv = lr_conv ).
lr_conv->convert( EXPORTING data = lv_data
IMPORTING buffer = lv_xfile ).
cl_wd_runtime_services=>attach_file_to_response(
EXPORTING i_filename = 'wd4a.doc'
i_content = lv_xfile
i_mime_type = 'application/msword' ).
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |