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

Billing - Article Documents -- LInk

Former Member
0 Likes
634

Hi Gurus,

Please tell me the relation (table link) between Billing documnets(VBRK,VBRP) to Article Documents(MKPF,MSEG)

3 REPLIES 3
Read only

Former Member
0 Likes
609

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

Read only

0 Likes
609

Hi,

I am asking about MKPF and MSEG tables not BKPF /BSEG

Read only

0 Likes
609

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