Webdynpro Abap Excel File Upload
Webdynpro Abap Excel File Upload
Excel type files are not working use the same data (Tab delimited) in text file. Then execute.
$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.
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 '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.