Get CMdetails based on Reference Number

Hi,
I am developing Credit Memo Details report, here user wants all the details including Acct Docu Number based on Reference number.
The report is working fine if the Credit memo has account docu number, but now user wants this report to work if Cmemo does not have ACCtDocuNum also.
Please help me to modify this report so that it displays all details with out AcctDocuNumber also based on Reference number.
Thanks,
Neelu.
FORM get_data.
  SELECT a~vbeln a~posnr a~vgbel a~netwr a~fkimg a~matnr
         b~vkorg b~vtweg b~spart b~kunag b~xblnr b~bstnk_vf
         FROM vbrp AS a
         INNER JOIN vbrk AS b
          ON a~vbeln = b~vbeln
          INTO TABLE ivbrkp
          WHERE b~xblnr IN s_xblnr
          AND b~fkart = 'ZMKD'.
  IF sy-subrc = 0.
    SELECT kunnr matnr sprice eprice eohqty bstkd crmemo
          FROM zppprice INTO TABLE izppprice
          FOR ALL ENTRIES IN ivbrkp
          WHERE kunnr = ivbrkp-kunag
                AND matnr = ivbrkp-matnr
                AND crmemo = ivbrkp-vgbel.
  ENDIF.
ENDFORM.                    " get_data
*&      Form  process_data
*       text
*  -->  p1        text
*  <--  p2        text
FORM process_data.
  DATA: lv_name1 LIKE kna1-name1,
        lv_auart LIKE vbak-auart,
        lv_augru LIKE vbak-augru,
        lv_werks LIKE vbap-werks,
        lv_fkdat LIKE vbkd-fkdat,
        lv_knumv LIKE vbak-knumv,
        lv_kbetr LIKE konv-kbetr.
  LOOP AT ivbrkp.
    g_bqty  =  ivbrkp-fkimg.
    MOVE ivbrkp-vbeln      TO iout-vbeln.
    MOVE ivbrkp-posnr      TO iout-posnr.
    MOVE ivbrkp-vgbel      TO iout-vgbel.
    MOVE ivbrkp-netwr      TO iout-netwr.
    MOVE g_bqty            TO iout-g_bqty.
    MOVE ivbrkp-vkorg      TO iout-vkorg.
    MOVE ivbrkp-vtweg      TO iout-vtweg.
    MOVE ivbrkp-spart      TO iout-spart.
    MOVE ivbrkp-kunag      TO iout-kunnr.
    MOVE ivbrkp-matnr      TO iout-matnr.
    MOVE ivbrkp-xblnr      TO iout-xblnr.
    MOVE ivbrkp-bstnk_vf   TO iout-bstnk_vf.
    READ TABLE izppprice WITH KEY kunnr = ivbrkp-kunag
                                  matnr = ivbrkp-matnr
                                  crmemo = ivbrkp-vgbel.
    g_qdiff =  izppprice-eohqty - g_bqty.
    IF sy-subrc = 0.
      MOVE izppprice-sprice  TO iout-sprice.
      MOVE izppprice-eprice  TO iout-eprice.
      MOVE izppprice-eohqty  TO iout-eohqty.
      MOVE g_qdiff           TO iout-g_qdiff.
    ENDIF.
    SELECT SINGLE name1
            FROM kna1 INTO lv_name1 WHERE kunnr = ivbrkp-kunag.
    IF sy-subrc = 0.
      MOVE lv_name1 TO iout-name1.
    ENDIF.
    SELECT SINGLE auart augru FROM vbak INTO (lv_auart, lv_augru)
                              WHERE vbeln = ivbrkp-vgbel.
    IF sy-subrc = 0.
      MOVE lv_auart TO iout-auart.
      MOVE lv_augru TO iout-augru.
    ENDIF.
    SELECT SINGLE werks FROM vbap INTO lv_werks
                        WHERE vbeln = ivbrkp-vgbel
                          AND posnr = ivbrkp-posnr.
    IF sy-subrc = 0.
      MOVE lv_werks TO iout-werks.
    ENDIF.
    SELECT SINGLE fkdat FROM vbkd INTO lv_fkdat
                        WHERE vbeln = ivbrkp-vgbel.
    IF sy-subrc = 0.
      MOVE lv_fkdat TO iout-fkdat.
    ENDIF.
    SELECT SINGLE knumv
           FROM vbak INTO lv_knumv
            WHERE vbeln = ivbrkp-vgbel.
    SELECT SINGLE kbetr
           FROM konv INTO lv_kbetr
            WHERE knumv = lv_knumv
            AND kschl = 'ZCPP'.
    IF sy-subrc = 0.
      MOVE lv_kbetr TO iout-g_pdiff.
    ENDIF.
    APPEND iout.
    CLEAR iout.
    CLEAR ivbrkp.
    CLEAR lv_name1.
    CLEAR lv_auart.
    CLEAR lv_augru.
    CLEAR lv_werks.
    CLEAR lv_fkdat.
    CLEAR lv_knumv.
    CLEAR lv_kbetr.
  ENDLOOP.
