Skip to Content
Former Member
Feb 26, 2009 at 07:04 AM

clarification in flow


Hi Experts....

My selection screen is as below

companycode---> mandatory

Channel id

origin id ---> Mandatory

Bill date -

> Mandatory

my channel id is in a z table and stored in the table like




in order to link this in the next table (xblnr-Bkpf) the channel id is stored as




I need to cut the remaining half from - "hyphen' and link with the bkpf table

(i.e) 5801 from z table and all that satisfies with 5801 in xblnr-BKPF

My doubts is that....

1. is it neccessary to check channel id for is not inital , since it is notobligatory in my selection screen.

2. is it right to concatenate and check for '-' hyphen or i should

split and check .....

If iam wrong in the coding, can you please correct me?????

Thankx in advance


part of my coding


select channel_id from zft_oa_channel into corresponding fields of table it_zchannel

where channel_id = pr_chaid.

if it_zchannel[] is not initial.

concatenate pr_chaid+0(4) '%' into pr_chaid.

select bukrs belnr gjahr bldat xblnr from bkpf into corresponding fields of table it_bkpf

where bukrs = pr_bukrs

and bldat in so_bldat

and blart = 'AR'

*and belnr = wa_bkpf-belnr

*and gjahr = wa_bkpf-gjahr

and xblnr like pr_chaid.


if it_bkpf[] is not initial.

select bukrs belnr gjahr xref1 xref2 kunnr dmbtr from bseg into corresponding fields of table it_bseg

for all entries in it_bkpf

where bukrs = it_bkpf-bukrs

and belnr = it_bkpf-belnr

and gjahr = it_bkpf-gjahr.

  • and kunnr = wa_bseg-kunnr.


if it_bseg[] is not initial.

select kunnr name1 locco from kna1 into corresponding fields of table it_kna1

for all entries in it_bseg

where kunnr = it_bseg-kunnr and

locco = pr_locco.


loop at it_bseg into wa_bseg where belnr = wa_bseg-belnr.

wa_final-kunnr = wa_bseg-kunnr.

wa_final-xref1 = wa_bseg-xref1.

wa_final-xref2 = wa_bseg-xref2.

wa_final-dmbtr = wa_bseg-dmbtr.

read table it_bkpf into wa_bkpf with key belnr = wa_bkpf-belnr.

if sy-subrc = 0.

wa_final-xblnr = wa_bkpf-xblnr.

wa_final-bldat = wa_bkpf-bldat.