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

about offset question

Former Member
0 Likes
1,030

in the table NAST there is a field named OBJKY

I want to use it in the table LIPS. but in the table LIPS there are two key fields.

if I want to select one line in the table LIPS, I need to know the two fields.

But in the table NAST, the field OBJKY contains the two fields together.e.g

in the NAST , the data of the field OBJKY :0080000002000010

but in the LIPS , the VBELN is 0080000002, the POSNR is 000010

so how can I slip the OBJKY to two fields?

select single VBELN POSNR

from LIPS

where VBELN = NAST-OBJKY(10)

and POSNR = NAST-OBJKY(11)+6.

I don't know if it is correct. So I need all you help

Thanks in advance

Nick

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
858

data : v_vbeln like likp-vbeln,

v_posnr like likp-posnr.

v_vbeln = nast-objky+0(9).

v_posnr = nast-objky+10(6).

select single VBELN POSNR

from LIPS

where VBELN = v_vbeln

and POSNR = v_posnr.

Thanks

Seshu

5 REPLIES 5
Read only

former_member196280
Active Contributor
0 Likes
858

Do it like this.

Decalre two variables... for example char1 and char2.

char1 = <b>NAST-OBJKY+0(10).</b>

char2 = <b>NAST-OBJKY+10(6).</b>

select single VBELN POSNR

from LIPS

where VBELN = <b>char1</b>

and POSNR = <b>char2.</b>

Reward points!!

Regards,

SaiRam

Read only

Former Member
0 Likes
858

Hi Nick,

Check if it works,

select single VBELN POSNR

from LIPS

where VBELN = NAST-OBJKY+0(10)

and POSNR = NAST-OBJKY+10(6).

But the best option is create another Internal table with two fields VBELN and POSNR and move OBJKY to these fields and use that internal table to query LIPS.

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
859

data : v_vbeln like likp-vbeln,

v_posnr like likp-posnr.

v_vbeln = nast-objky+0(9).

v_posnr = nast-objky+10(6).

select single VBELN POSNR

from LIPS

where VBELN = v_vbeln

and POSNR = v_posnr.

Thanks

Seshu

Read only

Former Member
0 Likes
858

data : v_vbeln(11),

v_posnr(7).

concatenate NAST-OBJKY(10) '%' into v_vbeln.

concatenate NAST-OBJKY+10(6) '%' into v_posnr.

select single VBELN POSNR

from LIPS

where VBELN like v_vbeln

and POSNR like v_posnr.

regards

shiba dutta

Read only

gopi_narendra
Active Contributor
0 Likes
858
select single VBELN POSNR
from LIPS
where VBELN = NAST-OBJKY(10)
and POSNR = NAST-OBJKY+10(6).

Regards

Gopi