ENDFORM.                    " process_data

Hi,
There is std Tcode MB25 in sap or u can use RESB table to see reservation against production order.
Arun

Similar Messages

  • Reference Number not coming in MIGO

    Dear Sirs,
    out of 100 quantity in PO I did MIGO of 10-9-10 quantity in three of MIGO transaction, but at the time of Cancellation of one of the MIGO I am not getting the reference of original GR Number in the cancelled document, Please advice if any customization is required for getting the reference number.
    Valuable suggestions will be rewared with suitable points.
    Regards,
    SagarRK
    Edited by: SagarRK on Apr 15, 2010 9:15 AM

    Goods Receipt done with reference to PO when you post material document in MIGO (GR,GI etc) a tab named "Purchase Order History" created automatically in Item detail level of Purchase order ME23N. so you can get the Original GR Reference number from PO History tab when you display that reference PO
    Edited by: Muhammad Ali on Apr 15, 2010 10:14 AM

  • No pre-order reference number

    How can I get my pre-order reference number if I didnt recieve the email with it.

        Gprix81, we're excited to hear that you're upgrading to a new device! You can check the status of your order right here: http://vz.to/RWWFB
    LasinaH_VZW
    VZW Support
    Follow us on Twitter @VZWSupport

  • BAPI function module to get condition type and its values based on delivery number?

    Hi All,
    I would like to have the BAPI function module to get condition type value based on delivery number before invoice is created.please provide detail program for as a reference .please reply as soon as possible its urgent.
    Regards,
    saaikumar.

    If you haven't already, you may first need to search via the SAP transaction "BAPI" in the area this is applicable to.  Failing that I do hope you get an answer.

  • Excise invoice number getting reflected in the reference field in VF01

    Hello,
    I require excise invoice number to get get reflected in the reference field of billing document number . (i.e accounting document generated from VF01)
    Thanks,

    Dear Muscan,,
    As per STANDARD SAP PROCESS this functionality is not Possible. The reason is very clear, Excise Invoice is always created after creating billing/invoice document. Without creating excise invoice you cannot have excise invoice number reflected in the reference field of billing document.
    Hope this clarifies your doubt?
    Regards
    MBS

  • F110 - reference number not getting updated.

    Hi,
    The reference number in the line items after running F110 is not getting updated. Is there any configuration I need to do .
    Please help.
    Thanks
    Sabu

    Hi,
    Thanks .
    After applying that note it has now updated the clearing document with reference number from its original document. But I want the reference document to flow/updated into the F110 screen -> DME attributes->refrence number. The table it has to get updated is REGUT-RENUM.
    I am not sure if this has to happen as a SAP standard functionality but this is the requirement given to me.
    Thanks in advance.
    SMS

  • How to get ATINN value based on material number and Class Type ?

    I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
    However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
    So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
    -Obtain the batch characterstic value for the Material******************
      SELECT atwrt
        UP TO 1 ROWS
        INTO v_charvalue
        FROM ausp
       WHERE objek = mcha-matnr
         AND atinn = '0000000381'   " 'US80_FRENCH_ON_LABEL'
         AND klart = '001'.
    THANKS N ADVANCE.

    Hi SAm,
    use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
          EXPORTING
            classtype          = '023'       "Class type
            object             = w_object  "Material number with Leading zeros
            no_value_descript  = 'X'      "Default X
            objecttable        = 'MCH1'    "Table name Mara or MCH1 or MARC
          TABLES
            t_class            = t_class   "It return the Batch class available for the above combination
            t_objectdata       = t_char  "Return Batch characteristics(ATWRT) and their value ATINN in this table
          EXCEPTIONS
            no_classification  = 1
            no_classtypes      = 2
            invalid_class_type = 3
            OTHERS             = 4.
    Regards,
    Prabhudas

  • DRQ:Credit Note not based on invoice should transfer reference number to JE

    according to SAP business one system behavior, only those credit notes that based on invoices are able to transfer customer/vendor reference no. field value to reference 2 field in journal entry. I would like to propose to enable AP credit note that is not based on invoice to transfer reference number field to JE as well.

    Even if it is possible, you would be better split the amount to individual credit note.  I have no idea why you need to split line in one credit note.
    Thanks,
    Gordon

  • How can I get a Visa Reference Number on a Spectrum Analyzer?

    I have a GPIB Address of 18 on a 8593 EM Spectrum Analyzer. How can I get a VISA reference Number for my VI program

    You must have a pretty old version of LabVIEW if you need a session ID instead of just a VISA Resource. If that's the case, you need to first use an VISA Open function in which you specify a resource name of GPIB::18. The open function will return a unique ID that you wire to either VISA Write/Read or a subVI in a driver.

  • BAPI to get Invoice Details based on PO Number

    HI,
    Is there any BAPI to get Invoice Details based on PO number. If so could you pls let me know that.
    Regards,
    Ramesh

    Hi Ramesh  ,
    there is no Direct BAPI to get the List of Invoices ,But based on the Vendor list u can get the List .
    pass Vendor list , Document Dates.
    <b>BAPI_INCOMINGINVOICE_GETLIST</b> for more info check the Documentation of this FM.
    Regards
    Prabhu

  • 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

  • Based on personel number, how do I get country code for that person?

    Based on personel number, how do I get country code for that person? Is there any function module to allow me to do that? Thanks!

    Hi,
    Check function module HR_PERNR_COUNTRY_GET.
    Donnie

  • Populate header text with reference number and vendor name

    Hi Experts,
    My client wants to populate the line item text field - SGTXT in MIRO / FB60 with the reference number field XBLNR and the vendor name.
    Is it possible to do it before the invoice get posted?. Like, just after the user entered the vendor account number and the reference number in FB60 system picks the vendor name against the vendor number from LFA1 table and the reference number entered in FB60 screen and populates them in text field ?
    Similarly in MIRO - before the invoice get posted is it possible to pick the reference number from MIRO screen and pick the vendor name based on the PO number entered on the MIRO screen.
    Please advise how to do this.
    Thank you
    Shino

    Hi
    This can be achieved by using a User Exit in Substitution rule. This is done through GGB1. Define the rule
    Prerequisite
    (System T Code =FB01 or MIRO) and Account Type = K
    Substitution
    User Exit
    The following link will be of help to you to define a user exit in substitutition rule
    http://help.sap.com/saphelp_46c/helpdata/en/5b/d231a843c611d182b30000e829fbfe/content.htm
    Regards
    Sanil Bhandari

  • GL account number based on plant number

    Dear All,
    Please let me know how can we find the GL Account assigned for a plant.
    I fetch some data(say A) based on WERKS(plant 101) in ITAB1 and some data(say B) based on GL account number( 0001130101   Estoque Loja Matriz).
    A = 100
    B = 200
    Now , i need to add A and B comparing WERKS and GL account number.
    Is there any way i can relate these two fields ??
    I can explain it clearly if i am not clear .
    Thanks in Advance
    SSK

    Hello,
    To make all things clear. The issue regards regular sale process in ERP, I mean we have sale order, delivery and invoice. There are two financial documents related to it. One of them is a reference to sale invoice and the other one to goods issue material document. In case first of those documents the case is easy, proper financial accounts for posting can be done by settings account numbers in transaction VKOA (Assign G/L account) where among the others I can set account based on customer number. The same thing I need to for my financial document related to MM document. I know I can achieve it by setting additional movement type and assigning to it account number using OBYC general modifications and so on. The point is that I donu2019t like this idea. As a result Iu2019ll get a bunch of movement types created only for FI purposes but I have no slightest idea how to do it any other way.
    Iu2019ll be grateful help and advice.
    Regards
    Pawel Kobylinski

  • Error in generating reference number of process

    Hi All Masters,
    I'm new in HCM P&F.
    Currently I have a problem. I was running a sample process or copied process from the sample. Clicking 'check and send'. Still OK.
    But when I clicked 'Send' button, I got an error message displayed 'Error in generating reference number of process'
    Would you please help me what's wrong with that? FYI, I've tried to activate Case Management, but maybe, there is still any loss in that area?
    Thank you for your help
    Regards,
    Pradita Herdiansyah

    Hi Otto,
    Neither did I. I don't have any complete resources. Maybe actually there are exists somewhere, but just I don't find it yet.
    I try to learn and doing that by watching this forum and sap help/doc, just maybe there are other people who have same obstacles with me in developing this and then I will get solutions for it.
    Have a nice day...
    Regards,
    Pradita Herdiansyah

