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

Shift data to emty fields...

Former Member
0 Likes
583

HI experts

I have one reqirement in which i need to shift fields with data to without data..

E.g

If internal table 2nd field is empty and 3rd field is having data then it should shift data to 2nd field...

6 REPLIES 6
Read only

Former Member
0 Likes
560

Hi,

Just use like this.

If itab-field1 is initial.

    Move itab-field2 to itab-field1.

     Endif.

P.S But make sure that both fields are of same data type and no loss of data is happening.

Thanks

Nitesh

Read only

Former Member
0 Likes
560

Hi,

you can use the following simple logic

IF itab-field2 is initial and

itab-field3 is not initial.

itab-field2 = itab-field3.

modify itab index sy-tabix.

endif.

Hope this helps you.

Raj

Read only

Former Member
0 Likes
560

use this ogic:

if itab-field2 is initial and

itab-field3 is not initial

mov itab-filed3 to itab-field2.

modify itab index sy-tabix.

endif.

Hope this helps,

Rahul

Edited by: Rahul Kumar Sinha on Dec 6, 2008 8:17 AM

Read only

Former Member
0 Likes
560

I have 10 fields like this and need to do same for all these fields...

Read only

0 Likes
560

use move corresponding fields statement.

Hope it will help u.

Regards,

Rahul

Read only

Former Member
0 Likes
560

thanks solved