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

clarification in flow

Former Member
0 Likes
643

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

5801

5802

5803

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

5801-3605T

5801-3605R

5801-3605s

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

Rachel

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.

endif.

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.

endif.

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.

endif.

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.

endif.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
611

1. If Channel ID can be BLANK and still you are looking for the output then no need to check for NULL.

but, if has to get some value then its betterto check for NULL to avoid unnecessary processing.

2. You can do as you want to, SPLIT or CONCATENATE.

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

5801

5802

5803

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

5801-3605T

5801-3605R

5801-3605s

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

Rachel

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.

endif.

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.

endif.

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.

endif.

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.

endif.

2 REPLIES 2
Read only

amit_khare
Active Contributor
0 Likes
612

1. If Channel ID can be BLANK and still you are looking for the output then no need to check for NULL.

but, if has to get some value then its betterto check for NULL to avoid unnecessary processing.

2. You can do as you want to, SPLIT or CONCATENATE.

Read only

0 Likes
611

thanx amit

the reply was so help , i jus want to know , whether wat i have written is right then?????

regards

Rachel