Skip to Content
avatar image
Former Member

Get Material Document Number and Material Document Year

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 08, 2007 at 04: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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 08, 2007 at 04:13 AM

    Hi,

    You get these info from MKPF,

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

    Regards,

    Prabhu Rajesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2007 at 04:14 AM

    try this function module

    'CS_BOM_EXPL_MAT_V2'

    not sure

    regards

    Giridhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 08, 2007 at 04:16 AM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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