Application Development 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: 

BDC DATASET syntax

Former Member
0 Kudos

Hi friends,

I have 5 structures in a flat file. The data from flat file needs to move into an internal table through work area. When i am using open dataset in my code the total data is not moving from flat file to work area.Only structure 1 is getting moved into internal table.

Here for every new structure in the flat file the cursor moves to the new line feed i.e. if structure 1 data stop at the middle of the line.The next structure of the data in the flat file starts in the new line.Can any one tell me how we should write the open data set .

This program is just to read the file from application server to the internal table .

Please help me .Its very Urgent.

Thanks

Satish Raju

6 REPLIES 6

Former Member
0 Kudos

Do you have any flag in the file which says the associated record belongs to which structure?

You can first move all data to a string and based upon the flag value you can move this string to respective file structures and likewise populate respective internal tables.

ashish

0 Kudos

Hi Ashish,

As you said is ok.But my criteria is different . When I am reading dataset i am not getting total data from flat file to Work area or internal table.Only the first structure data is moving from flat file to internal table. from the second structure of flat file is not moving from flat file to work area. This is because the new structure data always begins with a new line. So generally when we move data from flat file to work area we only get if the data is continuous as per structure but here the condition is it differs in a new line when the structure changes in the flat file. Can you please help me in this issue .

Thanks,,

Satish Raju

0 Kudos

i don't get your problem:

pls post an example

A.

0 Kudos

i have got the problem solved.

Former Member
0 Kudos

I hope your flow is as follows. Also, your file should be a text file, otherwise is you are opening it in binary mode, you will have all of it in one line.

OPEN DATASET dsn IN TEXT MODE....

DO.

READ DATASET dsn INTO something....

IF sy-subrc <> 0.

EXIT.

ENDIF.

move 'something' to itab.

ENDDO.

Former Member
0 Kudos

Resolved myself