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

code related minor prob

Former Member
0 Likes
428

hi experts,

currently i am working on an alv grid report,

it will display from tables like : bkpf, bseg, lfa1, makt,ekbz.

etc ok

1. i made select from bkpf with date as input(bkpf-budat)

to fetch belnr, bldat, budat, xblnr,awkey

2. them i ve to fetch data from ekbz with date as input to fetch

ebeln, budat, belnr, bewtp( m or f).

3. i select from bseg , for all entries in it_bkpf

where belnr = it_bkpf-belnr,

to fetch belnr, buzei,buzid( f or t), dmbtr, lifnr, matnr ok

.

my requirement is like that,

1. when it_bkpf-awkey1(which is truncated by excluding its last 4 digit) will match it_ekbz-belnr(bewtp = 'M'), and it will be sapinvoice no(field ekbz-belnr).

i ve done it successfully,using read table it_ekbz wirh key belnr = it_bkpf-awkey1 logic

bt the other ekbz-belnr that dont matches with bkpf-awkey1 and ekbz-bewtp = 'F'.

sd be Grn No(ekbz-belnr), bt the fact is bkpf-akkey1 dont matches with ekbz-belnr,

mind that bkpf-gjahr = ekbz-ghajr wont applicable here

how can i do this?

plz help

hi experts,

currently i am working on an alv grid report,

it will display from tables like : bkpf, bseg, lfa1, makt,ekbz.

etc ok

1. i made select from bkpf with date as input(bkpf-budat)

to fetch belnr, bldat, budat, xblnr,awkey

2. them i ve to fetch data from ekbz with date as input to fetch

ebeln, budat, belnr, bewtp( m or f).

3. i select from bseg , for all entries in it_bkpf

where belnr = it_bkpf-belnr,

to fetch belnr, buzei,buzid( f or t), dmbtr, lifnr, matnr ok

.

my requirement is like that,

1. when it_bkpf-awkey1(which is truncated by excluding its last 4 digit) will match it_ekbz-belnr(bewtp = 'M'), and it will be sapinvoice no(field ekbz-belnr).

i ve done it successfully,using read table it_ekbz wirh key belnr = it_bkpf-awkey1 logic

bt the other ekbz-belnr that dont matches with bkpf-awkey1 and ekbz-bewtp = 'F'.

sd be Grn No(ekbz-belnr), bt the fact is bkpf-akkey1 dont matches with ekbz-belnr,

mind that bkpf-gjahr = ekbz-ghajr wont applicable here

how can i do this?

plz help

1 REPLY 1
Read only

Former Member
0 Likes
386

Hi Rajdeep,

I Partially understood your question, I think you are having some problem when you try to execute the third scenario of your requirement.

If there is some problem with the use of the Internal table 'IT_BKPF' obtained in the first query in using at the third scenario, I mean at the time of querying BSEG, then do it as follows:

1) Try to declare some other internal table with same fields except the data type for awkey.

2) Here in this new Internal table use the respective field's data type which is present in the BSEG.

3) populate that new internal table before you execute the third select statement on BSEG.

4) This reduces your shordump due to incosistencies in the data type.

This solution assumed to be suitable if there is a short dump because of the inconsisten in the datatypes of the different tables.

I Hope it is useful.

Thank you,

Regards,

Shashikanth. D