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: 

concated field( urgent)

Former Member
0 Kudos

hi ,

this is very urgent.

Select AWKEY from BKPF.

AWKEY is the concatenated form of BELNR and GJAHR.

Input this to RSEG in BELNR and GJAHR.

You will get EBELN and EBELP.

can any one suggest me any process, how to split that awkey key for chking belnr and gjahr.

thanks

Santosini

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use the code as follows.

Select AWKEY from BKPF.

select ebeln ebelp from rseg where belnr = awkey+0(9)

and gjahr = awkey+10(4).

Regards,

Sanakr.

4 REPLIES 4

Former Member
0 Kudos

Hi,

In my system i could see the AWKEY is combination of BELNR + BUKRS + GJAHR. It has 20 char length but in table field it has 18 characters filled.

Please refer below code:


belnr = object(10)
BUKRS = object+10(4)
GJAHR = object+14(4).

Thanks,

Sriram Ponna.

Former Member
0 Kudos

select awkey

from bkpf

into gv_awkey

where < conditions >.

if not gv_awkey is initial.

Gv_belnr = gv_awkey(10).

Gv_gjahr = gv_awkey+14(4).

Endif.

If not gv_belnr is initial and not gv_gjahr is initial.

Select ebeln

Ebelp

From rseg

Into < data variables >

Where belnr = gv_belnr

And gjahr = gv_gjahr.

Endif.

If helpfull reward points.

Thanks

Sumanth

Former Member
0 Kudos

Hi,

Use the code as follows.

Select AWKEY from BKPF.

select ebeln ebelp from rseg where belnr = awkey+0(9)

and gjahr = awkey+10(4).

Regards,

Sanakr.

Former Member
0 Kudos

Another option


data:
  begin of wk_area,
    belnr(10)        type c,
    burks(4)         type c,
    gjhar(4)         type c,
  end of wk_area.
  
start-of-selection.

  select single AWKEY.....
  
  
  work-area = bkpf-awkey.

* you now can access
  wk_area-belnr
  wk_area-burks
  wk_area-gjhar