FM/BAPI for creating the credit memo request for Vendor

Hi Experts,
    I need an RFC/BAPI,  for creating the credit memo request for Vendor.
Thanks in Advance,
Kiruba.R

Hi,
Use this BAPI 'BAPI_DRMCREDITMEMOREQ_CREATE' - Credit Memo Request Creation
Regards,
Jyothi CH.

Similar Messages

  • BAPI to create a credit memo request

    Is there a standard BAPI that can create a credit memo request?
    If not, then can we copy a standard BAPI to a Z-version and amend that?
    Sample code appreciated.
    Thanks,
    John

    The suggestion to use SD_SALESDOCUMENT_CREATE proved fruitful.
    For creating with reference to an invoice:
    Setting ref_doc and ref_doc_ca for each line-item in sales_item_in seems necessary for the creation of the document flow.  Maybe it also brought through other data from the invoice?
    Setting ref_doc and refdoc_cat for sales_header_in caused header text (and maybe other stuff?) to be brought through from the invoice.
    It looks like it will do bills of materials - there's hg_lv_item in sales_items_in - but I've yet to try that.
    Here's the code of a demo program for a one-line CMR.
    REPORT  YJNM_CREATE_CMR5                        .
    Uses SD_SALESDOCUMENT_CREATE
    parameters:
      p_vgbel like vbrk-vbeln  default '90175587', "reference invoice
      p_fkdat like vbkd-fkdat  default sy-datum,   "billing date
      p_auart like tvak-auart  default 'Z002',     "sales document type
      p_vkorg like tvko-vkorg  default '3',        "sales org.
      p_vtweg like tvtw-vtweg  default '01',       "distr. chan.
      p_spart like tspa-spart  default '06',       "division
      p_vkbur like tvbur-vkbur default '034',      "sales office
      p_kunnr like kna1-kunnr  default '16797',    "sold-to
      p_bstnk like vbak-bstnk  default 'pono00000017',
                                                   "PO number
      p_bname like vbak-bname  default 'Bartholomew Snodgrass',
                                                   "name of orderer
      p_augru like tvau-augru  default '002'.      "order reason
    selection-screen skip.
    selection-screen begin of block i1 with frame title text-001.
      parameters:
        p_matnr like mara-matnr default '27585',   "material number
        p_zmeng type dzmengc    default '65',      "target quantity
        p_netwr like vbap-netwr default '1.20',    "net amount
        p_arktx like vbap-arktx default 'Afternoon tea',
                                                   "short text
        p_fbuda like vbkd-fbuda default '20060109'."service-rendered date
    selection-screen end of block i1.
    data:
      return              like bapiret2,
      returns             like table of return,
      salesdocument_ex    like bapivbeln-vbeln,
      sales_header_in     like bapisdhd1,
      sales_item_in       like bapisditm,
      sales_items_in      like table of sales_item_in,
      sales_condition_in  like bapicond,
      sales_conditions_in like table of sales_condition_in,
      sales_partner       like bapiparnr,
      sales_partners      like table of sales_partner,
      incomplete_log      like bapiincomp,
      incomplete_logs     like table of incomplete_log.
    perform:
      fill_sales_header_in,
      fill_sales_items_in,
      fill_sales_partners,
      fill_sales_conditions_in,
      call_bapi.
    FORM call_bapi .
    CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
      EXPORTING
      SALESDOCUMENT                 =
        SALES_HEADER_IN               = sales_header_in
      SALES_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       = ' '
      INT_NUMBER_ASSIGNMENT         = ' '
      BEHAVE_WHEN_ERROR             = ' '
      LOGIC_SWITCH                  = ' '
        BUSINESS_OBJECT               = 'BUS2094' "cred. mem. req.
      TESTRUN                       =
      CONVERT_PARVW_AUART           = ' '
      STATUS_BUFFER_REFRESH         = 'X'
      IMPORTING
        SALESDOCUMENT_EX              = salesdocument_ex
      SALES_HEADER_OUT              =
      SALES_HEADER_STATUS           =
      TABLES
        RETURN                        = returns
        SALES_ITEMS_IN                = sales_items_in
      SALES_ITEMS_INX               =
        SALES_PARTNERS                = sales_partners
      SALES_SCHEDULES_IN            =
      SALES_SCHEDULES_INX           =
        SALES_CONDITIONS_IN           = sales_conditions_in
      SALES_CONDITIONS_INX          =
      SALES_CFGS_REF                =
      SALES_CFGS_INST               =
      SALES_CFGS_PART_OF            =
      SALES_CFGS_VALUE              =
      SALES_CFGS_BLOB               =
      SALES_CFGS_VK                 =
      SALES_CFGS_REFINST            =
      SALES_CCARD                   =
      SALES_TEXT                    =
      SALES_KEYS                    =
      SALES_CONTRACT_IN             =
      SALES_CONTRACT_INX            =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
      SALES_SCHED_CONF_IN           =
      ITEMS_EX                      =
      SCHEDULE_EX                   =
      BUSINESS_EX                   =
        INCOMPLETE_LOG                = incomplete_logs
      EXTENSIONEX                   =
      CONDITIONS_EX                 =
      PARTNERS_EX                   =
      TEXTHEADERS_EX                =
      TEXTLINES_EX                  =
      BATCH_CHARC                   =
    perform imcompletion_log.
    loop at returns into return where type ne 'S'.
      message id return-id type 'I' number return-number
        with
          return-message_v1
          return-message_v2
          return-message_v3
          return-message_v4.
      endloop.
    if salesdocument_ex is initial.
      write: / 'Document not created'.
    else.
      commit work.
      write: / 'Sales document number:', salesdocument_ex.
      endif.
    ENDFORM.                    " call_bapi
    FORM fill_sales_header_in .
    clear sales_header_in.
    move:
      p_fkdat to sales_header_in-bill_date,
      p_vgbel to sales_header_in-ref_doc,    "invoice number
      'M'     to sales_header_in-refdoc_cat, "invoice
      p_auart to sales_header_in-doc_type,
      p_vkorg to sales_header_in-sales_org,
      p_vtweg to sales_header_in-distr_chan,
      p_spart to sales_header_in-division,
      p_vkbur to sales_header_in-sales_off,
      p_bstnk to sales_header_in-purch_no_c,
      p_bname to sales_header_in-name,
      p_augru to sales_header_in-ord_reason.
    ENDFORM.                    " fill_sales_header_in
    FORM fill_sales_partners .
    clear sales_partner.
    sales_partner-partn_role = 'AG'.
    sales_partner-partn_numb = p_kunnr.
    append sales_partner to sales_partners.
    ENDFORM.                    " fill_sales_partners
    FORM fill_sales_items_in .
    perform one_item_in using:
      10
      p_matnr
      p_zmeng
      p_netwr
      'GBP'
      p_arktx
      p_fbuda.
    ENDFORM.                    " fill_sales_items_in
    FORM one_item_in  using    value(p_itm_number)
                               value(p_p_matnr)
                               value(p_p_zmeng)
                               value(p_p_netwr)
                               value(p_p_waerk)
                               value(p_p_arktx)
                               value(p_p_fbuda).
    clear sales_item_in.
    move:
      p_itm_number to sales_item_in-itm_number,
      p_fkdat      to sales_item_in-bill_date,
      p_vgbel      to sales_item_in-ref_doc,    "invoice number
      'M'          to sales_item_in-ref_doc_ca, "invoice
      p_p_matnr    to sales_item_in-material,
      p_p_zmeng    to sales_item_in-target_qty,
      p_p_netwr    to sales_item_in-target_val,
      p_p_waerk    to sales_item_in-currency,
      p_p_arktx    to sales_item_in-short_text,
      p_p_fbuda    to sales_item_in-serv_date.
    append sales_item_in to sales_items_in.
    ENDFORM.                    " one_item_in
    FORM fill_sales_conditions_in .
    refresh sales_conditions_in.
    perform one_sales_condition_in using:
      10
      p_netwr
      'GBP'.
    ENDFORM.                    " fill_sales_conditions_in
    FORM one_sales_condition_in  using    value(p_itm_number)
                                          value(p_p_netwr)
                                          value(p_p_waerk).
    clear sales_condition_in.
    move:
      p_itm_number to sales_condition_in-itm_number,
      'PR00'       to sales_condition_in-cond_type,
      p_p_netwr    to sales_condition_in-cond_value,
      p_p_waerk    to sales_condition_in-currency.
    append sales_condition_in to sales_conditions_in.
    ENDFORM.                    " one_sales_condition_in
    FORM imcompletion_log .
    loop at incomplete_logs into incomplete_log.
      write: / incomplete_log-itm_number,
               incomplete_log-field_text,
               incomplete_log-table_name,
               incomplete_log-field_name.
      endloop.
    ENDFORM.                    " imcompletion_log

  • Credit Memo Request for New Sales Organisation

    Hi Frnds
    I have a requirement in which i need to create a Credit Memo Request for the newly created sales organisation using the old billing document number created for old sales organisation.Please kindly help me in this regard.
    Thanks in Advace
    Sowmmya B

    Hi,
    Did you try creating a CMR online ??
    Regards

  • Credit Memo Request for intercompany sales process

    Hi Experts
    I try to find SAP notes regardsing the credit memo request for intercompany related issue but I can
    not find any nates. The customer return the goods with 2 different
    scenario :-
    -Return with credit
    -Return with replacement.
    Can anybody explain how this 2 scenario perform in the SAP
    intercompany sales process. Appreciate for your help. Thanks in advance.
    Regards,
    Jennie Tan

    Already answered
    Enter IG (internal credit memo) as the billing type for intercompany
    billing for order type RE.
    Cust-Sales/distrib-Transactions-Billing-Intercompany billing-Order types
    Intercompany billing always refers to a delivery
    Processing flow will be:
    1. Create returns request invoice receipt (with or w/out reference)
    2. Create returns delivery and goods receipt
    3. Create credit memo invoice receipt for customer for 1.
    4. Create internal credit memo for 2.
    Therefore you must make the following entries in the document flow
    for billing documents:
      Target BillType        DlvType              ItemCat
    a)    IG                  LR
    b)    IG                  LR                    REN
    Parameters for entries:
    For a) Copying requirement:  14  Dlv.-rel.header IV
          Copy item no.: x  (Check and decide yourself)
    For b)Copying requirement: 15 Dlv.rel. item IV
          Data VBRK/VBRP      : 1  Inv.split (sample)
          Billing quantity    : B
          Qty/itm val.pos/neg : +
          Pricing type        : G
    Also, refer following SAP Notes
    13160 - Returns with intercompany billing
    24756 - Credit memo requests with inter-company billing
    652007 - Reporting internal credit memos on arrival side
    11980 - Intercompany billing with order-related billing document
    164074 - Problems for internal invoices on returns
    Thanks & Regards
    JP

  • Error while creating Credit Memo Request for Milestone billing invoice

    Hi All,
    I have a scenario where i have Milestone billing(% based) at header level in Contracts. I create Invoice for that and then try to create Credit Memo Request with reference to the Invoice.
    Problem comes when we try to change the qty in the credit memo request. we are able to change the qty but the value is not changing. It remains the same constant value of that milestone.
    In my copy control from Invoice to Credit memo request for the item category i have maintained the pricing type as "C" because i want to copy and manual conditions.
    So kindly let me know which config setting should be done so that whenever i change the qty the value should also be changed.
    Please Note : This is happening only when my billing plan is at header level. For Billing plan at Item level its working fine.....
    Thanks.....

    Hiiii.....
    Can anyone please advise on the below issue of mine.....
    Thanks alot for the help.......in advance

  • FM to create a Credit Memo Request

    hi,
    i have to create a credit memo request that will be created on creation of debit memo. actually output determination of debit memo will trigger the creation credit memo request.
    please provide me a FM to create a Credit Memo Request.
    regards

    Hi,
      Try to use the BAPI BAPI_SALESDOCU_CREATEFROMDATA1
    Please check this thread for sample codes.
    https://forums.sdn.sap.com/click.jspa?searchID=46332&messageID=2304043
    rEGARDS

  • Setting up multiple billing blocks for a CMR - Credit Memo Request

    I am trying to set a billing block for a credit memo request.  The item category in VOV7 configuration only allows you to set one.  I need to be able to set any of them and for it to block.  If we do not use one; the system allows the credit memo to get created.  If we choose the one that we configured in VOV7 it allows us to only use that one.  The client needs to be able to select any billing block from the drop down when creating a credit memo request in VA01 instead of just one specific one.  Is this possible?  If so, where would I do this?

    Surprising! when a billing block is applied in the sales document, then the system will NOT allow to create the billing document(in your case credit memo). Can you check in t.code OVV3, the billing blocks are assigned to billing types? After assigning, create a new document and test. The path is SPRO->Sales and distribution -> billing->billing documents ->define blocking reasons for billing->assign blocking reasons to billing types.
    Regards,

  • Debit memo request with reference to the credit memo request

    Dear SD Consultants,
    I have a business scenario in which I create a credit memo request with reference to a debit memo request but the problem is that ,i can create many debit memo requests with reference to the same credit memo request even if the all target quantity was referenced , I still can create many debit memo requests with reference to the credit memo request so can any one tell me how to restrict creating debit memo request with reference to the credit memo request up till the all target quantity was referenced.
    Regards,
    SD Consultant

    Dear Saju.S,
    I have checked all the positive/negative values in the item copy control but none of the values works as i still can create many debit memo requests with reference to the credit memo request.
    Regards,
    Sd Consultant

  • Issue in processing the Credit Memo Request

    Hi Experts,
    I have a price difference credit memo request created (Order Type PR10). While processing it through VF01, it is getting updated rate (for updated materials) hence total value is exceeding the value of credit memo request.
    How can I process it with the rates request was made soo that total value of both the documents remain same.
    Thanks in Advance.
    Regards
    Mukul

    Hi
    Try with Invoice Correction Request concept
    Sale document Type: RK
    Reference Document Type : Billing Number
    for Understanding the Invoice Correction request check below link
    [Creating Invoice Correction Requests|http://help.sap.com/saphelp_46c/helpdata/en/dd/55feeb545a11d1a7020000e829fd11/content.htm]
    Regards,
    Prasanna

  • Credit memo request for a cancelled billing document

    Hi All,
    My current system settings allow the creation of a credit memo request with reference to a cancelled billing document.
    I can restrict this by making changes in the header copying requirement (021- Billing Header) for CR--> F2 . (Trsansaction VTAF)
    However, I would like to know that whether the standard system should allow or should not allow the same?
    Please be sure of the points on getting correct answers....  
    Regards,
    Nike

    Hi..
      Please kindly to the necessary testing after doing the changes to copycontrol..
    If you donot face any issue then go ahead with the changes you have done else keep the setting
    as before......
    Regards
    MBS

  • BAPI to create SD credit MEMO from Flat file

    Hello All:
       New with BAPi wondering if anyone have sample code to access structured flatfiles and create transactions with the data from flatfiles. The one I am most interested is Credit Memo, however if any other transactional documents will also help as well!
    Sincerely Yours

    Thanks. Problem solved.
    Regards,
    Yayati Ekbote

  • How to create the multiple spool requests for a single report.

    Hi gurus,
                     I have one requirement to be completed , i need to send the out put of the report via mail in pdf format. for that what i did was, iam executing report in background and creating spool request and converting it to pdf and sending the file.
    now the problem is, its a customer ledger report, for each customer i need to create a new spool request and send mail to that particular customer, now my dought is how to create multiple spool requests for a single pro and how i need to go about it.
    And one more question is can we create a spool request for a report which is running in online.
    waiting for inputs frm gurus.

    Hello,
    As per my knowledge for creating new spool id you will have to set
    output_options-tdnewid = 'X'.
    and then using
    job_output_info-spoolids
    create a pdf using
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
    Rachana.

  • Credit memo request for inter company bill-problem in acct posting

    Hi Guru's,
       Problem occured when intercompany prices were missing therefore was corrections made manually.but some invoices were blocked (no accounting docs generated).Strange is that one invoice  got accounting docs and  not blocked (same correction was made as for all)?
    Every thing is same except item Quantity and order dates.
    Error:Reversal of document 02v1 1370000207v2 2007v3 not possible in FI
    Message no. F5A 005
    Diagnosis:
    Item & v4 in accounting document 02 1370000207 2007
    was valuated with an open item foreign currency valuation.
    System Response:
    Document cannot be reversed.
    PLease Help,Very Urgent.
    Thanks in Advance,
    Rao.

    hi rao,
    first try to reset the cleared items by using FBRA and then try to reverse the document. Also check check if the reversal date is still open for posting or not.
    Pl get back with the status.
    Thanks
    Sadhu Kishore

  • Credit Memo Request already exists for item & 1 , & 2, etc

    Hi SD guru's,
    I am trying to create a credit memo request in reference to my sales order invoice and i am getiing this warning message "Credit Memo Request already exists for item ".
    How is this possible,when i am creating the credit memo request only for the 1st time. Message number displayed is V1498, can you please help me solve this issue.
    Also when i manage to enter into the credit memo request document by pressing enter to all those warning's, i am asked to enter the target quantity. How do i handle this? since i have maintained order quantity in my sales order and my sales invoice.
    Message number displayed is V1498, can you please help me solve this issue.
    Waiting for your kind help.
    Regards
    Ravi.D.Mansharamani

    Hi,
    You can control the quantity to be copied into Credit memo request through Copy Controls Quantity Update.
    The the same quantity will be copied from the reference document into target document.
    You are getting error as Credit Memo Request exists , because you have created the Credit Memo request for full Sales Order Qunatity.
    Regards
    Krishna

  • Credit Memo Request - Warning Message

    Hi,
    We need to have Warning message to be displayed when we have the credit value exceeds the invoice value during the Credit Memo request creation with reference to the invoice.
    Currently, as per SAP Standard the system is throwing an information message when the credit value exceeds the invoice value.
    In the same requirement, we need to have a report for which we have the credit value exceeds the invoice value.
    Please help !
    Regards

    Hi,
    You can control the quantity to be copied into Credit memo request through Copy Controls Quantity Update.
    The the same quantity will be copied from the reference document into target document.
    You are getting error as Credit Memo Request exists , because you have created the Credit Memo request for full Sales Order Qunatity.
    Regards
    Krishna

Maybe you are looking for