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

datatype error for a thing which was not declared in main programm........

Former Member
0 Likes
1,025

hi all,

in a program it was like this ..

it_file1[] = it_out[]..

while going for syntax check it was giving a error like this ..

"IT_FILE1" must be a character-type field (data type C, N, D, or T).

but it_file1 was not declared in the programm..to change the datatype as C,N,etc.,

and in an include tht was declared as below....

data: it_file&1 like &2 occurs 0 with header line...

can any one help me for this.............how can i change the data type of it_file1...it was not allowing to declare tht one in main program ...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
971

hi,

Declare as follows in the Main Program.

Data : it_file1 like it_out occurs 0 with header line.

Regards,

Morris Bond.

Reward Points if helpful.

6 REPLIES 6
Read only

Former Member
0 Likes
971

hi ,

declate the fiel1 type string or

data: file1(100) type c for that it is sloved.

regards,

venkat

Read only

0 Likes
971

hi venkat,

i have tried ur thing..but it was again giving an error like file1 was already declared .....i hope this is because it was already been declared in include....but there they have used a stmnt like....

data: it_file&1 like &2 occurs 0 with header line.

Read only

Former Member
0 Likes
972

hi,

Declare as follows in the Main Program.

Data : it_file1 like it_out occurs 0 with header line.

Regards,

Morris Bond.

Reward Points if helpful.

Read only

0 Likes
971

hi ,

even though i declared like tht it was givining an error like it_file1 already declared as it was already declared in include as follows..

data: it_file&1 like &2 occurs 0 with header line.

how can change datatype here in the above line.....

Read only

former_member188827
Active Contributor
0 Likes
971

in ur main program,declare it_out as:

data:it_out like table of it_file with header line.

den ur assignment will work.

Read only

Former Member
0 Likes
971

Hello,

Is the statement below:

data: it_file&1 like &2 occurs 0 with header line.

part of a macro?

Look for DEFINE .... END-OF-DEFINITION statement.

If it is the &2 is the second parameter and calling the macro and passing a different value for the second parameter wiil allow you to change the type it_file1.

Regards

Greg Kern