<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471144#M221444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;FORM get_update .&lt;/P&gt;&lt;P&gt;  DATA: l_itemno(6) TYPE n,&lt;/P&gt;&lt;P&gt;        l_partner TYPE parvw,&lt;/P&gt;&lt;P&gt;        l_kunnr TYPE kunnr,&lt;/P&gt;&lt;P&gt;        l_matnr TYPE matnr,&lt;/P&gt;&lt;P&gt;        l_mesg TYPE string,&lt;/P&gt;&lt;P&gt;        l_kbetr TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_in_qty LIKE vbap-zmeng,&lt;/P&gt;&lt;P&gt;        l_meins LIKE mara-meins,&lt;/P&gt;&lt;P&gt;        l_factor LIKE marm-umrez,&lt;/P&gt;&lt;P&gt;        l_qty   LIKE vbap-zmeng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: v_correct, v_error, v_total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT it_data BY loc div pdpl_order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_data.&lt;/P&gt;&lt;P&gt;    CLEAR v_index.&lt;/P&gt;&lt;P&gt;    v_index = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- New SalesOrder&lt;/P&gt;&lt;P&gt;    AT NEW pdpl_order.&lt;/P&gt;&lt;P&gt;      READ TABLE it_data INDEX v_index.&lt;/P&gt;&lt;P&gt;      CLEAR: it_orderh, it_item, it_partner,&lt;/P&gt;&lt;P&gt;             it_return, conditions, conditions[],&lt;/P&gt;&lt;P&gt;             it_item[], it_partner[], it_return[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_total = v_total + 1.  "Increment Total SalesOrders counter&lt;/P&gt;&lt;P&gt;      CLEAR l_itemno.&lt;/P&gt;&lt;P&gt;      l_itemno = '10'.&lt;/P&gt;&lt;P&gt;*- Covert date fields into Internal format&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          datum = it_data-date&lt;/P&gt;&lt;P&gt;          dtype = 'DATS'&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          idate = it_data-date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Populate SalesOrder header data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_AUART_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = it_data-auart&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = it_data-auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      it_orderh-doc_type   = it_data-auart.&lt;/P&gt;&lt;P&gt;      it_orderh-sales_org  = it_data-vkorg.&lt;/P&gt;&lt;P&gt;      it_orderh-distr_chan = it_data-vtweg.&lt;/P&gt;&lt;P&gt;      it_orderh-division   = it_data-spart.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    it_orderh-doc_number = it_data-vbeln.  "No external # assignment allowed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_orderh-doc_date   = it_data-date.      "Doc Dt&lt;/P&gt;&lt;P&gt;      it_orderh-purch_no_s = it_data-pdpl_order.&lt;/P&gt;&lt;P&gt;      it_orderh-ord_reason = it_data-ord_cause. "Order reason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Partner data&lt;/P&gt;&lt;P&gt;      CLEAR: l_partner, l_kunnr.&lt;/P&gt;&lt;P&gt;*- Convert Partner type into internal format&lt;/P&gt;&lt;P&gt;      l_partner = 'SP'.  "SoldTo Party&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = l_partner&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = l_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Convert Customer into internal format&lt;/P&gt;&lt;P&gt;      l_kunnr = it_data-kunnr.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = l_kunnr&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = l_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      it_partner-partn_role = l_partner.&lt;/P&gt;&lt;P&gt;      it_partner-partn_numb = l_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND it_partner.&lt;/P&gt;&lt;P&gt;      CLEAR it_partner.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Item data&lt;/P&gt;&lt;P&gt;    it_item-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;*- Convert material number into internal format&lt;/P&gt;&lt;P&gt;    CLEAR l_matnr.&lt;/P&gt;&lt;P&gt;    l_matnr = it_data-matnr.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        input        = l_matnr&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        output       = l_matnr&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        length_error = 1&lt;/P&gt;&lt;P&gt;        OTHERS       = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_item-material  = l_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Insert into Reconciliation table&lt;/P&gt;&lt;P&gt;    PERFORM insert_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Call FM to get new qty based on SAP UOM&lt;/P&gt;&lt;P&gt;    CLEAR: l_meins, l_qty, l_in_qty, l_factor.&lt;/P&gt;&lt;P&gt;    l_in_qty = it_data-qty.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'Z_GET_QTY_FROM_UOM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        matnr     = it_data-matnr&lt;/P&gt;&lt;P&gt;        in_meins  = it_data-uom&lt;/P&gt;&lt;P&gt;        in_qty    = l_in_qty&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_meins = l_meins&lt;/P&gt;&lt;P&gt;        quantity  = l_qty&lt;/P&gt;&lt;P&gt;        factor    = l_factor.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      it_data-qty = l_qty.&lt;/P&gt;&lt;P&gt;      it_data-uom = l_meins.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Call FM to get new qty based on SAP UOM&lt;/P&gt;&lt;P&gt;    CLEAR: l_meins, l_qty, l_in_qty.&lt;/P&gt;&lt;P&gt;    l_in_qty = it_data-free_qty.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'Z_GET_QTY_FROM_UOM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        matnr     = it_data-matnr&lt;/P&gt;&lt;P&gt;        in_meins  = it_data-uom&lt;/P&gt;&lt;P&gt;        in_qty    = l_in_qty&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_meins = l_meins&lt;/P&gt;&lt;P&gt;        quantity  = l_qty&lt;/P&gt;&lt;P&gt;        factor    = l_factor.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      it_data-free_qty = l_qty.&lt;/P&gt;&lt;P&gt;      it_data-uom = l_meins.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Batch&lt;/P&gt;&lt;P&gt;    it_item-batch = it_data-batch.&lt;/P&gt;&lt;P&gt;    it_item-target_qty = it_data-qty.                       " * 1000.&lt;/P&gt;&lt;P&gt;    it_item-target_qu = it_data-uom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT it_item-material IS INITIAL.&lt;/P&gt;&lt;P&gt;      APPEND it_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Pricing Conditions&lt;/P&gt;&lt;P&gt;      conditions-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;      conditions-cond_count = '01'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'PR00'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-kbetr / 10. "Price (Rate)&lt;/P&gt;&lt;P&gt;      IF l_factor &amp;gt; 0.&lt;/P&gt;&lt;P&gt;        conditions-cond_value = l_kbetr / l_factor.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Discount&lt;/P&gt;&lt;P&gt;    IF NOT it_data-discount IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '02'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZDIS'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-discount / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- CD&lt;/P&gt;&lt;P&gt;    IF NOT it_data-cd IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '03'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZCD'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-cd / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Lst&lt;/P&gt;&lt;P&gt;    IF NOT it_data-lst IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '04'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZIN2'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-lst / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Surcharge&lt;/P&gt;&lt;P&gt;    IF NOT it_data-sur IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '05'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZIN5'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-sur / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**- CST&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF NOT it_data-cst IS INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_count = '06'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_type  = 'ZIN1'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR l_kbetr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     l_kbetr = it_data-cst.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     APPEND conditions.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR conditions.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Freight&lt;/P&gt;&lt;P&gt;    IF NOT it_data-freight IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '07'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZFR1'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-freight / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Rounding Off&lt;/P&gt;&lt;P&gt;    IF NOT it_data-roff IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '08'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZRND'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-roff / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF it_data-free_qty &amp;gt; '0.000'.&lt;/P&gt;&lt;P&gt;*- Increment Item counter.&lt;/P&gt;&lt;P&gt;      l_itemno = l_itemno + 10.&lt;/P&gt;&lt;P&gt;      it_item-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;      it_item-material  = l_matnr.&lt;/P&gt;&lt;P&gt;      it_item-item_categ = 'RENN'.&lt;/P&gt;&lt;P&gt;      it_item-target_qty = it_data-free_qty.                " * 1000.&lt;/P&gt;&lt;P&gt;      APPEND it_item.&lt;/P&gt;&lt;P&gt;      CLEAR  it_item.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Increment Item counter.&lt;/P&gt;&lt;P&gt;    l_itemno = l_itemno + 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- At end of SalesOrder&lt;/P&gt;&lt;P&gt;    AT END OF pdpl_order.&lt;/P&gt;&lt;P&gt;      READ TABLE it_data INDEX v_index.&lt;/P&gt;&lt;P&gt;*- Call the BAPI for  Credit Note creation&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          return_header_in     = it_orderh&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          return               = it_return&lt;/P&gt;&lt;P&gt;          return_items_in      = it_item&lt;/P&gt;&lt;P&gt;          return_partners      = it_partner&lt;/P&gt;&lt;P&gt;          return_conditions_in = conditions.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;        CLEAR v_vbeln.&lt;/P&gt;&lt;P&gt;        SORT it_return BY type id.&lt;/P&gt;&lt;P&gt;        READ TABLE it_return WITH KEY type = 'S'&lt;/P&gt;&lt;P&gt;                                      id   = 'V1'.&lt;/P&gt;&lt;P&gt;        IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          v_vbeln = it_return-message_v2.&lt;/P&gt;&lt;P&gt;          v_correct = v_correct + 1.&lt;/P&gt;&lt;P&gt;          CLEAR l_mesg.&lt;/P&gt;&lt;P&gt;          CONCATENATE 'Credit note'(007) v_vbeln 'successfully created.'(008)&lt;/P&gt;&lt;P&gt;          INTO l_mesg SEPARATED BY space.&lt;/P&gt;&lt;P&gt;          CONDENSE l_mesg.&lt;/P&gt;&lt;P&gt;          WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;*- Call VA02 for updating Qty&lt;/P&gt;&lt;P&gt;          PERFORM call_va02.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          v_error = v_error + 1.&lt;/P&gt;&lt;P&gt;          READ TABLE it_return WITH KEY type = 'E'.&lt;/P&gt;&lt;P&gt;          IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;            CLEAR l_mesg.&lt;/P&gt;&lt;P&gt;            l_mesg = it_return-message.&lt;/P&gt;&lt;P&gt;            CONDENSE l_mesg.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;*- Populate the output table&lt;/P&gt;&lt;P&gt;      CLEAR it_out.&lt;/P&gt;&lt;P&gt;      it_out-pdpl_order = it_data-pdpl_order.&lt;/P&gt;&lt;P&gt;      it_out-mesg = l_mesg.&lt;/P&gt;&lt;P&gt;      APPEND it_out.&lt;/P&gt;&lt;P&gt;      CLEAR it_out.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_update&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 10:09:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-30T10:09:51Z</dc:date>
    <item>
      <title>BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471143#M221443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Re: BAPI _ CUSTOMERRETURN _ CREATE , how to fix a payer &lt;/P&gt;&lt;P&gt;Posted: Aug 30, 2006 5:29 AM        Reply      E-mail this post  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;i am passing the pricing date (in Return_header_in) and i m using doc type as ZR (Automatic return).In the sales order created.My net value is changing ie its not taking the net value as per the pricing date, i am passing !! .i want my net value to be constant here.How can i make it happen.Is it possible ? .I have tried passing 'pricing type D-(copy unchanged)" in the Logic switch of this BAPI.but not working , it says not defined !!.&lt;/P&gt;&lt;P&gt;Your help will be heartily appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx n warm regards&lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471143#M221443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471144#M221444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arora,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------" /&gt;&lt;P&gt;FORM get_update .&lt;/P&gt;&lt;P&gt;  DATA: l_itemno(6) TYPE n,&lt;/P&gt;&lt;P&gt;        l_partner TYPE parvw,&lt;/P&gt;&lt;P&gt;        l_kunnr TYPE kunnr,&lt;/P&gt;&lt;P&gt;        l_matnr TYPE matnr,&lt;/P&gt;&lt;P&gt;        l_mesg TYPE string,&lt;/P&gt;&lt;P&gt;        l_kbetr TYPE p DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_in_qty LIKE vbap-zmeng,&lt;/P&gt;&lt;P&gt;        l_meins LIKE mara-meins,&lt;/P&gt;&lt;P&gt;        l_factor LIKE marm-umrez,&lt;/P&gt;&lt;P&gt;        l_qty   LIKE vbap-zmeng.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: v_correct, v_error, v_total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT it_data BY loc div pdpl_order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_data.&lt;/P&gt;&lt;P&gt;    CLEAR v_index.&lt;/P&gt;&lt;P&gt;    v_index = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- New SalesOrder&lt;/P&gt;&lt;P&gt;    AT NEW pdpl_order.&lt;/P&gt;&lt;P&gt;      READ TABLE it_data INDEX v_index.&lt;/P&gt;&lt;P&gt;      CLEAR: it_orderh, it_item, it_partner,&lt;/P&gt;&lt;P&gt;             it_return, conditions, conditions[],&lt;/P&gt;&lt;P&gt;             it_item[], it_partner[], it_return[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_total = v_total + 1.  "Increment Total SalesOrders counter&lt;/P&gt;&lt;P&gt;      CLEAR l_itemno.&lt;/P&gt;&lt;P&gt;      l_itemno = '10'.&lt;/P&gt;&lt;P&gt;*- Covert date fields into Internal format&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          datum = it_data-date&lt;/P&gt;&lt;P&gt;          dtype = 'DATS'&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          idate = it_data-date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Populate SalesOrder header data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_AUART_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = it_data-auart&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = it_data-auart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      it_orderh-doc_type   = it_data-auart.&lt;/P&gt;&lt;P&gt;      it_orderh-sales_org  = it_data-vkorg.&lt;/P&gt;&lt;P&gt;      it_orderh-distr_chan = it_data-vtweg.&lt;/P&gt;&lt;P&gt;      it_orderh-division   = it_data-spart.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    it_orderh-doc_number = it_data-vbeln.  "No external # assignment allowed&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_orderh-doc_date   = it_data-date.      "Doc Dt&lt;/P&gt;&lt;P&gt;      it_orderh-purch_no_s = it_data-pdpl_order.&lt;/P&gt;&lt;P&gt;      it_orderh-ord_reason = it_data-ord_cause. "Order reason&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Partner data&lt;/P&gt;&lt;P&gt;      CLEAR: l_partner, l_kunnr.&lt;/P&gt;&lt;P&gt;*- Convert Partner type into internal format&lt;/P&gt;&lt;P&gt;      l_partner = 'SP'.  "SoldTo Party&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_PARVW_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = l_partner&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = l_partner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Convert Customer into internal format&lt;/P&gt;&lt;P&gt;      l_kunnr = it_data-kunnr.&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          input  = l_kunnr&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          output = l_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      it_partner-partn_role = l_partner.&lt;/P&gt;&lt;P&gt;      it_partner-partn_numb = l_kunnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND it_partner.&lt;/P&gt;&lt;P&gt;      CLEAR it_partner.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Item data&lt;/P&gt;&lt;P&gt;    it_item-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;*- Convert material number into internal format&lt;/P&gt;&lt;P&gt;    CLEAR l_matnr.&lt;/P&gt;&lt;P&gt;    l_matnr = it_data-matnr.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        input        = l_matnr&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        output       = l_matnr&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        length_error = 1&lt;/P&gt;&lt;P&gt;        OTHERS       = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_item-material  = l_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Insert into Reconciliation table&lt;/P&gt;&lt;P&gt;    PERFORM insert_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Call FM to get new qty based on SAP UOM&lt;/P&gt;&lt;P&gt;    CLEAR: l_meins, l_qty, l_in_qty, l_factor.&lt;/P&gt;&lt;P&gt;    l_in_qty = it_data-qty.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'Z_GET_QTY_FROM_UOM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        matnr     = it_data-matnr&lt;/P&gt;&lt;P&gt;        in_meins  = it_data-uom&lt;/P&gt;&lt;P&gt;        in_qty    = l_in_qty&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_meins = l_meins&lt;/P&gt;&lt;P&gt;        quantity  = l_qty&lt;/P&gt;&lt;P&gt;        factor    = l_factor.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      it_data-qty = l_qty.&lt;/P&gt;&lt;P&gt;      it_data-uom = l_meins.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Call FM to get new qty based on SAP UOM&lt;/P&gt;&lt;P&gt;    CLEAR: l_meins, l_qty, l_in_qty.&lt;/P&gt;&lt;P&gt;    l_in_qty = it_data-free_qty.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'Z_GET_QTY_FROM_UOM'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        matnr     = it_data-matnr&lt;/P&gt;&lt;P&gt;        in_meins  = it_data-uom&lt;/P&gt;&lt;P&gt;        in_qty    = l_in_qty&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        out_meins = l_meins&lt;/P&gt;&lt;P&gt;        quantity  = l_qty&lt;/P&gt;&lt;P&gt;        factor    = l_factor.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      it_data-free_qty = l_qty.&lt;/P&gt;&lt;P&gt;      it_data-uom = l_meins.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Batch&lt;/P&gt;&lt;P&gt;    it_item-batch = it_data-batch.&lt;/P&gt;&lt;P&gt;    it_item-target_qty = it_data-qty.                       " * 1000.&lt;/P&gt;&lt;P&gt;    it_item-target_qu = it_data-uom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT it_item-material IS INITIAL.&lt;/P&gt;&lt;P&gt;      APPEND it_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Pricing Conditions&lt;/P&gt;&lt;P&gt;      conditions-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;      conditions-cond_count = '01'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'PR00'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-kbetr / 10. "Price (Rate)&lt;/P&gt;&lt;P&gt;      IF l_factor &amp;gt; 0.&lt;/P&gt;&lt;P&gt;        conditions-cond_value = l_kbetr / l_factor.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Discount&lt;/P&gt;&lt;P&gt;    IF NOT it_data-discount IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '02'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZDIS'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-discount / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- CD&lt;/P&gt;&lt;P&gt;    IF NOT it_data-cd IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '03'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZCD'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-cd / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Lst&lt;/P&gt;&lt;P&gt;    IF NOT it_data-lst IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '04'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZIN2'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-lst / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Surcharge&lt;/P&gt;&lt;P&gt;    IF NOT it_data-sur IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '05'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZIN5'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-sur / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**- CST&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF NOT it_data-cst IS INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_count = '06'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_type  = 'ZIN1'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR l_kbetr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     l_kbetr = it_data-cst.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     APPEND conditions.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     CLEAR conditions.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Freight&lt;/P&gt;&lt;P&gt;    IF NOT it_data-freight IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '07'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZFR1'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-freight / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Rounding Off&lt;/P&gt;&lt;P&gt;    IF NOT it_data-roff IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    conditions-itm_number = l_itemno.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      conditions-cond_count = '08'.&lt;/P&gt;&lt;P&gt;      conditions-cond_type  = 'ZRND'.&lt;/P&gt;&lt;P&gt;      CLEAR l_kbetr.&lt;/P&gt;&lt;P&gt;      l_kbetr = it_data-roff / 10.&lt;/P&gt;&lt;P&gt;      conditions-cond_value = l_kbetr.&lt;/P&gt;&lt;P&gt;      APPEND conditions.&lt;/P&gt;&lt;P&gt;      CLEAR conditions.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF it_data-free_qty &amp;gt; '0.000'.&lt;/P&gt;&lt;P&gt;*- Increment Item counter.&lt;/P&gt;&lt;P&gt;      l_itemno = l_itemno + 10.&lt;/P&gt;&lt;P&gt;      it_item-itm_number = l_itemno.&lt;/P&gt;&lt;P&gt;      it_item-material  = l_matnr.&lt;/P&gt;&lt;P&gt;      it_item-item_categ = 'RENN'.&lt;/P&gt;&lt;P&gt;      it_item-target_qty = it_data-free_qty.                " * 1000.&lt;/P&gt;&lt;P&gt;      APPEND it_item.&lt;/P&gt;&lt;P&gt;      CLEAR  it_item.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- Increment Item counter.&lt;/P&gt;&lt;P&gt;    l_itemno = l_itemno + 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*- At end of SalesOrder&lt;/P&gt;&lt;P&gt;    AT END OF pdpl_order.&lt;/P&gt;&lt;P&gt;      READ TABLE it_data INDEX v_index.&lt;/P&gt;&lt;P&gt;*- Call the BAPI for  Credit Note creation&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          return_header_in     = it_orderh&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          return               = it_return&lt;/P&gt;&lt;P&gt;          return_items_in      = it_item&lt;/P&gt;&lt;P&gt;          return_partners      = it_partner&lt;/P&gt;&lt;P&gt;          return_conditions_in = conditions.&lt;/P&gt;&lt;P&gt;      IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        COMMIT WORK.&lt;/P&gt;&lt;P&gt;        CLEAR v_vbeln.&lt;/P&gt;&lt;P&gt;        SORT it_return BY type id.&lt;/P&gt;&lt;P&gt;        READ TABLE it_return WITH KEY type = 'S'&lt;/P&gt;&lt;P&gt;                                      id   = 'V1'.&lt;/P&gt;&lt;P&gt;        IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;          v_vbeln = it_return-message_v2.&lt;/P&gt;&lt;P&gt;          v_correct = v_correct + 1.&lt;/P&gt;&lt;P&gt;          CLEAR l_mesg.&lt;/P&gt;&lt;P&gt;          CONCATENATE 'Credit note'(007) v_vbeln 'successfully created.'(008)&lt;/P&gt;&lt;P&gt;          INTO l_mesg SEPARATED BY space.&lt;/P&gt;&lt;P&gt;          CONDENSE l_mesg.&lt;/P&gt;&lt;P&gt;          WAIT UP TO 1 SECONDS.&lt;/P&gt;&lt;P&gt;*- Call VA02 for updating Qty&lt;/P&gt;&lt;P&gt;          PERFORM call_va02.&lt;/P&gt;&lt;P&gt;        ELSE.&lt;/P&gt;&lt;P&gt;          v_error = v_error + 1.&lt;/P&gt;&lt;P&gt;          READ TABLE it_return WITH KEY type = 'E'.&lt;/P&gt;&lt;P&gt;          IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;            CLEAR l_mesg.&lt;/P&gt;&lt;P&gt;            l_mesg = it_return-message.&lt;/P&gt;&lt;P&gt;            CONDENSE l_mesg.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;*- Populate the output table&lt;/P&gt;&lt;P&gt;      CLEAR it_out.&lt;/P&gt;&lt;P&gt;      it_out-pdpl_order = it_data-pdpl_order.&lt;/P&gt;&lt;P&gt;      it_out-mesg = l_mesg.&lt;/P&gt;&lt;P&gt;      APPEND it_out.&lt;/P&gt;&lt;P&gt;      CLEAR it_out.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_update&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 10:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471144#M221444</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T10:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471145#M221445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;i have gone thru the code.but kindly be specific and let me know, what i have to pass extra in the bapi "BAPI _ CUSTOMERRETURN_CREATE" to fix this.I have basically a requiremnet in which i want my NET VALUE to be same after we do ZR on a F2 doc type.I am passing pricing date,but the net value is getting picked up as per the todays date and not the pricing date passed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to exactly COPY the previous(when the doc type was F2, billing doc) CONDITION TYPES  to when it became ZR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to rephrase my requirement "How to go about this ie copying the condition type from F2 to ZR , thru this BAPI" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help its urgent n important&lt;/P&gt;&lt;P&gt;Promise to give u full points&lt;/P&gt;&lt;P&gt;Thanx and warm regards&lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 12:08:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471145#M221445</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T12:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471146#M221446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ALL, &lt;/P&gt;&lt;P&gt;This is an importnat issue for me .. please please help!!&lt;/P&gt;&lt;P&gt;I promise to give u max points.&lt;/P&gt;&lt;P&gt;thanx&lt;/P&gt;&lt;P&gt;balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 14:00:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471146#M221446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T14:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471147#M221447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Balwant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I can advice you to create an order online in VA01 &lt;/P&gt;&lt;P&gt;with the reference document, now you can see if this &lt;/P&gt;&lt;P&gt;takes conditions as per current pricing date or it takes &lt;/P&gt;&lt;P&gt;from the original order. If the new order can not take &lt;/P&gt;&lt;P&gt;old conditions then it has to be fixed here rather than &lt;/P&gt;&lt;P&gt;working on BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Also check user-exit MV45AFZZ if there is any &lt;/P&gt;&lt;P&gt;defaulting of pricing date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Have returned from office so can only suggest you &lt;/P&gt;&lt;P&gt;only with my experience. I can not check the same on &lt;/P&gt;&lt;P&gt;system now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 14:22:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471147#M221447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471148#M221448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi eshwar,&lt;/P&gt;&lt;P&gt;Thanx for your reply !!&lt;/P&gt;&lt;P&gt;i am able to do it correctly thru va01 ie manually its fine.&lt;/P&gt;&lt;P&gt;i was trying to pass all the condition types based on vbrk-vbeln&lt;DEL&gt;&amp;gt;vbrk-knumv&lt;/DEL&gt;&amp;gt;konv-knumv , taking all the records here passing to the return_condtion_in of bapi.&lt;/P&gt;&lt;P&gt;but was giving errrors for some condtion type(konv-kschl) , "Condition xxxx cannot be processed manually".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am stuck uo badly here !! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which t-code to access this user-exit MV45AFZZ .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx n warm regards,&lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 16:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471148#M221448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471149#M221449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balwant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Can you post your code, i think it will be better for &lt;/P&gt;&lt;P&gt;understanding and for our friends here to advice.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 18:41:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471149#M221449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471150#M221450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Eshwar,&lt;/P&gt;&lt;P&gt;i didnt code anything as such .. i was just trying passing a single record from KONV table based on vbrp-knumv, in the return_condition_in ,along with other parameters of bapi,to test .. then the bapi gave this error&lt;/P&gt;&lt;P&gt;"Condition XXXX cannot be processed manually".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other way out .. to copy condition types from billing doc to sales doc .. except BDC!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am desperate to solve this issue .. plz help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx &lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2006 04:20:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471150#M221450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-01T04:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471151#M221451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;     I am still waiting for anybody to help me on the above problem .. plz help .&lt;/P&gt;&lt;P&gt;Thanx    &lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Sep 2006 11:35:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471151#M221451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-01T11:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471152#M221452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Kindly read the above problem and kindly let me know if you have come across this and plz let me know the solution.&lt;/P&gt;&lt;P&gt;Your expert advice is solicited at the earliest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx &amp;amp;  warm regards,&lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Sep 2006 11:20:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471152#M221452</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-04T11:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI _ CUSTOMERRETURN _ CREATE  , Net value changing!!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471153#M221453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;was able to solve this finally!! refer to oss note 370988.&lt;/P&gt;&lt;P&gt;cheers !!&lt;/P&gt;&lt;P&gt;Balwant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 06:14:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-customerreturn-create-net-value-changing/m-p/1471153#M221453</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T06:14:55Z</dc:date>
    </item>
  </channel>
</rss>

