Professional Documents
Culture Documents
AnSAPConsultant:WebDynproABAPDownloadfile
An SAP Consultant
HOME
ABAP
ALV
SMART FORMS
ADOBE FORMS
HR ABAP
WORKFLOW
HCM
Follow by Email
Emailaddress...
FindusonFacebook
AnSAPConsultant
Like
1,267peoplelikeAnSAPConsultant.
Facebooksocialplugin
Followers
Jointhissite
When we specify Window name and View name when we create web dynpro component, View is embedded in
withGoogleFriendConnect
Window.
Members(50) More
Go to Component Controller
Context tab->Create node EMP_DET with cardinality 0..n
Alreadyamember?Signin
Popular Posts
ABAPALVReportexamplewithsteps
ExecuteABAPReportusingSUBMIT
statement
WebDynproABAPALVON_CLICKevent
ABAPSendingemailwithpdfattachment
ABAPStepbysteptutorialonSmartForms
TemplateNode
ABAPDynamicWHEREclause
ABAPDownloadreportoutputasPDFfile
SAPABAPCL_ABAP_CHAR_UTILITIES
classusage
ABAPALVDemoprograms
10
WebdynproabapError/Successmessage
sampleprogram
http://www.ansapconsultant.com/2012/03/webdynproabapdownloadfile.html
1/5
08/06/2015
AnSAPConsultant:WebDynproABAPDownloadfile
Code
Websites I follow
METHODget_data.
DATAlo_nd_emp_detTYPEREFTOif_wd_context_node.
DATAlt_emp_detTYPEwd_this>elements_emp_det.
HTML/CSS/Javscript Generator
*navigatefrom<CONTEXT>to<EMP_DET>vialeadselection
lo_nd_emp_det=wd_context>get_child_node(name=wd_this>wdctx_emp_det).
SELECT*
FROMpa0002
INTOCORRESPONDINGFIELDSOFTABLElt_emp_detUPTO30ROWS.
lo_nd_emp_det>bind_table(new_items=lt_emp_detset_initial_elements=abap_true
ENDMETHOD.
Go to view DOWNLOAD_V
Context tab->Map Component Controller context to View Context.
Layout tab->Create Button UI element for downloading file-> Create OnAction event DOWNLOAD_DATA for
the button.
http://www.ansapconsultant.com/2012/03/webdynproabapdownloadfile.html
2/5
08/06/2015
AnSAPConsultant:WebDynproABAPDownloadfile
Code
METHODonactiondownload_data.
DATAlo_nd_emp_detTYPEREFTOif_wd_context_node.
DATA:
lt_emp_detTYPEwd_this>elements_emp_det,
ls_emp_detTYPEwd_this>element_emp_det.
DATA:
strTYPEstring,
xstrTYPExstring.
*navigatefrom<CONTEXT>to<EMP_DET>vialeadselection
lo_nd_emp_det=wd_context>get_child_node(name=wd_this>wdctx_emp_det).
lo_nd_emp_det>get_static_attributes_table(IMPORTINGtable=lt_emp_det).
"Preparedownloadfile.
LOOPATlt_emp_detINTOls_emp_det.
CONCATENATEstr
ls_emp_detpernr
ls_emp_detnachn
ls_emp_detvorna
ls_emp_detgbdat
cl_abap_char_utilities=>newline
INTOstr
SEPARATEDBYcl_abap_char_utilities=>horizontal_tab.
ENDLOOP.
CALLFUNCTION'SCMS_STRING_TO_XSTRING'
EXPORTING
text=str
IMPORTING
buffer=xstr
EXCEPTIONS
failed=1.
"Attachfile
CALLMETHODcl_wd_runtime_services=>attach_file_to_response
http://www.ansapconsultant.com/2012/03/webdynproabapdownloadfile.html
3/5
08/06/2015
AnSAPConsultant:WebDynproABAPDownloadfile
EXPORTING
i_filename='Download.xls'
i_content=xstr
i_mime_type='EXCEL'
i_in_new_window=abap_false
i_inplace=abap_false.
ENDMETHOD.
Methods tab->Call GET_DATA method in WDDOINIT method to get EMP_DET node elements to display in
Table.
methodWDDOINIT.
DATAlo_componentcontrollerTYPEREFTOig_componentcontroller.
lo_componentcontroller=wd_this>get_componentcontroller_ctr().
lo_componentcontroller>get_data().
endmethod.
Save and Activate Web Dynpro component.
Create Web Dynpro Application and Save it as local object.
http://www.ansapconsultant.com/2012/03/webdynproabapdownloadfile.html
4/5
08/06/2015
AnSAPConsultant:WebDynproABAPDownloadfile
Recommend this on Google
3 comments:
Sukaniya Mishra May 4, 2013 at 6:26 PM
I am a SAP ABAP/ITS Consultant. I am working for one of the largest MNC in India as a SAP ABAP/ ITS developer from past one year.
During this period I have been working on ABAP and Internet Transaction Server(ITS). My major work has been on ITS(Both of my
Projects). So I would like to know whether I should continue working on ABAP/ITS or I should pursue a career in SAP WebDynpro
and later go SAP EP Cretfication. Which would add much better value to my Career? Working on ABAP or a career in SAP
WebDynpro?
Well got across this online course for SAP as well. http://www.wiziq.com/course/8153-sap-web-dynpro-pro-abap-training
Wonder it works for me.
Reply
Enteryourcomment...
Commentas:
Publish
GoogleAccount
Preview
An SAP Consultant
Follow US
Contact US
About US
Privacy Policy
Want to Contribute ?
you learn everyday while working, please write to
the.sap.consultants@gmail.com.
Twitter
Google
2014ansapconsultant.comAllrightsreserved.
http://www.ansapconsultant.com/2012/03/webdynproabapdownloadfile.html
5/5