leverx sap essential tutorial - simple data extraction
DESCRIPTION
Data extracting can be necessary in many business cases, but mostly for transferring data from one system to another. It could also be for other reasons, but let’s stick with the idea that we have sold a branch of our company and we need to transfer our data to the purchasing company.TRANSCRIPT
![Page 1: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/1.jpg)
1
Essential SAP Tutorial
Simple SAP Data ExtractionBy Jason Thom
SAP Technical Consultant
Copyrighted 2012 by LeverX, Inc.
![Page 2: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/2.jpg)
Tutorial Goal Data extracting can be necessary in many business cases, but mostly for
transferring data from one system to another. It could also be for other reasons, but let’s stick with the idea that we have sold a branch of our company and we need to transfer our data to the purchasing company.
First, we will need to collect the requirements for the customer. This involves finding all the needs of the new system and what data is essential. Then go into your own SAP environment and find all the table-field locations of your data.
2 Copyrighted 2012 by LeverX, Inc.
![Page 3: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/3.jpg)
Tutorial Goal Next, you should map the links between tables. This also includes finding if
the fields are 1:n or 1:1. This will make it easier to do your SELECT statements including INNER JOIN and/or OUTER JOIN statements.
Now your ready to get started!
3 Copyrighted 2012 by LeverX, Inc.
![Page 4: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/4.jpg)
Create New Program Via SE38
4 Copyrighted 2012 by LeverX, Inc.
Program overview:1. Declare your data statements and constants2. Use SELECT statements and collect data into a
single internal table3. Use CALL FUNCTION 'GUI_DOWNLOAD' 4. Write a simple IF statement to display whether or
not the new file was created
![Page 5: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/5.jpg)
Declare DATA, CONSTANTS, and Create SELECT Statements
5 Copyrighted 2012 by LeverX, Inc.
• Every report has a report statement. This will be done automatically for you.• Table MARA is declared for use• lt_output is an internal table like MARA and will be used as the final table to be extracted• wa_output is a work area, or line, of table MARA• lv_outputfile will be the name and location of our newly extracted file• Finally, use as many select statements as needed to get all your data into a single internal table
![Page 6: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/6.jpg)
Conclusion
6 Copyrighted 2012 by LeverX, Inc.
• Filename (lv_outputfile) is being used to declare the name and location of the new file• Filetype ASC is declaring that data should be transferred as ASCII text. Data is converted as
necessary• Under tables, data_tab (lt_outputdata) is the internal table that is being used for extraction• You can use as many exceptions as you need. In this case we are only using one for when sy-subrc =
‘1’.• This IF statement is telling the user if the file could be created or not
![Page 7: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/7.jpg)
Results: The Extracted File
7 Copyrighted 2012 by LeverX, Inc.
![Page 8: LeverX SAP Essential Tutorial - Simple Data Extraction](https://reader036.vdocuments.site/reader036/viewer/2022082606/558ec2e11a28abbb468b456a/html5/thumbnails/8.jpg)
Contact Information
Please contact us for more information about our services or solutions available.
LeverX, Inc. 800 West El Camino Real, Suite 180
Mountain View, CA 94040 USATel: (650) 625 – 8347
Web Site: www.LeverX.com8 Copyrighted 2012 by LeverX, Inc.