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

Data mismatch between fields

Former Member
0 Likes
881

Hi All,

I need to fetch data from BKPF and MARA using the below condition. However,Since awkey is char20 and refdocnr is char10

there is a data mismatch due to which im getting an error.

Select < field1,field2,....> FROM BKPF

                                         INTO TABLE t_BKPF

                                        for all entries in T_MARA

                                        WHERE awkey = t_MARA-refdocnr

Please let me know how to handle this?

Thanks ,

Faiz.

4 REPLIES 4
Read only

FredericGirod
Active Contributor
0 Likes
798

Hi,

you will have to add a field in your T_MARA table, and convert the CHAR20 to CHAR10 field

loop at t_mara.

move t_mara-refdocnr to t_mara-refdocnr2

modify t_mara.

endloop.

...

regards

Fred

Read only

Former Member
0 Likes
798

Hi Faizur,

Take another internal table with  field length of MARA-refdocnr as 20 .

Loop the first internal table and move all the records into the internal table 2 .

now use internal table 2 in for all entries statement .

Read only

VijayaKrishnaG
Active Contributor
0 Likes
798

Hi Rahman,

When you are writing condition on AWKEY (Char 20) it is a combination of some document number and some other data like Year. So, even you increase the length from 10 to 20 there you cannot match AWKEY with your Ref.Doc.Num. You should concatenate as per AWKEY format in BKPF to fetch data.

And even I did not find any field with Ref.Document Number in MARA.

Thanks & Regards,

Vijay

Read only

Former Member
0 Likes
798

Hi Faizur,

1. Create a structure of type MARA.

2. In that structure change the type of field 'refdocnr' to the type of awkey in bkpf.

Now the select query should work.

Thanks & Regards,

Imran.