Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

write a program to clean the data

Former Member
0 Likes
796

Hi Experts,

I have to build a program which has to read all the fields in a ".xls" file and output into a ".txt" file.

The thing is there is some unwanted data(fields) in the ".xls" file, so i have to clean some of that data and output only those data(fields) which are useful - into the ".txt" file, so that this file can later be uploaded into SAP using an Interface.

Could you tell me what is the appropriate procedure to get this thing done?

Thank you very much,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
701

Upload your excel file data into an Internal table using some func module like ALSM_EXCEL_TO_INTERNAL_TABLE.

Move your cleansed data to a different Itab.

Download this itab into a .txt file using GUI_DOWNLOAD

4 REPLIES 4
Read only

Former Member
0 Likes
701

Hi Dev,

Use WS_UPLOAD & get the data in to your internal table.Do your process of cleaning the data & use WS_DOWNLOAD to download the data into a file.

I guess it s'd be quite simple,unless you have some complex requirement here.

Read only

Former Member
0 Likes
701

Hi..

First of all read the excel data into an internal table using a function module GUI_UPLOAD or use the method GUI_UPLOAD of the class CL_GUI_FRONTEND_SERVICES.

Loop at the internal and process each record and either transfer the required data into another internal table or delete the unwanted from the same table.

Use the function module GUI_DOWNLOAD or the method GUI_DOWNLOAD of the class CL_GUI_FRONTEND_SERVICES to download data into a text file.

The program should contain Input and Output file paths as Selection Screen parameters.

Regards,

Vara

Read only

Former Member
0 Likes
702

Upload your excel file data into an Internal table using some func module like ALSM_EXCEL_TO_INTERNAL_TABLE.

Move your cleansed data to a different Itab.

Download this itab into a .txt file using GUI_DOWNLOAD

Read only

0 Likes
701

Thanks all