10-08-2007 5:04 AM
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
10-08-2007 5:12 AM
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
10-08-2007 5:13 AM
Hi,
You get these info from MKPF,
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh
10-08-2007 5:14 AM
try this function module
'CS_BOM_EXPL_MAT_V2'
not sure
regards
Giridhar
10-08-2007 5:16 AM
10-08-2007 5:30 AM
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