Skip to Content
avatar image
Former Member

Upload Button By code.

I need to create a upload button on the Web dynpro. I need to create by code and not by screen setting. It's possible ? I already tried using the gui_upload and CL_GUI_FRONTEND_SERVICES functions and did not work. Any suggestions ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 27, 2016 at 12:00 AM

    Hi Rodrigo,

    You can use this class to generate a FileUpload UI element:CL_WD_FILE_UPLOAD

    Read more here: FileUpload -  Web Dynpro ABAP - SAP Library

    Regards,

    Felipe

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Rodrigo,

      The following thread teaches how to create UI elements dynamically:

      Dynamic UI Generation in Web Dynpro ABAP

      By using the class method, CL_WD_FILE_UPLOAD, you can achieve this. Then, you can create a Button to perform the File Upload to the database, using CALL METHOD CL_WD_BUTTON=>NEW_BUTTON.

      CALL METHOD CL_WD_FILE_UPLOAD=>NEW_FILE_UPLOAD

      *  exporting

      *    ACTIVATE_ACCESS_KEY     =

      *    BIND_DATA               =     " BIND_DATA

      *    BIND_ENABLED            =     " BIND_ENABLED

      *    BIND_FILE_NAME          =     " BIND_FILE_NAME

      *    BIND_MIME_TYPE          =     " BIND_MIME_TYPE

      *    BIND_STATE              =

      *    BIND_TEXT_DIRECTION     =     " BIND_TEXT_DIRECTION

      *    BIND_TOOLTIP            =     " BIND_TOOLTIP

      *    BIND_VIRUS_SCAN_PROFILE =

      *    BIND_VISIBLE            =     " BIND_VISIBLE

      *    BIND_WIDTH              =     " BIND_WIDTH

      *    CONTEXT_MENU_BEHAVIOUR  = E_CONTEXT_MENU_BEHAVIOUR-INHERIT

      *    CONTEXT_MENU_ID         =

      *    DATA                    =

      *    ENABLED                 = 'X'    " ENABLED

      *    EXPLANATION             =     " EXPLANATION

      *    FILE_NAME               =     " FILE_NAME

      *    ID                      =     " ID

      *    MIME_TYPE               =     " MIME_TYPE

      *    STATE                   = E_STATE-NORMAL

      *    TEXT_DIRECTION          = E_TEXT_DIRECTION-INHERIT    " TEXT_DIRECTION

      *    TOOLTIP                 =     " TOOLTIP

      *    VIEW                    =     " VIEW

      *    VIRUS_SCAN_PROFILE      =

      *    VISIBLE                 = E_VISIBLE-VISIBLE    " VISIBLE

      *    WIDTH                   =     " WIDTH

      *  receiving

      *    CONTROL                 =     " CONTROL

         .

      CALL METHOD CL_WD_BUTTON=>NEW_BUTTON

      *  exporting

      *    ACTIVATE_ACCESS_KEY      =

      *    BIND_DESIGN              =     " BIND_DESIGN

      *    BIND_ENABLED             =     " BIND_ENABLED

      *    BIND_IMAGE_FIRST         =     " BIND_IMAGE_FIRST

      *    BIND_IMAGE_IS_DECORATIVE =

      *    BIND_IMAGE_SOURCE        =     " BIND_IMAGE_SOURCE

      *    BIND_TEXT                =     " BIND_TEXT

      *    BIND_TEXT_DIRECTION      =     " BIND_TEXT_DIRECTION

      *    BIND_TOOLTIP             =     " BIND_TOOLTIP

      *    BIND_VISIBLE             =     " BIND_VISIBLE

      *    BIND_WIDTH               =     " BIND_WIDTH

      *    CONTEXT_MENU_BEHAVIOUR   = E_CONTEXT_MENU_BEHAVIOUR-INHERIT

      *    CONTEXT_MENU_ID          =

      *    DESIGN                   = E_DESIGN-STANDARD    " DESIGN

      *    ENABLED                  = 'X'    " ENABLED

      *    EXPLANATION              =     " EXPLANATION

      *    HOTKEY                   = E_HOTKEY-NONE

      *    ID                       =     " ID

      *    IMAGE_FIRST              = 'X'    " IMAGE_FIRST

      *    IMAGE_IS_DECORATIVE      =

      *    IMAGE_SOURCE             =     " IMAGE_SOURCE

      *    ON_ACTION                =     " ON_ACTION

      *    TEXT                     =     " TEXT

      *    TEXT_DIRECTION           = E_TEXT_DIRECTION-INHERIT    " TEXT_DIRECTION

      *    TOOLTIP                  =     " TOOLTIP

      *    VIEW                     =     " VIEW

      *    VISIBLE                  = E_VISIBLE-VISIBLE    " VISIBLE

      *    WIDTH                    =     " WIDTH

      *  receiving

      *    CONTROL                  =     " CONTROL

         .

      Regards,

      Felipe

  • avatar image
    Former Member
    May 27, 2016 at 08:36 AM

    Many post already available for this.

    U can you check the below example:

    Upload and Download files in Webdynpro ABAP - Web Dynpro ABAP - SCN Wiki

    Add comment
    10|10000 characters needed characters exceeded