0% found this document useful (0 votes)
287 views

Webdynpro Abap Excel File Upload

This document provides instructions for uploading an Excel file and displaying its data in a Web Dynpro ABAP application. The steps are: 1. Create a Web Dynpro component and view. 2. Add nodes to the component controller for the file and table data. 3. Configure the view layout to include a file upload and data table. 4. Add code to the component controller to parse the file on upload and populate the table.

Uploaded by

jvsscribd
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
287 views

Webdynpro Abap Excel File Upload

This document provides instructions for uploading an Excel file and displaying its data in a Web Dynpro ABAP application. The steps are: 1. Create a Web Dynpro component and view. 2. Add nodes to the component controller for the file and table data. 3. Configure the view layout to include a file upload and data table. 4. Add code to the component controller to parse the file on upload and populate the table.

Uploaded by

jvsscribd
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

Excel File Upload - Web Dynpro ABAP

Excel type files are not working use the same data (Tab delimited) in text file. Then execute.

Create Web ynpro Component and !a"e as local ob#ect.

$o need to embed %iew into Window when you specify "iew and window. &o to Component Controller '(Context tab'( Create two nodes E)*+ ET ' Cardinality ,..n and -./E with attribute -./E+C0$TE$T! of type 1!T2.$&.


below.

&o to %iew 3*/04 +% '(Context tab'()ap Component Controller context to %iew Context as shown

5. 6.

&o to /ayout tab !et 200T3.E/E)E$TC0$T4.$E2 layout type ')atrix/ayout Create &roup 3. element ' /ayout data ' )atrix7ead ata

8.

Create -ile 3pload 3. element inside &roup and bind with context node -./E.

9.

Create button inside &roup ' Create OnAction e"ent ' 3*/04 +-./E

method ONACTIONUPLOAD_FILE . DATA lo_componentcontroller TYPE REF TO ig_componentcontroller . lo_componentcontroller = d_thi!"#get_componentcontroller_ctr$ %. lo_componentcontroller"#&plo'd_(ile$ %. endmethod. : . Create one Table 3. element and bind with Context node E)*+ ET.

&o to Component Controller '( )ethod tab '( Write the below code in 3*/04 +-./E.

)ET*OD &plo'd_(ile . DATA+ lo_nd_(ile lt_emp_det lo_el_(ile DATA+ l!_(ile lt_.in lt_t,t l!_t,t l2_o&tlen 3 TYPE d_thi!"#element_(iled_thi!"#element_emp_detl!_emp_det TYPE TYPE REF TO i(_ d_conte,t_nodeTYPE d_thi!"#element!_emp_detlo_nd_emp_det TYPE REF TO i(_ d_conte,t_nodeTYPE REF TO i(_ d_conte,t_element.

TYPE TA/LE OF !do0cnt.inTYPE TA/LE OF !do0cnt'!cLI1E LINE OF lt_t,tTYPE i.

n'2ig'te (rom 4conte,t# to 4(ile# 2i' le'd !election lo_nd_(ile = d_conte,t"#get_child_node$ n'me = d_thi!"# dct,_(ile %.

get element 2i' le'd !election lo_el_(ile = lo_nd_(ile"#get_element$ %.

get 'll decl'red 'ttri.&te! lo_el_(ile"#get_!t'tic_'ttri.&te!$ I)PORTIN5 !t'tic_'ttri.&te! = l!_(ile %. 678TRIN5 to /INARY CALL FUNCTION 98C)8_78TRIN5_TO_/INARY9 E7PORTIN5 .&((er I)PORTIN5 o&tp&t_length = l2_o&tlen TA/LE8 .in'r:_t'. = lt_.in. 6/in'r: to Te,t (ile CALL FUNCTION 98C)8_/INARY_TO_TE7T9 E7PORTIN5 inp&t_length = l2_o&tlen TA/LE8 .in'r:_t'. te,t_t'. = lt_.in = lt_t,t. = l!_(ile"(ile_content!

LOOP AT lt_t,t INTO l!_t,t. 8PLIT l!_t,t AT cl_'.'p_ch'r_&tilitie!=#hori;ont'l_t'. INTO l!_emp_det"pernr l!_emp_det"n'chn l!_emp_det"2orn' l!_emp_det"g.d't. APPEND l!_emp_det TO lt_emp_det. CLEAR ENDLOOP. 3 n'2ig'te (rom lo_nd_emp_det = to 2i' le'd !election d_conte,t"#get_child_node$ n'me = d_thi!"# dct,_emp_det %. l!_emp_det.

lo_nd_emp_det"#.ind_t'.le$ ne _item! = lt_emp_det !et_initi'l_element! = '.'p_tr&e %. END)ET*OD.

Create Web ynpro 4pplication and sa"e it as local ob#ect.

2un the application.

You might also like