Application Development 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: 

Joining table

Former Member
0 Kudos

Hi,

I wanted to know whether we cann add leading zeros in the join condition

or use offset in the join condition.

select a~kunnr

a~vkorg

from knvv as inner join zcust

on knvv-kunnr+5(5) = zcust-refid.

will the above statemtnet work?

if not then how do we do it. as the length of knvv-kunnr is 10 and zcust-refid is 5.

i have either add leading zeros or use offset on knvv-kunnr to get the values .

can somebody send me a sample code to do this...

thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

Simply use UNPACK statement

pls don't forget to reward

S@meer

0 Kudos

hi sameer,

thanks for the reply but how do i use the upack statement in the join.

could send me a sample code of doing this in join.

varma_narayana
Active Contributor
0 Kudos

hi..

You can use offset in the SELECT statement in this case.

select a~kunnr

a~vkorg

from knvv as inner join zcust

on knvv-kunnr+5(5) = zcust-refid.

This will work.

<b>Reward if Helpful</b>