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

Joining table

Former Member
0 Likes
550

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
Read only

Former Member
0 Likes
503

Simply use UNPACK statement

pls don't forget to reward

S@meer

Read only

0 Likes
503

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.

Read only

varma_narayana
Active Contributor
0 Likes
503

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>