Skip to Content
avatar image
Former Member

File Upload in WebDynpro ABAP

HI,

Could someone please tell me how to design a screen with a file upload button that pops up a file browser and then the selected file is saved on the server in a fixed location.

Regards,

Shobhit

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 31, 2007 at 05:14 AM

    Hi Shobhit,

    You have File Upload Control, it helps you in getting the data from the clients machine to your context attributes as an xstring or binary.

    you can now need to write the code to store this file where ever you want.

    for file upload control you can look at WDR_TEST_EVENTS component.

    Regards

    Abhimanyu L

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I uploaded archive documents with the help of this function .... ARCHIV_CREATE_TABLE...

      can you please check this code......

      **************************************************************

                • Upload Archiv link Documents

                *********

                          • Returns a success or fail-message

                          ******

                          ******

                          ******************************************************************

                              • Declare data

                              DATA: iv_arc_object TYPE toaom-ar_object,

                              iv_object_id TYPE sapb-sapobjid,

                              iv_sap_object TYPE toaom-sap_object,

                              iv_document TYPE xstring,

                              iv_doc_type TYPE toadd-doc_type,

                              lv_uploaded TYPE boolean.

                                  • excpetion handling

                                  DATA: message_log_text TYPE bal_s_msg,

                                  lv_msg TYPE string. "#EC NEEDED

                                      • fill params

                                      iv_arc_object = arc_object.

                                      iv_object_id = object_id.

                                      iv_sap_object = sap_object.

                                      iv_document = document.

                                      iv_doc_type = doc_type.

                                          • create table

                                          CALL FUNCTION 'ARCHIV_CREATE_TABLE'

                                          EXPORTING

                                          ar_object = iv_arc_object

                                          object_id = iv_object_id

                                          sap_object = iv_sap_object

                                          document = iv_document

                                          doc_type = iv_doc_type

                                          • IMPORTING

                                          • OUTDOC =

                                          EXCEPTIONS

                                          error_archiv = 1

                                          error_communicationtable = 2

                                          error_connectiontable = 3

                                          error_kernel = 4

                                          error_parameter = 5

                                          error_user_exit = 6

                                          error_mandant = 7

                                          OTHERS = 8.

                                          IF sy-subrc <> 0.

                                          "We donot need the below mentioned message.

                                          • MESSAGE ID 'RPLM_QIMT' TYPE 'E' NUMBER '016'

                                          • WITH sap_object object_id arc_object INTO lv_msg.

                                              • fill error message parameters

                                              message_log_text-msgty = sy-msgty.

                                              message_log_text-msgid = sy-msgid.

                                              message_log_text-msgno = sy-msgno.

                                              message_log_text-msgv1 = sy-msgv1.

                                              message_log_text-msgv2 = sy-msgv2.

                                              message_log_text-msgv3 = sy-msgv3.

                                                  • log error message

                                                  CALL METHOD log_obj->addmessagetolog

                                                  EXPORTING

                                                  message_data = message_log_text

                                                  protocol_handle = log_obj->protocol_handle.

                                                  lv_uploaded = abap_false.

                                                  ELSE.

                                                  MESSAGE ID 'RPLM_QIMT' TYPE 'I' NUMBER '015'

                                                  WITH sap_object object_id arc_object INTO lv_msg.

                                                      • fill error message parameters

                                                      message_log_text-msgty = sy-msgty.

                                                      message_log_text-msgid = sy-msgid.

                                                      message_log_text-msgno = sy-msgno.

                                                      message_log_text-msgv1 = sy-msgv1.

                                                      message_log_text-msgv2 = sy-msgv2.

                                                      message_log_text-msgv3 = sy-msgv3.

                                                          • log error message

                                                          CALL METHOD log_obj->addmessagetolog

                                                          EXPORTING

                                                          message_data = message_log_text

                                                          protocol_handle = log_obj->protocol_handle.

                                                          lv_uploaded = abap_true.

                                                          ENDIF.

                                                              • return

                                                              uploaded = lv_uploaded.

                                                              Anuj

                                                          • avatar image
                                                            Former Member
                                                            Apr 02, 2007 at 04:55 AM

                                                            there is a control fileupload which allows you to add files thru machine.. have you tried that.. lemme know if you want code for it.. i have already done this..

                                                            Anuj

                                                            Add comment
                                                            10|10000 characters needed characters exceeded