Function Module to get Material Document Number

Hi All,
I want to get the Material Document Number based on the Material, batch ,movement type and plant. Is there any function module to achieve this, without going to MSEG table.

check this might help you..
Get Material Document Number and Material Document Year
Regards
Kumar

Similar Messages

  • Function module to get material serial number status

    Hi Gurus,
    How to get get material serial number status? Is there any function module?
    TCode IQ03 to display the serial number staus, but where i can find the status (AVLB / ESTO / ECUS) of these serial number ?
    Pls help.
    Regards,
    Sankaran

    hi,
    SELECT SINGLE  equnr objnr FROM
                               equi INTO (equnr1 , objnr1)
                               WHERE sernr = wa_final-sernr
                                 AND matnr = wa_final-matnr.
        CALL FUNCTION 'STATUS_TEXT_EDIT'
          EXPORTING
            client           = sy-mandt
            flg_user_stat    = 'X'
            objnr            = objnr1
            spras            = sy-langu
            bypass_buffer    = 'X'
          IMPORTING
            line             = sttxt
          EXCEPTIONS
            object_not_found = 1
            OTHERS           = 2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Regards
    siva

  • Functional module for Getting Material classification data.

    Please tell me Functional module for Getting Material classification data like class type , class, characteristics and characteristics values for material.

    Dear,
    FM:
    CLAF_CLASSIFICATION_OF_OBJECTS
    Table KLAH Class Header Data
    - KSML Characteristics of a Class
    Regards,
    R.Brahmankar

  • Any functional module to get financial document based on billing document

    hi all,
    do we have any functional module to get accounting document (bseg-BELNR) based on billing document (bseg-VBELN)?
    i have a requirement to retrieve the clearing document (bseg-augcp) & date(bseg-augdt) from BSEG with billing document.
    billing document is not a key, so i would like to retrieve the accounting document from any function module and use that to get clearing document (bseg-augcp) & date(bseg-augdt).
    thanks.

    hi all,
    i got other option to get this....thanks.
          select single * from bkpf
          where bukrs = <data>-werks
            and AWTYP = 'VBRK'
            and AWKEY = billing doc.
          if sy-subrc EQ 0.
            select single * from bseg
            where bukrs = bkpf-bukrs
              and belnr = bkpf-belnr
              and gjahr = bkpf-gjahr.
            if sy-subrc EQ 0.
              <data>-AUGDT = bseg-augdt.
              <data>-AUGBL = bseg-augbl.
            endif.

  • 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

    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

  • Function Module/BAPI For Material Document

    Dear All,
    I am looking for a function Module/BAPI to get details relevant for a Material Document.
    I can get those details using table MSEG & MKPF, but still looking for a Function Module.
    Kindly help.

    Hi
    Try with these BAPI's
    BAPI_GOODSMVT_GETITEMS
    BAPI_GOODSMVT_GETDETAIL
    Regards
    Brahmaji

  • Bapi or function module to change Material document

    can any one plese tell me the function module or BAPI to chenge the material document.i need to chenge some fields in the material document like XBLNR(Reference document number) after it is created.
    Thanks ,

    Hi,
    try this out.
    SRS_PDC_GR_MATDOC_GET
    <REMOVED BY MODERATOR>
    Thanks,
    Madhura
    Edited by: Alvaro Tejada Galindo on Feb 6, 2008 2:15 PM

  • Function Module to get sales order number

    Hi,
    In a custom program I am giving Material number and Plant as input in VBAP to find the Sales Order number. However this step is taking long time to execute and so getting dump with time out error.
    Please let me know whether there is any Function Module in which we can input Material and plant and get the Sales Order Number.
    Regards

    Hi,
    Rather than searching for a FM, you can get a small report developed to look up for VBAP for a given material, plant.
    Ensure that this report is always run in background. Also consider giving other parameters for faster processing like date range etc..
    Regards,
    RS.

  • Function module to get material characteristics and coresponding value

    Hi experts,
          I have got one problem...when we go to t code MM03..we select the views for a specific material for Basic Data1,Basic Data2 and Classification..in classification we get the material description and its corresponding values...
    These values we receive through specific class and its corresponding object....I want some Function Module which will allow me to receive the description and corresponding value for the material which will automatically retrieve the data for that material using the class and object...
    Please help me to sort this problem...
    Thanks in advance

    TRY these two FMs
    1) CLAF_CLASSIFICATION_OF_OBJECTS and
    2) Bapi_objcl_getdetails.
    for first one it gets the all characteristics assigned to the class even though the values are not assigned
    in second case onle the vlaues assigned characteristics will get

  • Function module to get spool request number

    Hi Experts,
    Is there a FM which basically returns the Spool Request Number generated by a particular Program / User ?
    System: 4.6C
    Thanks a lot.

    one more is there
    'RSPO_OPEN_SPOOLREQUEST'
    it will give the appropriate solution to your query.
    another one ,
    SUBMIT (p_repid) TO SAP-SPOOL
                       SPOOL PARAMETERS mstr_print_parms
                       WITHOUT SPOOL DYNPRO
                       AND RETURN.
    but it will create infinite loop , so use abap memory and export  a flag variable with
    a value to restricted the excution  of the above submit only once  and all the internal
    table and other data which you want in your program . below is the example .
    importing variable value set at first time to restrict the infinite loop .
    IMPORT var FROM MEMORY ID 'abc' .
      var = var + 1 .
    *checking variable to restricted scecond time exction of this block of code
    *IF var = 1 .
       v_memid = 1 .
       EXPORT var TO MEMORY ID 'abc' .  (flag variable to restrict the excution only once ) 
       EXPORT it_pernr it_pernr_quali v_memid TO MEMORY ID 'bcd'.(internal table and otherdata)  
    submitting the spool request
        SUBMIT (p_repid) TO SAP-SPOOL
                         SPOOL PARAMETERS mstr_print_parms
                         WITHOUT SPOOL DYNPRO
                         AND RETURN.
      ENDIF.

  • BAPI or Function Module to get MSEG table data based on PO Number (EBELN)

    Hi
    1. Is there any BAPI /  Function Module to get PO details based on Plant and PO date?
    2. Is there any BAPI / Function Module to get Material document details(MSEG data) based on PO number?
    Thanks
    Narendra

    Hi,
    check the Bapis Givem below
    BAPI_PO_GETITEMS
    http://abap.wikiprog.com/wiki/BAPI_PO_GETDETAIL1
    you will get the detail.
    Regards

  • Function Module to get PO details based on Plant and PO date

    Hi
    1. Is there any Function Module to get PO details based on Plant and PO date?
    2. Is there any Function Module to get Material document details based on PO number?
    Thanks
    Narendra

    hi,
    check these standard reports.
    ME2L - By vendor
    ME2M - By material
    MSRV3 - By service
    ME2K - By account assignment
    ME2C - By material group
    ME2B - By tracking number
    ME2N - By PO number
    ME2W - By supplying plant
    also chck this func module.
    REPL_LIST_PURCHASE_ORDER_READ
    reward if hlpful.

  • Function module to get vendor-CNPJ by vendor number

    Hello SAP Experts,
    Is there any function module to get vendor CNPJ number (For Brazil) by vendor number? If not, is there any alternative to get the CNPJ by vendor number?
    Thank you,
    Magesh.

    Can you check below FM
    J_1B_NFE_IN                    NF-e incoming
    J_1BNFE_GET_CUSTOMER_FROM_CNPJ Derive vendor from CNPJ
    J_1BNFE_GET_ORGDATA_FROM_CNPJ  Derive company / plant from CNPJ
    J_1BNFE_GET_VENDOR_FROM_CNPJ   Derive vendor from CNPJ

  • Function module to get the sequence numbers based on PERNR & payroll period

    Hi,
        Right now i am using the function module 'CU_READ_RGDIR' to get the sequence number based on the PERNR. Once i get the data i am filtering based on payroll periods (begin date and end date). Is there any function module to get the sequence number directly based on PERNR and payroll period dates? if so could you let me know.
    Thanks
    Satya

    I think thats the only way
    CALL FUNCTION 'CU_READ_RGDIR'
        EXPORTING
          persnr          = p0001-pernr
        TABLES
          in_rgdir        = it_rgdir
        EXCEPTIONS
          no_record_found = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    check whether "Pay date for payroll result" with in Start Date and
                  End date, and "Reason for Off-Cycle Payroll" is initial
      LOOP AT it_rgdir WHERE paydt >= v_begda
                             AND paydt <= v_endda AND
                             void IS INITIAL
                             AND ocrsn IS INITIAL
                             AND srtza = 'A'.
        v_seqnr = it_rgdir-seqnr.
    ENDLOOP.
    Hope this helps.
    Thanks
    Kiran

  • Function module to get PRT for the operation in Maintenance Order

    Hi,
    Please tell me the function module to get PRT document for the all operation in Maintenance Order? and also tell me the FM to get all details of those PRT Docs so that I can Print those documents.
    Thanks.

    Hi,
    Please tell me the function module to get PRT document for the all operation in Maintenance Order in TCode IW31/32/33? and also tell me the Function Module to get all details of those PRT Documents so that I can take Print out of those documents.
    Thanks,
    Jay.

Maybe you are looking for