‎2008 Jun 24 11:09 AM
Hi Gurus,
Please tell me the relation (table link) between Billing documnets(VBRK,VBRP) to Article Documents(MKPF,MSEG)
‎2008 Jun 24 11:47 AM
Hi Sekhar,
you can query on BKPF-AWKEY based on values of VBRK-VBELN . But since the data type is different, try to assign the values first .
For example :
LOOP AT IT_VBRK.
IT_VBRK-AWKEY = IT_VBRK-VBELN.
MODIFY IT_VBRK.
ENDLOOP.
SELECT BELNR GJAHR AWKEY
FROM BKPF
INTO TABLE IT_BKPF
FOR ALL ENTRIES IN IT_VBRK
WHERE AWKEY = IT_VBRK-AWKEY .
You can use IT_VBRK to get detailed data from VBRP and IT_BKPF to get detailed data from BSEG .
Rgds,
Tuwuh SW
‎2008 Jun 24 11:56 AM
‎2008 Jun 24 11:59 AM
Hi Sekhar,
wow, you reply so fast .
Sorry i was editing it when i realized that .
Here below :
Hi Sekhar,
The relations are coming from Sales order ( this is case for special stock ) .
By query, in case you have the internal table of VBRP as IT_VBRP the query will be like following :
select vbelv posnr from vbfa
into table it_vbfa
for all entries in it_vbrp where
vbeln = it_vbrp-vbeln and
posnn = it_vbrp-posnr and
vbtyp_v = 'C'.
select mblnr mjahr mat_kdauf mat_kdpos
from mseg
into table it_mseg
for all entries in it_vbfa
where mat_kdauf = it_vbfa-vbelv
and mat_kdpos = it_vbfa-posnv .
select mblnr mjahr from mkpf
into table it_mkpf
for all entries in it_mseg
where mblnr = it_mseg-mblnr and
mjahr = it_mseg-mjahr .
Rgds,
Tuwuh SW