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

vbap-kdmat

Former Member
0 Likes
1,353

hi

i need to get this field. here is what i have written but i am not getting it.

SELECT *

FROM vbrk

INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln

INNER JOIN kna1 ON vbrkkunag = kna1kunnr

INTO corresponding fields of TABLE itab

where

vbrkvbeln in p_vbeln and vbrkkunag in p_kunag and vbrpmatnr in p_matnr and vbrpaugru_auft in p_augru and vbrk~fkdat in P_fkdat .

loop at itab.

select kdmat into itab1-kdmat

from vbap

where vbeln = itab-vbeln .

endselect.

endloop.

***************************************************

there is no value showing up in itab.

is there some special approach for this ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,083

Hi,

Make sure there is data in the table VBRK, VBRP for the corresponding input..

Make sure you are testing this in the right client..

Thanks,

Naren

4 REPLIES 4
Read only

Former Member
0 Likes
1,084

Hi,

Make sure there is data in the table VBRK, VBRP for the corresponding input..

Make sure you are testing this in the right client..

Thanks,

Naren

Read only

Former Member
0 Likes
1,083

Try this:

Data: Begin of it_kdmat occurs 0,

vbeln like vbap-vbeln,

kdmat like vbap-kdmat,

End of it_kdmat.

Data: lv_index like sy-tabix.

If not itab[] is initial.

select vbeln kdmat

into table it_kdmat

for all entries in itab

where vbeln = itab=vbeln.

Endif.

Loop at itab.

lv_index = sy=tabix.

clear it_kdmat.

read table it_kdmat with key vbeln = itab-vbeln.

If sy-subrc eq 0.

itab-kdmat = it_kdmat-kdmat.

Modify itab index lv_index.

Endif.

Endloop.

Thanks,

SKJ

Read only

Former Member
0 Likes
1,083

See the below code :

SELECT *

FROM vbrk

INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln

INNER JOIN kna1 ON vbrkkunag = kna1kunnr

INTO corresponding fields of TABLE itab

where

vbrkvbeln in p_vbeln and vbrkkunag in p_kunag and vbrpmatnr in p_matnr and vbrpaugru_auft in p_augru and vbrk~fkdat in P_fkdat .

loop at itab.

select kdmat into itab1-kdmat

from vbap

where vbeln = <b>itab-aubel</b> .

endselect.

endloop.

If you want to get KDMAT(Custoemr material # ) then you need validate on vbrp-aubel(This is sales order #) and Item number

Reward Points if it is useful

Thanks

Seshu

Read only

Former Member
0 Likes
1,083

hi

good

debug the program and check the detail condition that you have written for join statement and what value all the fields are carrying after giving the join statement.

thanks

mrutyun^