

To proceed further, go to the cell where we want to paste the data, then from the Paste option, which is under the Home menu tab, select the Transpose option. In Excel, to convert any Columns to Rows, first select the column which we want to switch and copy the selected cells or columns. Because of these preferences, you may find yourself in a situation where you need to switch the data in Excel. Some people prefer to have the data reversed horizontally across columns. For instance, some people construct spreadsheets in Excel with the primary fields arranged in a horizontal fashion. Different people will look at the data in different ways. The columnar data may be a mess, with various properties scattered across several columns.

It is preferred, in general, for each row of data to be analogous to a record and to contain a single data point. If there are any questions, please comment below.You may be curious how it is going to help if we take data that is organised in many columns and turn it into rows. Executing this logic for the above shown excel file will result in two records as shown below :Ĭonverting columns to rows can also be acheived using the similar logic, just need to look for correct field references for the destination table. Reference to the particular field of the target structure is obtained and the excel value is assigned to it. * rollnr entry exists in the internal table, further characteristics to be added.

ĪSSIGN COMPONENT ls_excl-fname OF STRUCTURE TO. READ TABLE ot_main_old INTO WITH KEY rollnr = ls_excl-rollnr. * Add entry for new rollnr in the internal table.ĪPPEND INITIAL LINE TO ot_vpemain ASSIGNING. Ot_vpemain contains the converted data in the db table format.Ĭonversion logic as follows: LOOP AT ot_excl INTO ls_excl. There may be any number of records for one object depending upon the number of fields to be updated for that object.Ĭonversion of excel data to the table formatĭata type to hold the excel data consists of three columns only as shown above in the excel. The format of the excel file is as follows:

The table contains 180 columns with one primary key. In this blog, I will discuss about how to convert excel data from row format to column format.Ĭustom table records have to be updated from the excel file.