Maybe you are looking for

  • URL Hyperlink that wraps from line to line won't work in PDF

    What's going on with the hyperlink feature that I can't make my links work in the PDF (or in InDesign). I searched for this topic on here and found a couple things that I tried, but with no success. I am using a PC, InDesign CS2 and Acrobat 8. A coup

  • Display seems like 16 bit color with slight flicker

    When I turned my iMac on today, it's like the display color spectrum is on 16 bit color and it has a flicker to it. This happed all of the sudden. It's less than a year old. 21" iMac Intel Core 2 Duo NVIDIA GeForce 9400 VRAM 256MB Any ideas?

  • Can't open website in 3.0.4

    My computer crashed but I've got all my files. But the website won't show up in iWeb. I need to update a couple of things and I am finding very negative information online. How can iWeb not let you open a multi-page site that is in the same place/fol

  • Best Hardware Server Specs for Wsus to run close to 3000 Clients

    Hello Team, I am currently configuring a Wsus server 2012 for my company. I am looking forward to buy a Dell rack server and would like to take your input on what is the best server specs I could go for. I am intending to use a San-box to store Wsus

  • Is it possible to re-download OSX Lion for free from previous purchase

    My husband downloaded OSX Lion but did not save it onto disk, we have 3 mac books at home. Can he re-download without paying again. Thanks