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: 

hi

Former Member
0 Kudos

can i use move statement with field strings of diffrent lenghs?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Pradeep,

Go thriugh the following example you will have a clear idea.

Data: Begin of F_Stiring.

Name(10) type c.

age(3) type n,

occu(15) type c.

Data : End of F_string.

Data: begin of int_tab occurs 100,

Name(10) type c.

age(3) type c,

occu(15) type n.

Data : End of int_tab.

move 'john' to f_string-name.

move '100' to f_string-age.

move 'salesman' to f_string-occu.

move f_string to int_tab.

append int_tab.

clear int_tab.

Ouptput.

contents of f_string.

f_string-name = john.

f_string-age = 100.

f_string-occu = salesman.

contents of int_tab.

int_tab-name = john.

int_tab-age = 100 sales

int_tab-occu = man.

So actually when use move statements with field string of different lengths you will get match error.

Because the processorr would see the field string moving charater into integer field as explained in above example.

Reward if helpful.

3 REPLIES 3

Former Member
0 Kudos

Hi Pradeep,

Go thriugh the following example you will have a clear idea.

Data: Begin of F_Stiring.

Name(10) type c.

age(3) type n,

occu(15) type c.

Data : End of F_string.

Data: begin of int_tab occurs 100,

Name(10) type c.

age(3) type c,

occu(15) type n.

Data : End of int_tab.

move 'john' to f_string-name.

move '100' to f_string-age.

move 'salesman' to f_string-occu.

move f_string to int_tab.

append int_tab.

clear int_tab.

Ouptput.

contents of f_string.

f_string-name = john.

f_string-age = 100.

f_string-occu = salesman.

contents of int_tab.

int_tab-name = john.

int_tab-age = 100 sales

int_tab-occu = man.

So actually when use move statements with field string of different lengths you will get match error.

Because the processorr would see the field string moving charater into integer field as explained in above example.

Reward if helpful.

Regards

Raghavendra.D.S

Former Member
0 Kudos

Hi Pradeep,

Go thriugh the following example you will have a clear idea.

Data: Begin of F_Stiring.

Name(10) type c.

age(3) type n,

occu(15) type c.

Data : End of F_string.

Data: begin of int_tab occurs 100,

Name(10) type c.

age(3) type c,

occu(15) type n.

Data : End of int_tab.

move 'john' to f_string-name.

move '100' to f_string-age.

move 'salesman' to f_string-occu.

move f_string to int_tab.

append int_tab.

clear int_tab.

Ouptput.

contents of f_string.

f_string-name = john.

f_string-age = 100.

f_string-occu = salesman.

contents of int_tab.

int_tab-name = john.

int_tab-age = 100 sales

int_tab-occu = man.

So actually when use move statements with field string of different lengths you will get match error.

Because the processorr would see the field string moving charater into integer field as explained in above example.

Reward if helpful.

Former Member
0 Kudos

Hi Pradeep,

Go thriugh the following example you will have a clear idea.

Data: Begin of F_Stiring.

Name(10) type c.

age(3) type n,

occu(15) type c.

Data : End of F_string.

Data: begin of int_tab occurs 100,

Name(10) type c.

age(3) type c,

occu(15) type n.

Data : End of int_tab.

move 'john' to f_string-name.

move '100' to f_string-age.

move 'salesman' to f_string-occu.

move f_string to int_tab.

append int_tab.

clear int_tab.

Ouptput.

contents of f_string.

f_string-name = john.

f_string-age = 100.

f_string-occu = salesman.

contents of int_tab.

int_tab-name = john.

int_tab-age = 100 sales

int_tab-occu = man.

So actually when use move statements with field string of different lengths you will get match error.

Because the processorr would see the field string moving charater into integer field as explained in above example.

Reward if helpful.