Skip to Content

issue with type cast in sap when fetching data

Aug 14, 2017 at 01:30 PM


avatar image

hello experts,

I have a question when fetching data from COBRB table where objnr ( char22) in COBRB table should be equal to PRPS -POSID ,( posid in prps table char24) . I know we can move the contents into temporary internal table where the temp table has char 22 and assign the contents to temp table and based on the temp table ftech data from cobrb table. Instead of doing this type cast is there any other alternative?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jay Raj Aug 14, 2017 at 04:15 PM


10 |10000 characters needed characters left characters exceeded
Sandra Rossi Aug 14, 2017 at 05:55 PM

The limitation is only for the ON clause of the join -> the data type of the joined columns must be identical.

You may cheat the ABAP compiler by transferring the problematic join conditions to the WHERE clause, where you can specify LEFT or SUBSTRING functions for instance. If it's forbidden to have 0 condition in the ON clause, so if it happens, you may join the client (MANDT) columns by adding the ABAP words CLIENT SPECIFIED.

You may sometimes use the EXISTS function is you don't need to extract the columns from the EXISTS subquery.

Of course, there is also FOR ALL ENTRIES, where you can "join" on a substring of the field of the FAE internal table (column = fae_itab-column(10)).

10 |10000 characters needed characters left characters exceeded