cancel
Showing results for 
Search instead for 
Did you mean: 

gui_upload

Former Member
0 Kudos

hi all,

what fm to use instead of GUI_upload to upload the photo in web dynpro,since gui_upload doesnt work ?

how to upload the data in web_dynpro.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Use the fileUpload UI element instead.

thomas_jung
Developer Advocate
Developer Advocate

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks to all,

my issues solved..

Former Member
0 Kudos

HI PG,

thanks for your reply..

can u give me the detail explanation of it..

i want to upload the Photo to R3 (pa30) from webdynpro.......

Former Member
0 Kudos

Hi dhavamani,

As thomas suggested you to use fileupload ui element.

I will just give you the idea how to use it.

After creating the file upload element main properties are data,filename and mime type.Out of which data is mandatory.

step1) Create three attributes out of which one is of type xstring and two are string.

step2) Bind xstring with data property and other two with filename and mimetype.

step3)Create an button and write the code to get the data from the file in form of internal table.

Please refer following code u will easily able to upload the data.


  DATA XCONTENT TYPE XSTRING.
  DATA NAME TYPE STRING.
  DATA MIME_1 TYPE STRING.

  DATA: ROWS TYPE STANDARD TABLE OF STRING  ,
        WA_ROWS(300) TYPE C .
  DATA: CONV TYPE REF TO CL_ABAP_CONV_IN_CE.


  
  WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'UPLOAD'  IMPORTING VALUE = XCONTENT ).

  WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'FILENAME'  IMPORTING VALUE = NAME ).

  WD_CONTEXT->GET_ATTRIBUTE( EXPORTING NAME = 'MIMETYPE'  IMPORTING VALUE = MIME_1 ).

  CONV = CL_ABAP_CONV_IN_CE=>CREATE( INPUT = XCONTENT ).

  CONV->READ( IMPORTING DATA = CONTENT ).

  SPLIT CONTENT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE ROWS .

 

Here you will get your file data into table rows and then you can use this data for further processing.

If any doubt ask.

regards

PG