Application Development 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: 

BAPI for read FI documents in material document

Former Member
0 Kudos

Hi all,

with transaction ME23N i can display Material Document and in the tab 'Doc. info' i can display FI Documents if i click on the button. I'm looking for a BAPI to read this FI documents from the material document.

Thanks for your help.

Cheers

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You may use:

CALL FUNCTION 'AC_DOCUMENT_RECORD'

EXPORTING

i_awtyp = mawtyp

i_awref = mawref "Material Document

i_aworg = maworg "Accounting Year-MKPF

x_dialog = ' '

TABLES

t_documents = t_documents

EXCEPTIONS

OTHERS = 01.

where

mawtyp_rmrp(5) VALUE 'RMRP ',

This will return all FI documents pertaining to a given material document. In case you are interested in specific ntype of records, then this can be achieved by using:

Loop at t_documents.

Endloop.

I hope this helps,

Regqrds,

Raju chitale

4 REPLIES 4

Former Member
0 Kudos

Please...

Former Member
0 Kudos

Hi,

Here are some methods to find FI document from Material Document:

Regards,

Nitin.

Former Member
0 Kudos

If you mean that you need to know what BAPI's a particular transaction uses, which I can only assume that's what you mean, then you should access the code behind the transaction and search for 'CALL'. That normally is the standard method that think that most people use.

Suppose you want to find the bapi for creating a sales order, you usually use transaction VA01 for this.

1. Find out the package of the transaction.

Start Va01 go to system --> status.

Double click on transaction

Package is VA

Open this package in SE80

Open business engineering-->Business object types

Find the BO which sounds the most appropriate

I would suggest BUS2032 Sales Order

Double click.

Open methods.

Find the released method with from data or something similar in the name

, Createfromdat2

Position the cursor in it and click the program button

Scroll down to find the bapi used in this method

With this way you can also find out programs and FM's

2. Start va01 go to system-->status

Double click transaction VA01

Double click on package

Read the application component. (this is SD-SLS Sales)

Then open the transaction BAPI

Sales and distribution>Sales>sales order

createfromdat2

Former Member
0 Kudos

Hi,

You may use:

CALL FUNCTION 'AC_DOCUMENT_RECORD'

EXPORTING

i_awtyp = mawtyp

i_awref = mawref "Material Document

i_aworg = maworg "Accounting Year-MKPF

x_dialog = ' '

TABLES

t_documents = t_documents

EXCEPTIONS

OTHERS = 01.

where

mawtyp_rmrp(5) VALUE 'RMRP ',

This will return all FI documents pertaining to a given material document. In case you are interested in specific ntype of records, then this can be achieved by using:

Loop at t_documents.

Endloop.

I hope this helps,

Regqrds,

Raju chitale