Get Material Doc based on Acc Doc

Hi All,
Please guide me how to get the Mat Doc (MSEG-MBLNR)  based on the Acc Doc (BSIK-BELNR).
I already tried --> MSEG-BELNR = BSIK-BELNR, but can't.
Kindly advise.
Best Regards,
Victor.

Hi Vic ,
just see  the logic of  this FM , if u give MBLNR it will get A/c Document, so see how tthis FM is getting thatA/c ,thereafter u can bulid the same logic.
1.first u have to get MBLNR.
2.Next u have to call FM
AC_DOCUMENT_RECORD
I_AWTYP                         MKPF--->Constant
I_AWREF                         4900003215--->MBLNR
I_AWORG                         2004--->Year
I_AWSYS
I_AWTYP_INCL
I_AWTYP_EXCL
I_BUKRS
I_VALUTYP                       0
X_DIALOG                           X
then u will get the Accounting Documents.
Regards
Prabhu

Similar Messages

  • Default Material Group based on PO Doc Type

    Dear Experts,
    Is there any standard configuration available to default Material Group in PO based on Document Type. I checked the forum, one of the earlier posts is suggesting Enhancement, but I am looking for Configuration.
    I cannot use IMG--> Materials Management --> External Services Management --> Source Determination and Default Values --> for Purchasing Organizations, since it is already used by Freight team.
    Please advise.
    Manish

    Hello Manish,
    As already mentioned by all members that this is not possible by using Standard Configuration. What you can do is if this material group is going to be used everytime by the Purchase Department users, then you can ask them to make this default in their personal settings in ME21 Tcode. Every time they will execute the transaction system will default this material Group. The same can be done for doc type also.

  • How to get Material details based on 0material in 0figl_o02 DSO

    Hi
    In Financial Accounting we have DSO for General Ledger: Line items (0FIGL_o02)  It contains Material no. for each transaction record but other material details like Qty used and price for that material and other related details are not present and also not in the Datasource 0fi_gl_4. Pls let me know the logic so that using the Material no. I can get the related details of material from any other infoprovider in BI.
    Thanks

    Hi Puneetb,
    If you want data directly from the 0material infoObject in BW you can do 2 things:
    1. Edit the updaterule to your destination cube and determine the values in an ABAP routine
    2. Change the attributes to navigational in both infoObject and cube so you can use them in queries (in this scenario you allways display the current attribute values instead of the values when loading the data.
    Is this what you were looking for?
    Kind regard,
    Alex

  • Get material plants based on a given material

    Hi All ,
    I am an ABAPer . I am now writing a report in APO . Can anyone please let me know what is means to find out what are all  the plants a given material is maintained . Do we have any FM's for this ?
    Thanks ,
    Daniel .

    Hi Daniel,
               You can find all the Product Location combination in /SAPAPO/MATLOC table in GUID format. Use the /SAPAPO/MATKEY and /SAPAPO/LOC for get the corresponding material and location else u can directly use view /SAPAPO/V_MTLMOD for fetching the product and location.
    Regards,
    Siva

  • Function Module to know the Acc doc no for a Material document.

    Dear Friends,
    What is the Function Module to know the Acc doc no for a Material document? Please help. Thanks in advance.
    Regards,
    RAMAN

    Hi Raman,
    I am not sure about your requirement,
    But i remember when i required the same like you i went to vrpma table to get the account document,
    I just did like a blind fold,
    as my company does all the billing accounts in the same month, my search criteria was blind.
    Also try with MKPF-XBLNR with the VBRK-XBLNR and get VBRK-VBELN
    from there goto BSEG.
    Thansk & regards,
    Dileep .C

  • Extractor for Acc Doc . Material Doc/Invoice Ref

    Hi All
    I am looking for an extractor which provides the following information.
    Purchase Doc --> Material Doc / Invoice --> Acc Doc number
    Is there any extractor that i can enhance or use which gives me the following information.
    Thanks
    Vanaja

    Hi,
      Try 0FI_AP_4. It will give accounting doc and purchasing doc. I am not sure abour material doc.
    Regards,
    Raghavendra.

  • Get Billing Doc using acc doc

    Hi all,
    I need Billing Doc using the accounting Doc..
    need table flow.
    actually i need Customer PO Numer to display for an Accounting Doc ..
    any sol..?
    regards,
    PP
    Edited by: P.P on Jun 4, 2009 11:24 AM

    Hi,
    Check
    CALL FUNCTION 'AC_DOCUMENT_RECORD'
    EXPORTING
    I_AWTYP = 'VBRK'
    I_AWREF = VBRK-VBELN
    I_AWSYS = VBRK-LOGSYS
    I_BUKRS = VBRK-BUKRS
    TABLES
    T_DOCUMENTS = DOC_NUM
    EXCEPTIONS
    NO_DOCUMENT = 1.
    Also, Check BSEG table for field VBELN.
    Instead of BKPF and BSEG you can use BSIK, BSAK, BSID, BSAD etc for better performance.
    Hope it helps,
    Sumana

  • How get Material Doc. From Delivery

    Hi experts,
    How can i get Material Document No. from Delivery No. when PGI Complete.
    What is the Proper way to find the material document no. from delivery no.
    with best performance.

    Use table VBFA.
    select <fields> from VBFA
    where vbelv = <delno>
    and      posnv = <del line item>
    and      vbtyp_n = 'R'.
    Regards
    Vinod

  • Restrict selection from LDB 'DDF' based on FI Doc number(BELNR)?

    Hi all,
    I am trying to restrict selection from LDB 'DDF' based on FI Doc number(BELNR).
    Even if i pass only one document number in selection-screen, the program is still printing lot of documents?
    Where I am going wrong?
    *& Report  ZSUB_READ_LDB
    REPORT  ZSUB_READ_LDB.
    DATA wa_BSEG TYPE BSEG.
    SELECT-OPTIONS s_BELNR FOR wa_BSEG-BELNR.
    DATA: callback TYPE TABLE OF ldbcb,
    callback_wa LIKE LINE OF callback.
    DATA: seltab TYPE TABLE OF rsparams,
    seltab_wa LIKE LINE OF seltab.
    callback_wa-ldbnode = 'BSEG'.
    callback_wa-get = 'X'.
    callback_wa-get_late = 'X'.
    callback_wa-cb_prog = sy-repid.
    callback_wa-cb_form = 'CALLBACK_BSEG'.
    APPEND callback_wa TO callback.
    CLEAR callback_wa.
    seltab_wa-kind = 'S'.
    seltab_wa-selname = 'BELNR'.
    LOOP AT s_BELNR.
      MOVE-CORRESPONDING s_BELNR TO seltab_wa.
      APPEND seltab_wa TO seltab.
    ENDLOOP.
    CALL FUNCTION 'LDB_PROCESS'
      EXPORTING
        ldbname                     = 'DDF'
        variant                     = ' '
      TABLES
        callback                    = callback
        selections                  = seltab
      EXCEPTIONS
        ldb_not_reentrant           = 1
        ldb_incorrect               = 2
        ldb_already_running         = 3
        ldb_error                   = 4
        ldb_selections_error        = 5
        ldb_selections_not_accepted = 6
        variant_not_existent        = 7
        variant_obsolete            = 8
        variant_error               = 9
        free_selections_error       = 10
        callback_no_event           = 11
        callback_node_duplicate     = 12
        OTHERS                      = 13.
    IF sy-subrc ne 0.
      WRITE: 'Exception with SY-SUBRC', sy-subrc.
    ENDIF.
    *&      Form  CALLBACK_BSEG
          text
         -->NAME       text
         -->WA         text
         -->EVT        text
         -->CHECK      text
    FORM CALLBACK_BSEG USING name TYPE ldbn-ldbnode
    wa TYPE BSEG
    evt TYPE c
    check TYPE c.
      CASE evt.
        WHEN 'G'.
          WRITE: / wa-BELNR.
          ULINE.
        WHEN 'L'.
          ULINE.
      ENDCASE.
    ENDFORM.                    "CALLBACK_BSEG

    Hi Andreas,
    I have included bukrs and gjahr too...but if I input only one invoice number the report is printing a lot of invoices.
    Not sure from where the data is being picked up?
    Sorry of poor formatting of code.
    Thanks ,
    Subba
    *& Report  ZSUB_READ_LDB
    REPORT  ZSUB_READ_LDB.
    TYPE-POOLS: RSDS, RSFS.
    DATA wa_BSEG TYPE BSEG.
    SELECT-OPTIONS s_BELNR FOR wa_BSEG-BELNR.
    SELECT-OPTIONS s_BUKRS FOR wa_BSEG-BELNR.
    SELECT-OPTIONS s_GJAHR FOR wa_BSEG-BELNR.
    DATA: callback TYPE TABLE OF ldbcb,
    callback_wa LIKE LINE OF callback.
    DATA: seltab TYPE TABLE OF rsparams,
    seltab_wa LIKE LINE OF seltab.
    DATA: TEXPR TYPE RSDS_TEXPR,
    FSEL TYPE RSFS_FIELDS.
    start-of-selection.
      callback_wa-ldbnode = 'BSEG'.
      callback_wa-get = 'X'.
    callback_wa-get_late = 'X'.
      callback_wa-cb_prog = sy-repid.
      callback_wa-cb_form = 'CALLBACK_BSEG'.
      APPEND callback_wa TO callback.
      CLEAR callback_wa.
      seltab_wa-kind = 'S'.
      seltab_wa-selname = 'BELNR'.
    *seltab_wa-LOW =
      LOOP AT s_BELNR.
        MOVE-CORRESPONDING s_BELNR TO seltab_wa.
        APPEND seltab_wa TO seltab.
      ENDLOOP.
      seltab_wa-kind = 'S'.
      seltab_wa-selname = 'BUKRS'.
    *seltab_wa-LOW =
      LOOP AT s_BELNR.
        MOVE-CORRESPONDING s_BUKRS TO seltab_wa.
        APPEND seltab_wa TO seltab.
      ENDLOOP.
      seltab_wa-kind = 'S'.
      seltab_wa-selname = 'GJAHR'.
    *seltab_wa-LOW =
      LOOP AT s_BELNR.
        MOVE-CORRESPONDING s_GJAHR TO seltab_wa.
        APPEND seltab_wa TO seltab.
      ENDLOOP.
      CALL FUNCTION 'LDB_PROCESS'
        EXPORTING
          ldbname                     = 'DDF'
          variant                     = ' '
          EXPRESSIONS                 = TEXPR
          FIELD_SELECTION             = FSEL
        TABLES
          callback                    = callback
          selections                  = seltab
        EXCEPTIONS
          ldb_not_reentrant           = 1
          ldb_incorrect               = 2
          ldb_already_running         = 3
          ldb_error                   = 4
          ldb_selections_error        = 5
          ldb_selections_not_accepted = 6
          variant_not_existent        = 7
          variant_obsolete            = 8
          variant_error               = 9
          free_selections_error       = 10
          callback_no_event           = 11
          callback_node_duplicate     = 12
          OTHERS                      = 13.
      IF sy-subrc ne 0.
        WRITE: 'Exception with SY-SUBRC', sy-subrc.
      ENDIF.
    *&      Form  CALLBACK_BSEG
          text
         -->NAME       text
         -->WA         text
         -->EVT        text
         -->CHECK      text
    FORM CALLBACK_BSEG USING name TYPE ldbn-ldbnode
    wa TYPE BSEG
    evt TYPE c
    check TYPE c.
      CASE evt.
        WHEN 'G'.
          WRITE: / wa-BELNR.
          ULINE.
        WHEN 'L'.
          ULINE.
      ENDCASE.
    ENDFORM.                    "CALLBACK_BSEG

  • Material doc, accounting doc, and profit center doc in vl03n

    Hi All,
    In VL03N how can i see Material doc, Accounting doc, and Profit Center doc.
    thanks in advance,
    kumar.

    yes he meant the exact same thing which you have understood my friend, you can have any sales document number with you f& rom that you can trace all the documents relavant to that, say you have inquiry which lead to quotation then to order, delivery, invoice & finally the accounting document so by simply entering VA13 you will get the inquiry display screen where you enter your inquiry number & click on the document flow, you will get all the details which i just mentioned, double click on the particular document number which you want to see in details
    Reward Points if it helps
    Regards,
    N

  • MIGO- how to get mat. doc. by A/c doc.

    Hi Sap gurus,
    How to get the material document by the accounting document generated while MIGO.....
    MIRO........ how to get the gr doc. by the invoice doc.. no...
    Plz. suggest any tcodes or reports.......
    Thanks
    Navin

    Hi,
    The parameter ID IVFIDISPLAY need to be added in the User Master Parameters tab using SU01 for other user or for self user use SU3.
    after maintaining the parameter, maintain the Parameter value as X
    MIRO :
    GO to the PO given in the item details of the miro..click on it..system will take you to the PO for that invoice..inside it in PO history tab in item details you can see all the documents generated for that PO...here you can get invoice no, gr no, etc...
    Hope it'll help you..
    Regards
    Priyanka.P
    AWARD IF HELPFULL
    Edited by: Priyanka Paltanwale on Aug 22, 2008 12:49 PM

  • Exchange rate in header of acc.doc after posting return to vendor

    Hi Gurus,
    in accounting document, when i recalculated amount in doc.currency & amount in local currency in item line was not same with exchange rate in header section...Anyone can explain to me why this miscalculation can happen ?
    Thanks

    Hi Zafar,
    exchange rate in header of this acc.doc was take automatically from table OB08 & the problem is in item line this acc.doc which is generated automatically after posting return to vendor the calculation amount in local currency was not take the exchange rate from header but from exchange rate when GR ( FLow : mvt 101--> mvt 122 ). so this is normal behaviour or there are bug ?
    thanks in advance

  • Based on single Doc number Multiple line items update to in single Z database table

    Dear Frds,
    Based on single Doc number Multiple line items update to database table
    Example : Doc Num: Janu
    If users are using different doc number again the line items are modifying and replacing to new document Number . Pls Help me Screen attached as
    Like CS01 Transaction

    Dear Frds,
    Based on single Doc number Multiple line items update to database table
    Example : Doc Num: Janu
    If users are using different doc number again the line items are modifying and replacing to new document Number . Pls Help me Screen attached as
    Like CS01 Transaction

  • How to get - Net amount for accounting doc in the SD doc flow?

    Hi,
    In my report I have to show the net amounts from the Sales doc, invoice and accounting doc, etc.
    I got the FI doc amount from BSEG, however there the gross amount is stored.
    I noticed that in the SD document flow for the accounting document the net amount is shown.
    I tried with the following calculation, however in some cases this doesn't work (eg there is separate tax item in the FI doc):
    "<lwa_bseg>-wrbtr - <lwa_bseg>-wmwst"
    Is there a function module/sap standard code to provide this data?
    Thanks in advance,
    Peter

    when u see the Item Header in SO or Billing , at the Head of Condition table u will get NET amount ?
    are u not maintaining any seperate conditions for this NET amount ?
    have a word with ur functional guys , so he can help u out.
    Regards
    Peram

  • Before the latest upgrade, I could get a spreadsheet and a gmail doc showing side by side on the screen.  Now I can't. G

    Before the latest upgrade, I could get a spreadsheet and a gmail doc side by side on the screen.  Now I can't.  Help please.  Geoff of Gata

    -> Update Firefox to the latest version 10
    * [[Installing Firefox on Windows]]
    Perform the suggestions mentioned in the following articles:
    * [[Troubleshooting extensions and themes]]
    Check and tell if its working.
    May not be related to your problem but some of your Firefox Plugins are out-dated
    * Update All your Firefox Plugins -> [https://www.mozilla.org/en-US/plugincheck/]
    * '''When Downloading Plugins Update setup files, Remove Checkmark from Downloading other Optional Softwares with your Plugins (e.g. Toolbars, McAfee, Google Chrome, etc.)'''

Maybe you are looking for