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

RFC_READ_TABLE + non-unicode

former_member202771
Contributor
0 Likes
1,218

Hi Experts,

I am using RFC_READ_TABLE to get data from different R/3 systems.
There is no problem while getting data from Unicode systems.
But when I run the same query on t006 table with a non-unicode system, I am getting a sy-subrc as 7.

Error occurs at type casting

ASSIGN WORK TO <WA> CASTING TYPE (QUERY_TABLE).  - line 166 of the FM.


This error doent come when I am using table T006A.

I suspect difference between T006 and T006A (unicode direction) is, T006 has field names as name1_name2. I suppose, '_' is the reason for above error.


Please let me know how to correct the issue.

I have searched for alternate FMs

<b>RFC_GET_TABLE_ENTRIES

TABLE_ENTRIES_GET_VIA_RFC

GET_TABLE_RFC</b>

All of them seem to be unreleased by SAP.

kindly share your expertise in resolving the issue.

Thanks and Regards,

Anil Supraj




5 REPLIES 5
Read only

vamsixk
Active Participant
0 Likes
969

Hi Anil,

the T006 table has some domain for which the Casting operation may not be supported for some data types.

i suspect that the casting operation might be failing for the field "TEMP_VALUE",  try excluding these suspect fields.

also please cross check the structure of the field in the internal table in which you are storing the data(when you are calling the FM) and the definition of the structure that is there in the target system that is causing this sy-subrc failure.

there could be a mismatch between the structure definitions.

Do let me know if you require any further inputs.

regards,

Vamsi

Read only

0 Likes
969

Hi Vamsi,

Type casting statement,

ASSIGN WORK TO <WA> CASTING TYPE (QUERY_TABLE).  - line 166 of the FM.

is not dependent on fields which we are passing. Only dependant variable is (QUERY_TABLE) which is T006 in our case.

Yes the error should be because of "TEMP_VALUE" and other fields of format name1_name2. But passing required fields to FM is not helping.


Thanks,

Anil

Read only

vamsixk
Active Participant
0 Likes
969

Hi Anil,

we should be able to fetch the data on a field by field basis.

try one field at a time to understand how the FM accepts the input.

as far as the casting statement is concerned try to check the sy-subrc value right after the statement and see if that helps you in anyway.

regards,

Vamsi

Read only

0 Likes
969

No Vamsi. I have tried passing seperate fields.
It doesnt work with non-unicode systems.

Thanks,

Anil

Read only

former_member202771
Contributor
0 Likes
969

Hi Experts,

A correction :

Error is not because of the highlighted in grey.

Even for non-unicode system, it works for table which have field names like name1, name2 (eg. T006A) etc.. But fails for tables with field names like name1_name2 (T006-TEMP_VALUE).

It is because of below highlighted in yellow.

We are unable to read table data for those table which have data type defined as float (FLTP).


Thanks,

Anil