Upload a CSV Excel File or Text File in SAP CRM WebUI SAP CRM Technical Consultants sometimes comes across a requirement from the clients on business scenarios where they are asked to upload a File from the Presentation Server e!" #esktop$ PC$ %aptop$ etc! & into Application Server i!e SAP CRM System! This may be due a wide ran"e of business requirements ran"in" from Mass 'perations like bulk upload of (usiness Partners in the system and mass upload of data from e)ternal sources for %ead *eneration! (ased on the business case either a plain and simple +at ,le is used or a CS- File can also be fed into! Te)t File has the +e)ibility ofplatform independence and can be used and downloaded across multiple environments! .n the sample code below$ either a CS- File can be used or a te)t ,le can also be used! . have created my own / Co mponent and have used the SAP Standard Component 0 GS_FILE_UPLOADas a component usa"e in my component! 1ere the only intention is to upload a table of (usiness Partners into the system! Assumptions . have made the followin" assumptions re"ardin" the technical skill which . feel is a prerequisite in order to e)ecute the sample e)ample provided in this document! • 1ave knowled"e on SAP CRM 2eb 3. Pro"ramin" • 1ave knowled"e on Component creation$ -iew and Runtime Repository 4ditors • 1ave knowled"e on Component 3sa"e .f you don5t have e)tensive skills in the above mentioned topics still you can proceed with this document! (ut you may need to refer some document on basics of SAP CRM 2eb 3. pro"rammin"! . "uess ther e must be some e) ist in" compon ent in the syste m! .f you don 5t hav e an e)ist in" component then you can create a sample component with any model node! This is 6ust for your reference and will brush up your old skills of component creation! 4)ecute the CRM 2eb 3. workbench Transaction Code 7 BSP_WD_CMPWB! Create a component here and to""le o8 the enhancement set button as we will not be enhancin" any standard component here! 9e)t step is to create a new -iew as shown below 7
14
Embed
Upload a CSV Excel File or Text File in SAP CRM WebUI
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI
Upload a CSV Excel File or Text File in SAPCRM WebUI SAP CRM Technical Consultants sometimes comes across a requirement from the clients on businessscenarios where they are asked to upload a File from the Presentation Server e!" #esktop$ PC$%aptop$ etc! & into Application Server i!e SAP CRM System! This may be due a wide ran"e of businessrequirements ran"in" from Mass 'perations like bulk upload of (usiness Partners in the system andmass upload of data from e)ternal sources for %ead *eneration! (ased on the business case either aplain and simple +at ,le is used or a CS- File can also be fed into! Te)t File has the +e)ibility of platform independence and can be used and downloaded across multiple environments! .n the sample code below$ either a CS- File can be used or a te)t ,le can also be used! . have createdmy own / Component and have used the SAP Standard Component 0 GS_FILE_UPLOAD as acomponent usa"e in my component! 1ere the only intention is to upload a table of (usiness Partnersinto the system! Assumptions . have made the followin" assumptions re"ardin" the technical skill which . feel is a prerequisite inorder to e)ecute the sample e)ample provided in this document!
• 1ave knowled"e on SAP CRM 2eb 3. Pro"ramin"• 1ave knowled"e on Component creation$ -iew and Runtime Repository 4ditors• 1ave knowled"e on Component 3sa"e
.f you don5t have e)tensive skills in the above mentioned topics still you can proceed with thisdocument! (ut you may need to refer some document on basics of SAP CRM 2eb 3. pro"rammin"! . "uess there must be some e)istin" component in the system! .f you don5t have an e)istin"component then you can create a sample component with any model node! This is 6ust for yourreference and will brush up your old skills of component creation! 4)ecute the CRM 2eb 3. workbench Transaction Code 7 BSP_WD_CMPWB ! Create a component here
and to""le o8 the enhancement set button as we will not be enhancin" any standard component here!
9e)t step is to create a new -iew as shown below 7
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI
Add or create a 9ew 9ode with the structure already de,ned as shown below and then complete thesubsequent steps to complete the view creation! Then add the view into the Runtime Repository!
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI
.f you have an already e)istin" 2eb 3. Component$ then in order to upload Te)t:CS- 4)cel Files in SAPCRM 2eb Client 3. the followin" steps needed to be performed! 2e will be usin" an already e)istin"2eb 3. Component as component usa"e and there is no further requirement of ;avaScript Codin"! Thee)cel ,les that need to be uploaded must be of type CS- < comma separated values e)cel! .nadditional plain te)t ,les can also be used! The uploaded data is stored as content in a strin"!
3se an already e)istin" SAP CRM 2eb 3. component
Create a 9ew -iew
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI
#e,ne the followin" Popup Access .nterface in the .mplementation Class of the -iew
.n the other Method < 41>'93P%'A#>P'P3P>C%'S4# put the followin" piece of code! 1ere based onthe content we need to classify the data into appropriate structure!
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI
T PES! BEGI" OF l_#$_a##%_s#%uc#& 'us(nesspa%#ne% T PE 'u_pa%#ne%& pa%#ne%desc%(p#(on T PE 'u_desc%(p_lon)& E"D OF l_#$_a##%_s#%uc#.
DATA!l_*_+le_con#en# T PE s#%(n)& l_(_+le_con#en# T PE s#%(n)#a'& l_*_+le_#$pe T PE s#%(n)& l_*_+le_na,e T PE s#%(n)& l_o_ou#pu#node T PE -EF TO cl_'sp_ d_con#e/#_node& l_o_collec#(on_ %appe% T PE -EF TO cl_'sp_ d_collec#(on_ %appe%&
l_(0_p%ope%#$ T PE -EF TO (0_'ol_'o_p%ope%#$_access& l_o_,s)_se%*(ce T PE -EF TO cl_'sp_ d_,essa)e_se%*(ce& l_(_'p T PE 1'upa_desc& l_ a_'p T PE 1'upa_desc& l_*_s#a#us T PE 1,e,'e%_s#a#us& l_o_en#(#$ T PE -EF TO cl_c%,_'ol_en#(#$& l_(_%e#u%n T PE 'ap(%e#2_#& l_ a_%e#u%n T PE 'ap(%e#2& l_*_s#%uc#_%e0 T PE -EF TO 1accoun#_upload3& l_o_*alue_node T PE -EF TO cl_'sp_ d_*alue_node& l_(0_'o_coll T PE -EF TO (0_'ol_'o_col&
7/21/2019 Upload a CSV Excel File or Text File in SAP CRM WebUI