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

loading internal table from CSV file in Application server

Former Member
0 Likes
414

HiExperts,

I need to load an internal table from csv file which is located in application server of SAP.

This csv file contains header and item details, now my doubt is how to segregate this header and item details and put in one internal table?

Moderator message: Please do a proper analysis of your requirement and post your question here if you are facing any technical difficulties. You question is purely related to the specification analysis which cannot be helped here.

Message was edited by: Kesavadas Thekkillath

1 REPLY 1
Read only

Former Member
0 Likes
313

Hi,

Header will always be first line. So you can read the internal table with INDEX 1 and you can segregate the header and line item.

First get file contents into a internal table using OPEN DATASET, READ DATASET and CLOSE DATASET.

Then read the internal table with index 1 to get the header line.

Cheers

~Niranjan