cancel
Showing results for 
Search instead for 
Did you mean: 

Bps file upload error in Bsp

Former Member
0 Kudos

hi marc,

i need a small help from you.i am uploading file into bps web,i followed your pdf guide.it is working fine.in my scenario,i had developed a screen design and in that i wants to incorporate the file upload functinality.when we generate the bps application corrsponding bsp will be generated and in bsp, the page design will be in the views not in the layout,here iam getting the problem,when i write the code in the oninputprocessing the below code is not responding,when i try to do change in the layout my original design is getting disturbed.my code is as follows in the oninputprocessing plz advice me.

iam getting dump at the bolded line below as null value is passed.plz help me out.

CLASS CL_HTMLB_MANAGER DEFINITION LOAD.

CONSTANTS:

c_memory_id_file_upload TYPE memory_id VALUE 'Z_SEM_BPS_FILE_UPLOAD'.

DATA:

lv_objname TYPE lxeobjname,

lr_page TYPE REF TO if_http_entity,

l_content_path TYPE string,

l_content TYPE string,

l_subrc TYPE sy-subrc,

ls_bapiret TYPE bapiret2,

lt_bapiret TYPE STANDARD TABLE OF bapiret2,

ls_mesg TYPE upc_ys_mesg,

lt_mesg TYPE upc_yt_mesg,

request1 type ref to IF_HTTP_REQUEST.

DATA: event TYPE REF TO CL_HTMLB_EVENT.

REFRESH lt_mesg.

IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.

event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).

IF event->name = 'button' AND event->event_type = 'click'.

DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.

button_event ?= event.

ENDIF.

endif.

case event->id.

when 'upload'.

lv_objname = request->get_form_field( 'file' ).

lr_page = request1->get_multipart( 1 ).

<b>l_content_path = lr_page->get_header_field( '~content_filename' ).</b>

l_content = lr_page->get_cdata( ).

IF l_content IS NOT INITIAL.

  • Export file contents to memory

EXPORT content FROM l_content TO MEMORY ID c_memory_id_file_upload.

endif.

endcase.

  • create statistic node for performance measurements

type-pools: upcst.

cl_upwb=>statistic_open( i_node_name = upcst_c_web_input_proc

i_page = page

i_request = request ).

  • call input processing here

call method application->inputProcessing(

event_id = event_id

runtime = runtime

page = page

request = request

navigation = navigation

version = 300

).

  • close the statistic node

cl_upwb=>statistic_close( i_node_name = upcst_c_web_input_proc ).

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member93896
Active Contributor
0 Kudos

Hello Bharan,

the file upload must run in its own BSP application. Otherwise the header for the file content is not filled properly. You can use an iframe to embed the upload application into a BPS web interface for example.

Regards,

Marc

SAP NetWeaver RIG