file upload - ABAP Webdynpro fileupload -
i'm searching webdynpro abap-code snippet uploaded file(xstring) bds (business document service) system of sap. i'm using "file upload" function of webdynpro.
i've tried insert file bds-function "create_with_as_table" rubbish stored in bds. of files in binary format or zip files.
can me solve little problem?
thanks
hi answer.
i found solution of little problem. forgot convert xsting in binary format insert file in bds system. unfortunatly many guys have same problem nobody posted snippet.
the important code is:
call function 'scms_xstring_to_binary' exporting buffer = im_xstr importing output_length = lv_size tables binary_tab = lt_data. my complete class:
method wd_save_new_file. data: i_files type sbdst_files, wa_files line of i_files, i_signature type sbdst_signature, wa_signature line of i_signature. * prepare data fm - components data: i_components type sbdst_components, wa_components line of i_components . wa_components-doc_count = 1. wa_components-comp_count = 1. wa_components-comp_id = im_file_name. wa_components-mimetype = im_file_mime. append wa_components i_components. * set signature intial = 1 wa_signature-doc_count = 1. wa_signature-doc_ver_no = 1. wa_signature-doc_var_id = 1. wa_signature-doc_var_tg = ''. wa_signature-comp_count = 1. wa_signature-prop_name = 'bds_documentclass'. wa_signature-prop_value = ''. append wa_signature i_signature. clear wa_signature. wa_signature-doc_count = 1. wa_signature-doc_ver_no = 1. wa_signature-doc_var_id = 1. wa_signature-doc_var_tg = ''. wa_signature-comp_count = 1. wa_signature-prop_name = 'description'. wa_signature-prop_value = im_file_comment. append wa_signature i_signature. clear wa_signature. data lt_data type sbdst_content. data lv_size type i. data ls_xstring type xstringval. * fill ls_xstring call function 'scms_xstring_to_binary' exporting buffer = im_xstr importing output_length = lv_size tables binary_tab = lt_data. call method me->o_document_set->create_with_table exporting classname = me->i_classname classtype = me->i_classtype content = lt_data components = i_components changing object_key = me->i_object_key signature = i_signature exceptions nothing_found = 1 parameter_error = 2 not_allowed = 3 error_kpro = 4 internal_error = 5 not_authorized = 6 others = 7. case sy-subrc. when 0. * when 1. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when 2. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when 3. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when 4. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when 5. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when 6. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. when others. message id sy-msgid type sy-msgty number sy-msgno sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. endcase. *return values endmethod. i hope code other web dynpro newbie's.
cheers heinrich
Comments
Post a Comment