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

Values get swapped when selecting data

Former Member
0 Likes
1,080

Hi,

Please help me out for the below issue.

Problem:

Two servers, NSA and NDA.

Select statement to a particular table correctly retrieves data from NSA server.

The same select statement to the same table swaps the values between 2 fields and retrieves incorrect data from NDA server.

Investigation:

When debuggin in NDA, i found that the values are getting swapped between 2 fields which are adjacent to each other in NDA server.

Solution

Please help:(

Regards,

Raja

10 REPLIES 10
Read only

Former Member
0 Likes
1,047

Hi,

Check the table field names both in NDS and NDA server are same. fetching from the table in the select query.

Otherwise write two separate select queries that differentiate between the servers with the appropriate field names of the tables that are present in both the servers

Read only

0 Likes
1,047

Hi,

Everything is identical 100% in both the servers but the value swap happens only in NDA.

Read only

0 Likes
1,047

Hi,

Use the following code.

types: begin of y_test,

field1 type tablename-fieldname1,

field2 type tablename-fieldname2,

-


,

end of y_test.

data: t_test type standard table of y_test.

select fieldname1 fieldname2 -


from tablename

into corresponding fields of table t_test

where condition.

Read only

Former Member
0 Likes
1,047

Hi Raja .,

Please check the fields Sequence in Select Query And internal table declaration .

otherwise , Ofcource it is not recomanded use ' into Corresponding Fields .

thanks

Sreenivas Reddy

Read only

0 Likes
1,047

Hi sreenivas,

Everything is identical 100%, that includes field sequence also.Correspond fields addition is also not used.

Any other clue?

Read only

0 Likes
1,047

is it a custom table. or Standard one.

Did you check the internal table definition properly...

Read only

0 Likes
1,047

Hi Vijay,

It is a custom table and the Data fetch is a "SELECT SINGLE" so no need of internal table.

The values are fetched into individual fields as export parameters for the function module.

Read only

Former Member
0 Likes
1,047

Chech that the internal table declaration in both the server are exactly the same and fileds are in same order.

Use INTO CORRESPONDING if possible.

Read only

Former Member
0 Likes
1,047

The values maintained in the tables in both the servers could be swapped.

Like :

Tab1 on server 1

field 1 = 5

field 2 = 6

Tab1 on server 2

field 1 = 6

field 2 = 5

hope this helps.

raegrds,

Read only

Former Member
0 Likes
1,047

hello everyone,

This problem had something to do with my Previous thread on "Open SQL error". The problem was the ABAP Dictionary structure was inconsistent with the Database structure, hence in one situation i was getting an "ORACLE error:12839" and Values were getting swapped among certain fields(Inconsistent fields) in another situatuion.

Now that the Table structure is made consistent with the database structure, things should be working fine.

If anything i will get back:)

Thanks for your support,

Cheers,

Raja