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: 

Get Material Document Number and Material Document Year

Former Member
0 Kudos

Hi everyone,

Right now, i'm developed idoc program. I need material document number (MBLNR) and material document year (MJAHR). I have information only BAPI2017_GM_HEAD_01 and BAPI2017_GM_ITEM_CREATE. Is there any FM to get this value ? Thank you

Regards,

Satria

5 REPLIES 5

Former Member
0 Kudos

Hi,

Tables

MKPF-Material document header data.

MSEG-Material document item data.

from mseg you can select MBLNR and MJAHR for a particular purch doc through EBELN and EBELP.

for FM's you can search using READ_MKPF * or READ_MSEG *.

Regards,

Raghavendra

Former Member
0 Kudos

Hi,

You get these info from MKPF,

If the hint is useful… Say thanks by reward….

Regards,

Prabhu Rajesh

Former Member
0 Kudos

try this function module

'CS_BOM_EXPL_MAT_V2'

not sure

regards

Giridhar

Former Member
0 Kudos

Please give me reward point If it is useful

Thanks

Murali Poli

0 Kudos

Ok, i will explain with more detail about my problem

Here my pseudocode :

- Get data with type BAPI2017_GM_HEAD_01 from Idoc (let we say this X)

- Get data with type BAPI2017_GM_CODE from Idoc (let we say this Y)

- Get data with type BAPI2017_GM_ITEM_CREATE from IDoc (let we say this Z)

- IF Y-GM_CODE <> "06" THEN

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = X

GOODSMVT_CODE = Y

TABLES

GOODSMVT_ITEM = Z

ELSE IF Y-GM_CODE = "06" THEN

CALL FUNCTION 'BAPI_GOODSMVT_CANCEL'

EXPORTING

MATERIALDOCUMENT = ???

MATDOCUMENTYEAR = ???

GOODSMVT_PSTNG_DATE = ???

I know that material doc and mat doc year is in table MKPF. But the problem is they are the primary key, so how i use X,Y,Z in select operation to MKPF? or is there another way using FM ? Thank you

Regards,

Satria