â2014 Jan 17 12:59 PM
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.
â2014 Jan 17 1:06 PM
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
â2014 Jan 17 2:58 PM
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 .
â2014 Jan 17 3:50 PM
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
â2014 Jan 17 4:23 PM
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.