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

Fetch FI document no

Former Member
0 Likes
997

Given GRN no for 105 movement in mseg ,how can i know FI document ?

11 REPLIES 11
Read only

Former Member
0 Likes
972

Hi,

aditya use BKPF-BELNR

and try to access it using BSEG_BELNR.

Hope magic Works!

Regards,

Purvesh Patel.

Read only

0 Likes
972

How can i do i am having GRN say 5000377301,i cant pass it to bkpf or bseg.I want FI doc no itself

that you are asking me to pass.

Read only

JozsefSzikszai
Active Contributor
0 Likes
972

mseg-belnr = bseg-belnr

mseg-buzei = bseg-buzei

Read only

0 Likes
972

Sorry eric doesnot work here.It is conceptually also not ok.

Read only

0 Likes
972

1. Query the goods receipt in tcode MB03.

2. Switch on ST05 performance trace in another session.

3. Click on the MB03 option to display accounting document.

The trace will show you how to find the accounting document.

Read only

0 Likes
972

>

It is conceptually also not ok.

what do you mean?

then identify a document-pair (one from MSEG, one from BSEG) and search for common fields (for example check BKPF-AWKEY, usually that is some kind of concatenation of relevant document numbers + company code + plant). Unfortunately there is no MM where I am, so I cannot check on my own

Read only

0 Likes
972

I was coming to that the field AWKEY ie YYYYGRNNO.

Here i find if i try querying the table BKPF by giving AWKEY ,BUKRS ,GJAHR,retrieval is damn slow.

Infact it is better to retrieve all FI docs of complete year and then filter internal table matching that AWKEY within ABAP scope.

Here can anybody give a better tip to optimize fast retrievaL

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
972

Hello Aditya,

May be you can use AWTYP = 'MKPF'. Hope this will reduce data fetch time )

I donot think selecting all the docs for the CoCd & Fiscal Yr and filtering will be a good idea.

Plz correct me if i am wrong.

BR,

Suhas

Read only

0 Likes
972

just check what is the value for BKPF-AWTYP (will be the same all the time for all documents come from MSEG) and hardcode that in the selection (there is a secondary index for AWTYP, AWKEY, ... for BKPF)

SELECT ...

INTO...

FROM bkpf

WHERE awtyp EQ '...'

AND AWKEY EQ ....

Read only

0 Likes
972

Thanx to both....

Read only

Former Member
0 Likes
972

rg