Posts

Showing posts from March, 2024

Data Migration Techniques

  Q. What is a data migration ? In SAP We generally use this term to migrate the data from legacy system to SAP System. Data Migration is also known as data transfer of data which means transfer of data from Legacy System to SAP System. Data migration  allows you to prepare and move all data from existing legacy systems to your SAP Business ByDesign solution. Example :- Suppose, You are working on some other NON SAP Platform for your business purpose and now you want to shift to SAP for your business, then You can use these Data Migration techniques to migrate your legacy data to SAP Data. Q. What is a Legacy System ? The system other than the SAP System is called as legacy system. It is also called as Non- SAP system. This system contains the data that we will transfer. Data Migration Techniques :- There are three main data migration techniques that we use :- 1. BAPI ( Business Application Programming Interface ) 2. BDC ( Batch Data Communication ) 3. ...

Reading File On Application Server

Image
  for Reading the Data on Application Server, we need to follow the given steps :- OPEN DATASET ( file path ) FOR INPUT IN TEXT MODE ENCODING DEFAULT. TRANSFER ( DATA ) to ( File path ) CLOSE DATASET In the previous part, we have created a file on the application server. Now, we will read that file on the application server. Requirement :- How to read a file on the Application Server ? Hints :- Open the file. Read the Data one by one Close the file Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Declare the created file in the previous part. Step 3 :- Open the File using FOR INPUT. Step 4 :- Create a type structure for the VBAK table which we have used and then create a internal table and work area for it and also create a variable for string in which we will store file data. Step 5 :- Use loop to read the file and stored it into string variable and then split it into the above work area and then append it ...

Writing File on Application Server

Image
  The most important transaction code for File Handling on Application Server is AL11. AL11 is a transaction code for SAP Directories. Below are few statements which are important to work with File Handling on Application Server. OPEN DATASET :- Opens the specified file CLOSE DATASET :- Closes the specified table. DELETE DATASET :- Deletes the specified file. READ DATASET :- Read a record from the file. TRANSFER :- Write a record into a file. Requirement :- let’s take a requirement to understand it more clearly. Suppose, User gave a Sales Document number as input on the select screen. I will store the details of Sales Document number in a internal table. Then I will store it a directory of AL11 transaction code. Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Create a type structure and a corresponding internal table for the type structure. Step 3 :- Create a select option through which user will give input on the sele...

Writing File Using Methods Of CL_GUI_FRONTEND SERVICES

Image
  CL_GUI_FRONTEND SERVICES is one of the important classes provided by SAP in object oriented concepts. In ABAP we can use GUI_DOWNLOAD method of CL_GUI_FRONTEND_SERVICES to download the contents of a internal table into file. Requirement :- Use want to download the details of Sales Document for a particular range into his local desktop. Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Create a type structure for VBAK table and then create its corresponding internal table. Step 3 :- create a select option for user input. Step 4 :- Write select queries to fetch the details. Step 5 :- Use method GUI_DOWNLOAD of CL_GUI_FRONTEND_SERVICES to download the file. Code :- *&---------------------------------------------------------------------* *& Report ZAR_FILE_DOWNLOAD *&---------------------------------------------------------------------* *& *&------------------------------------------------------------...

Reading File Using Methods Of CL_GUI_FRONTEND SERVICES

Image
  CL_GUI_FRONTEND SERVICES is one of the important classes provided by SAP in object oriented concepts. Let’s take a requirement, suppose, we have a employee data We have a employee record in a notepad and we have to read the data from the notepad. We will read this data and display inform of ALV. We will use methods of CL_GUI_FRONTEND_SERVICES to achieve this requirement. Hint :- We will use FILE_OPEN_DIALOG method to select a file. then we will use GUI_UPLOAD METHOD to upload data. then we will display it in form of ALV. Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Create a type structure for the data which you want to upload. Step 3 :- In start of selection use method FILE_OPEN_DIALOG to select data from your PC. Step :- Use GUI_UPLOAD method of CL_GUI_FRONTEND_SERVICES to upload data. Step 5 :- Now our data is stored into internal table of file, so we need to display it in a alv, so we will use CL_SALV_...

Writing data to a file in ABAP in File Handling

Image
  In ABAP we can use GUI_DOWNLOAD function module to download the contents of a internal table into file. let’s take a requirement to understand it more clearly. Requirement :- Use want to download the details of Sales Document for a particular range into his local desktop. Hints:- We will use F4_FILENAME function module to select the file name from our PC then we will use GUI_DOWNLOAD function module to download the contents into our local system. Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Create a type structure for VBAK table and then create its corresponding internal table. Step 3 :- create a select option for user input. Step 4 :- Create a parameter to take file name from our local system. Step 4 :- Use At selection screen for value request and then call F4_FILENAME function module. Step 5 :- In start of selection we will write select query to fetch data into internal table. Use Function module GUI_D...

File Handling in ABAP

Image
  File :- File is a place where data is stored. File handling means the various operations like Opening the File, Closing the file, deleting the file, Reading the file, Writing the file. File Handling on Presentation Server :- To work with files on Presentation Server, SAP provided the various Function Modules. GUI_UPLOAD :- Reading data from a file on Presentation server. GUI_DOWNLOAD :- Writing data to a file on Presentation server. let’s take a requirement to understand it more clearly Requirement :- We have a employee record in a notepad and we have to read the data from the notepad. We will read this data and display inform of ALV. Solution :- Step 1 :- Create a executable program in ABAP Editor. Step 2 :- Create a parameter of type LOCALFILE. Step 3 :- Now we need to give a F4 help for our local file. To achieve this purpose, we will use AT SELECTION-SCREEN on value request event. Step 4 :- Now, when user will click F4 on selecti...