This website is not affiliated with, sponsored by, or approved by SAP AG.

Copy price from Quote to Sales Order

Logistics : SD and its sub-modules (Inquires, Quotes, Order Entry, SIS, Sales Contacts, Dist. & Billing)

Moderators: Snowy, thx4allthefish, mike_ac, Lost Identity

Copy price from Quote to Sales Order

Postby prince0407 » Thu Sep 18, 2014 5:16 pm

I have the following include assigned to a number of condition types. We trying to pull the price from the quote document onto a sales order. We are not using the standard copy w/ref to order functionality. We added quote number on the sales order via a custom field. When this quote field is populated on the sales order we pull over the conditions from the quote to the sales order. Issue #1 the correct condition base value is not coming over Issue#2 the codition does not bring over all the conditions from the quote into the sales order. Issue#3 the condition are out of sort even with a sort statement. See the code

Code: Select all
DATA: lo_model           TYPE REF TO zcl_sd_pq_model,
      lo_iter            TYPE REF TO zcl_sd_pq_model_item_iterator,
      lo_item            TYPE REF TO zcl_sd_pq_model_item,
      ls_item_conditions TYPE konv,
      ls_xkomv           TYPE konv,
      ls_zsdomfld        TYPE zsdomfld,
      lt_zsdom_pairs      TYPE zsdomfld_t.


CONSTANTS: lc_zquq TYPE kschl VALUE 'ZQUQ',
           lc_zquo TYPE kschl VALUE 'ZQUO'.


DO 1 TIMES. "A Must in UserExit Processing Ensure Other IncludesProcess

  "Only copy over when a quote number and item is available
  IF komp-zz_pq_quote IS NOT INITIAL AND
     komp-zz_pq_item IS NOT INITIAL.

    TRY .
        "Create instance of quote model
        lo_model = zcl_sd_pq_model=>factory( komp-zz_pq_quote ).

      CATCH zcx_sd_pq_error.

        MESSAGE s026.

    ENDTRY.

      "Get the upcharge/waiver pairs
    SELECT * FROM zsdomfld
           INTO TABLE lt_zsdom_pairs
           WHERE category EQ 'E03697_PAIRS'
             AND highval  EQ 'C'.


    "Get the item iterations
    MOVE: lo_model->mo_items->get_iterator( ) TO lo_iter.

    "Loop through the line items
    WHILE lo_iter->has_next( ) = abap_true.

      lo_item ?= lo_iter->next( ).

      "Do not add rejected line items to the output
      IF lo_item->mv_rejected = 13.
        CONTINUE.
      ENDIF.

      "Check for same line item
      IF lo_item->mv_item NE komp-zz_pq_item.
        CONTINUE.
      ENDIF.

      IF xkomv-kschl = lc_zquo.

        READ TABLE lo_item->mt_item_conditions INTO ls_item_conditions
          WITH KEY kschl = lc_zquq.

      ELSE.

        READ TABLE lo_item->mt_item_conditions INTO ls_item_conditions
          WITH KEY kschl = xkomv-kschl.

      ENDIF.

      IF sy-subrc = 0.
        xkomv-kbetr = ls_item_conditions-kbetr.
        xkomv-kmein = ls_item_conditions-kmein.
        xkomv-kumza = ls_item_conditions-kumza. 
        xkomv-kawrt = ls_item_conditions-kawrt / 100.
      ENDIF.
prince0407
 
Posts: 1
Joined: Thu Jan 19, 2012 11:33 am

Re: Copy price from Quote to Sales Order

Postby sweetsinchan » Thu Oct 02, 2014 11:23 pm

Hi,

you can force SAP to copy the price from quote with a user exits.

Chika
sweetsinchan
 
Posts: 85
Joined: Fri Apr 23, 2010 5:55 am


Return to Logistics SD

Who is online

Users browsing this forum: No registered users and 8 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.