Performance issue adding a new product line to existing Quote pricing issue

Hi All,
Morning , need some assistance with this as we are currently stuck with this...
Using the Seeded API call mentioned here : aso_quote_pub.update_quote we are trying to add a new product/item lines to an existing quote in Sales Online Module but it is taking lot of time ( means performance issue is there ).
Also if there are already existing some product/quote lines on the quote and then we try to add another new product/quote line to this quote , then also it more and more of the time..
There are some parameters which we are setting as mentioned below :
l_control_rec.header_pricing_event := 'BATCH' -- What does this mean when we set to batch
l_control_rec.price_mode := 'ENTIRE_QUOTE'; -- (possible values could be CHANGE_LINES , QUOTE_LINE)
l_header_rec.pricing_status_indicator := 'C';
l_control_rec.calculate_freight_charge_flag := 'Y';
l_control_rec.calculate_tax_flag := 'Y';
l_header_rec.tax_status_indicator := 'C';
Question :Could someone please help us with this whether it there any way these parameters could be altered or changed to some other value ( like for PRICE_MODE we see this parameter could have some other values like : CHANGE_LINES , QUOTE_LINE etc other than ENTIRE_QUOTE).
means lets say we do the Pricing Engine call only for the Newly Added quote line but not do it for the Entire Quote again and again..
Question : Now the other question here could be how do we finally synch the line level price values for all the quote lines upto the Quote header level in form of Totals (TOTAL_LIST_PRICE,TOTAL_TAX, TOTAL_SHIPPING_CHARGE, SURCHARGE, TOTAL_QUOTE_PRICE in aso_quote_headers_all table) ??
2.Also is there a way that we don't do the Freight Charge calculation and Tax calculation (means we skip this completely) while adding products to the quote but do it at a later point when doing the Submit to Order functionality.
Could someone please help with these pricing related parameters and modes to be used in order to get around this performance issue
Thanks

Dear Expert,
Activate your Controlling area as usual and Cost Centers and Profit Center , You can assign an internal order for the particular product line for what you are seeing and can collect the costs of that particular product line exclusively.
Regards,
Shankar K B

Similar Messages

  • Performance issue: Adding a new product line to existing Quote calls pricing engine for existing line a well

    Hi All,
    I need some assistance for my below query...
    If there are already existing some product/quote lines on the quote and then we try to add another new product/quote line to this quote , then  it is taking more time to add the product. As per my understanding it is calling the Pricing engine for the existing line as well. How can we avoid the pricing engine call for the existing lines.
    There are some parameters which we are setting as mentioned below :
    l_control_rec.header_pricing_event := 'BATCH' -- What does this mean when we set to batch
    l_control_rec.price_mode := 'ENTIRE_QUOTE'; -- (possible values could be CHANGE_LINES , QUOTE_LINE)
    l_header_rec.pricing_status_indicator := 'C';
    l_control_rec.calculate_freight_charge_flag := 'Y';
    l_control_rec.calculate_tax_flag := 'Y';
    l_header_rec.tax_status_indicator := 'C';
    Question :Could someone please help us with this whether is there any way with these parameters could be altered or changed to some other value ( like for PRICE_MODE we see this parameter could have some other values like : CHANGE_LINES , QUOTE_LINE etc other than ENTIRE_QUOTE).
    means lets say we do the Pricing Engine call only for the Newly Added quote line but not do it for the Entire Quote again and again..
    Now the other question here could be how do we finally synch the line level price values for all the quote lines upto the Quote header level in form of Totals (TOTAL_LIST_PRICE,TOTAL_TAX, TOTAL_SHIPPING_CHARGE, SURCHARGE, TOTAL_QUOTE_PRICE in aso_quote_headers_all table) ??
    Also is there a way that we don't do the Freight Charge calculation and Tax calculation (means we skip this completely) while adding products to the quote but do it at a later point when doing the Submit to Order functionality.
    Could someone please help with these pricing related parameters and modes to be used in order to get around this performance issue
    Thanks
    Mithun

    Dear Expert,
    Activate your Controlling area as usual and Cost Centers and Profit Center , You can assign an internal order for the particular product line for what you are seeing and can collect the costs of that particular product line exclusively.
    Regards,
    Shankar K B

  • Add new product to already existing PPR ID through BAPI_PPR_MAINTAIN_40

    Hi,
    My requirement is to add new product to already existing PPR ID through the BAPI BAPI_PPR_MAINTAIN_40 but it is not working.
    Normally at the time of creation we pass HANDLE and REF_HANDLE.
    As in this case PPR ID already exist but adding new product, I am passing HANDLE and REF_GUID in place of REF_HANDLE.
    INPUT_FIELDS also I am passing REF_GUID but it is not working.
    Can anybody throw a light how this can be achieved to add new product through this BAPI?
    It really helps.
    Thanks in advance

    Hi Joao,
    Were you able to succeed in creating PPR programatically?
    Please share your solution. Even I am unable to maintain input fields tab.

  • Integration between Product line costing/schedule/risk/pricing and Finance

    Hi SD Gurus
    Anybody pls help me ,
    " Bidding integration between Product line costing/schedule/risk/pricing and Finance business plans ".-- Fixing Core Phase.
    Pls send me Business process for this Pain Area.
    Very Urgent.
    Thanking you
    with regards
    pawan

    HI Gowri
    Regarding products, those are not created in the cloud.  In regards to what data is  unidirectional versus bi-directional the discussion normally focuses on who owns the data.  Products aren't owned by the sales or service teams, they are normally owned by a master data function.  Products are unidrectional  from ERP to Cloud for customer.    Review our golden deck, listed in the how-to guide blog to understand what data is integrated. 
    http://scn.sap.com/community/cloud-for-customer/blog/2014/03/27/sap-cloud-for-customer-integration-with-erp-and-crm-how-to-guides-and-e-learning
    -ginger

  • When I add a new bookmark, and the (star) Page Bookmarked window appears - is there any way to expand the size of that window so that I can see my entire list of folders when adding a new bookmark to an existing folder?

    When I add a new bookmark, and the (star) Page Bookmarked window appears - is there any way to expand the size of that window so that I can see my entire list of folders when adding a new bookmark to an existing folder? The endless scrolling technique is far too tedious when trying to add a new bookmark, because the window is simply too tiny. Is there maybe a plug-in that will let me grab the corner of that window and re-size it? Thanks!

    I suggest you install the "Add Bookmark to Here2" extension, then you can expand the the list but you will not see the bookmark itself in the list if that is what you wanted. At the top you have three major folders you can select one of them and scroll up and down. Below that you have your most recently used folders and you can select one of them instead and scroll up and down. You can see the folder the bookmark is in -- they get added to the bottom
    If you really want to see the bookmark within the folder the same extension allows you to bring the bookmark to the folder from say the bookmarks sidebar that is why it is named as such. I use it but mainly i use the dialog.
    Please continue reading about bookmarks and some related extensions at
    * http://kb.mozillazine.org/Sorting_and_rearranging_bookmarks_-_Firefox
    * https://addons.mozilla.org/firefox/addon/add-bookmark-here-2/
    * http://dmcritchie.mvps.org/firefox/firefox.htm#addbookmarkhere2
    * http://dmcritchie.mvps.org/firefox/kws.htm
    If you are not using tags at all, you can remove a whole lot of confusion by removing them from the dialog via the extension.

  • Issue adding a new column to OBIEE presentation layer

    Hi,
    I am pretty new to OBIEE so this may be a silly question. I am facing some problems trying to add a new column from a physical table the OBIEE presentation layer.
    Below are the steps I followed:
    Task: add a product category set to the presentation layer.
    Steps:
    1) First verified that the product category set is being populated in the W_PROD_CAT_DH table in the datawarehouse. this was done by running the following sql
    SELECT W_PROD_CAT_DH.TOP_LVL_PRODCAT_NAME
    FROM W_PROD_CAT_DH, W_INVENTORY_PRODUCT_D
    WHERE W_PROD_CAT_DH.integration_id = W_INVENTORY_PRODUCT_D.INV_PROD_CAT1
    This sql gave the right category value.
    2) created a "Alias" of the table W_PROD_CAT_DH in the OBIEE Admin tool physical layer. (done by right clicking W_PROD_CAT_DH >>New Object>> Alias)
    3) named the Alias of W_PROD_CAT_DH as "Dim_W_INV_MKT_CAT" and created a key of the alias named "integration id" on the column "integration_id"
    4) opened the pre-existing alias of W_INVENTORY_PRODUCT_D the alias was called "Dim_W_INVENTORY_PRODUCT_D" and added a key called "MKT_CAT" on the column "INV_PROD_CAT1" in this alias (Dim_W_INVENTORY_PRODUCT_D of the table W_INVENTORY_PRODUCT_D)
    5) in the alias of the "W_INVENTORY_PRODUCT_D" called "Dim_W_INVENTORY_PRODUCT_D" added a "Foreign Keys" the expression of the key is following: ("Oracle Data Warehouse"."Catalog"."dbo"."Dim_W_INV_MKT_CAT"."INTEGRATION_ID" = "Oracle Data Warehouse"."Catalog"."dbo"."Dim_W_INVENTORY_PRODUCT_D"."INV_PROD_CAT1")
    Logical layer
    6) Opened the existing logical folder called "Dim - Inventory Product" and clicked on "Sources" tab then double clicked the source "Dim_W_INVENTORY_PRODUCT_D" and added a new mapping under "Map to these tables" under "General" tab. The column that was added was the physical alias "Dim_W_INV_MKT_CAT"
    7) added a new column mapping to the same logical table source (Dim_W_Inventory_PRODUCT_D) this new mapping was a column from the alias "Dim_W_INV_MKT_CAT" (column name "TOP_LVL_PRODCAT_NAME")
    Presentation Layer
    8) dragged the newly added column (TOP_LVL_PRODCAT_NAME) from the logical layer "Dim - Inventory Product" to the presentation layer "Product" folder.
    ISSUE
    after adding everything and checking global consistency and save and checking-in my work when i login from the front end presentation services. I see the newly added column is showing under the "Product" folder. on dragging the column by itself to the Ad-Hoc analysis I can see the different values of the category. On adding a second column from the same logical folder (Dim - Inventory Product in logical layer) i still see the right product name and corresponding category. BUT when I drag any other column from any other folder (such as "Day" from "Time" or any fact values) the result does not fetch any data (message: The specified criteria didn't result in any data.)
    I am not sure if I am missing any step but I know I am mapping the new table alias to the inventory_product_d since i see right results on creating analysis of columns in those two folders. but no other folders give me any data.
    I also know that the logical folder "Dim - Inventory Product" is joined with other tables as I can see results when i do not add the newly added catagory column but other folder and other columns of "Dim - Inventory Product"
    I would really appreciate any insight to this very much. we are using OBIEE 11.1.1.6 with the Oracle 11.5.10 Adaptor (SDE_ORA11510_Adopter)
    I will try to upload some screenshots if needed but presently not sure if its something really simple.

    Hi Prassu,
    thanks for the responce. and Apologies for the delay in getting back to you.
    1) 1.First of all set the logging level to 3 in the admin tool save it.
    You can get the SQL query from here
    settings(Answers right top)-->Administration-->manage sessions-->view log
    When I try to do this I get the following message. and no log files.
    Error
         Log Could Not Be Retrieved
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <3790667783>: Syntax error [nQSError: 26012] . (HY000)

  • Adding a new schedule line for a line item using bapi_po_change

    hi experts,
    can i know how to add a new schedule line for a line item using<u> bapi_po_change</u>. what are the parameters that need to be filed. i filled poitem with total quantities and poschedule table with 2 different schedule lines and passing as the parameter.but then i get the error saying item 0000 doesnt exist

    Hi,
    Please check if you have properly populated the following fields in POSCHEDULE:
    PO_ITEM
    SCHED_LINE
    and the other fields required for your schedule line such as delivery date and quantity, etc.
    After that, make sure to properly populate fields in POSCHEDULEX:
    PO_ITEM -> same value as found in POSCHEDULE
    SCHED_LINE -> same value as found in POSCHEDULE
    All other values populated in POSCHEDULE should be ticked as 'X' in POSCHEDULEX.
    Kind Regards,
    Darwin
    Kind Regards,
    Darwin

  • Adding a new Tab to an existing JTabbedPane not working

    Hello all,
    I am trying to add & display a new tab to an existing JTabbedPane when the user
    clicks on a button. For some reason the new tab, being added is not being displayed, and I don't know why. I have called invalidate(), validate() on the parent containers but haven't had any luck. I have also played around with SwingUtilities.invokeLater() and the Event thread, but have been unsuccessfull.
    Any help would be greatly appreciated.
          * This class is the parent that holds the internalFrame which is the
          * main parent for all subsequent containers
         public class QuoteRequestGUI implements QuoteRequestGUI_IF {
              protected JInternalFrame internalFrame_newQuoteRequest = new JInternalFrame("Quote Request");
              protected JTabbedPane tabbedPane = new JTabbedPane();
               * Create a new internal frame to which all the components of a new
               * QR will be added
              public JInternalFrame createNewQuoteRequestFrame() {
                   // Add a tabbed pane to the internal frame
                   internalFrame_newQuoteRequest.add(createQuoteRequestTabbedPane());
                   // .... Set various internalFrame properties
                   return internalFrame_newQuoteRequest;
              public JTabbedPane createQuoteRequestTabbedPane() {
                   // Create a new quote request details instance
                   QuoteRequestDetailsGUI_IF quoteRequestDetailsGUI =
                        new QuoteRequestDetailsGUI(quoteRequestStatusPassed);
                   // Create a new tab that will host all details of the quote request     
                   tabbedPane.addTab("Quote Request Details",
                             quoteRequestDetailsGUI.createQuoteRequestDetailsPanel());
                   return tabbedPane;
         public class QuoteRequestDetailsGUI extends QuoteRequestGUI implements QuoteRequestDetailsGUI_IF {
              private ProductDetailsGUI_IF productDetailsGUI = new ProductDetailsGUI();
               * Panel that will act as a container for both quote request and buyer
               * details
              public JPanel createQuoteRequestDetailsPanel() {
                   // Panel that will contain quoteRequest, buyer and buttons
                   JPanel panel_quoteRequestDetails = new JPanel();
                   // Create an intermediate panel so that components can be layed out properly
                   JPanel panel_quoteRequestIntermediatePanel = new JPanel();
                   // Set layout manager for panel
                   panel_quoteRequestIntermediatePanel.setLayout(
                        new BoxLayout(panel_quoteRequestIntermediatePanel,BoxLayout.PAGE_AXIS));
                   // Add the buttons
                   panel_quoteRequestIntermediatePanel.add(createQuoteRequestDetailsButtons());
                   // Add the intermediate panel to the main panel
                   panel_quoteRequestDetails.add(panel_quoteRequestIntermediatePanel);
                   return panel_quoteRequestDetails;
               * Panel that will hold all the buttons for the quote request details tabbed panel
              public JPanel createQuoteRequestDetailsButtons() {
                   // Panel to act as a container for the buttons
                   JPanel panel_quoteRequestDetailsButtons = new JPanel();
                   // Create, register action listeners and add buttons to the panel
                   JButton button_saveTabbedPane = new JButton("Save");
                   button_saveTabbedPane.addActionListener(new ActionListener() {
                        public void actionPerformed (ActionEvent actionEvent) {
                               saveTabbedPaneListener();
                   panel_quoteRequestDetailsButtons.add(button_saveTabbedPane);
                   return panel_quoteRequestDetailsButtons;
               * Display the save (product details) tabbed pane
               * @todo - Implement the save tabbed pane selected method
              public void saveTabbedPaneListener() {
                        log.info("tab count before added : " + tabbedPane.getTabCount());
                        // The product details of a particular quote request
                        tabbedPane.addTab("Product Details",
                                  productDetailsGUI.createProductDetailsPanel());
                        log.info("tab count after added : " + tabbedPane.getTabCount());
                        tabbedPane.invalidate();
                        tabbedPane.validate();
                        internalFrame_newQuoteRequest.revalidate();
         public class ProductDetailsGUI implements ProductDetailsGUI_IF {
               * Panel that will act as a container for both the product details (incl
               * table) and the buttons
              public JPanel createProductDetailsPanel() {
                   // Main product details panel
                   JPanel panel_productDetails = new JPanel();
                   // Add the scroll pane to the panel
                   panel_productDetails.add(new JButton("ok"));
                   // Add the buttons to the panel
                   // Add the scroll pane to the panel
                   panel_productDetails.add(new JButton("cancel"));
                   return panel_productDetails;
         }

    MS,
    Try copying one existing TAB and use that, this happens only when there is improper xml content. You can open the xml in the browser/visual studio for better clarity and then try making the changes. Doing IIS Reset will be required but in the meanwhile you
    can put the original RCDC which will work till the time you make any change in new TAB.
    Regards,
    Manuj Khurana

  • Problem while adding a new dimension in a existing cube with data in BW3.5

    Hi,
    We are trying to create a new dimension with new characteristics in a existing cube. But while activating we are getting error that "InfoCube contains data; intentional changes not permitted". Can we add a new dimension in a existing cube with data in BW3.5? If it is not possible then we can take the backup and delete the data from cube and then change the cube. But my question is that, when we will transport the cube with changes to quality then will it transport successfully or same procedure needs to be done there as well.
    Regards,
    Saikat

    hi,
    Adding new infoobject /dimension to the cube containing data in 3.5 is not possible.
    easier solution is create a new cube similar to old and add the new dimension and proceed.
    else you have to drop data and transport.
    Ramesh

  • Adding a new column to an existing database table

    How can I add a new column to an existing table (ex. dcs_product) and can anyone tell me the required configuration changes i may need to make.
    Thanks in advance!

    create/customize /atg/commerce/catalog/ProductCatalog.xml:
    <gsa-template>
    <item-descriptor name="product" xml-combine="append">
    <table name="my_dcs_product" type="auxilary" id-column-name="product_id">
    <property category-resource="categoryInfo" name="myDescription" column-name="myDescription" data-type="string"/>
    </table>
    </item-descriptor>
    </gsa-template>
    Hope it helps.
    -RMishra

  • Adding a new Tab to an existing RCDC

    I'm trying (and failing) to add a new tab to an existing RCDC.
    I've read several posts on this and I cannot figure out what I'm missing.
    I insert the following code in between 2 other groupings and every time I get the message "There is an error in the Group display configuration".
    <my:Grouping my:Name="NewTab" my:Caption="NewTab">
    <my:Control my:Name="NewTabText" my:TypeName="UocLabel" my:Caption="NewTabText">
    <my:Properties>
    <my:Property my:Name="Text" my:Value="!!!" />
    </my:Properties>
    </my:Control>
    </my:Grouping>
    I've tried this code and mild variations of this code on several RCDCs and I always get a negative result. 
    Any help, thoughts appreciated.  If I do another iisreset today I might explode.
    Thanks

    MS,
    Try copying one existing TAB and use that, this happens only when there is improper xml content. You can open the xml in the browser/visual studio for better clarity and then try making the changes. Doing IIS Reset will be required but in the meanwhile you
    can put the original RCDC which will work till the time you make any change in new TAB.
    Regards,
    Manuj Khurana

  • Where is the 17" MBP in the new product line?

    I hope that Apple plans on making a 17" MBP with the new features, including the screen and thinner and lighter like the other sizes. Otherwise that will just suck!
    15.4" is nice, but 17" screen is just that much better. With the higher resolution, it would be awesome.

    The death of the 17inch form factor is not a good thing. I mean who cares about having high resolution if in order to read the text you need a magnifying glass because the screen is so much smaller. This will have such a crippling effect on me that not only will I have to look to a PC solution I also have to give up my my Apple Pro Apps like 'Final Cut Studio'.
    The 17inch was the perfect pro level note book for running edit software and taking on location for downloading footage directly into the system via the express card slot. It was big enough to work off without the need to carry around an additional screen.
    The 15 inch is just not useable without carrying a plethora of external accessories and even then working your with a smaller screen so not as much real estate. If I want to adjust the screen settings so I do have the same amount of real estate i can add the magnifying glass to the kit. Also no audio jack in. I guess you could take audio in via USB but only 2 ports by god what a laugh and what the **** is with no ethernet port Bwahahaha. surly they could have fit one of those in. I mean at present it's the fastest most stable means of connecting and now we're asked to buy a peripheral to make it happen. what a joke.
    It's a real shame and i am extremely saddened by this move. In some small way i am still praying that a 17 inch will be released later down the line because i've been using the MBP since it was released and updated it every 2 years but I won't be buying a 15" as it just doesn't suit my needs. Also no update to the Mac Pro's in years and the fact that I will have to give up Apple Pro apps for AVID  as a result of this means I will be retiring most of my Apple machines. I guess Apple just no longer has an interest in the pro market so as far as i'm concerned, "so long Apple it's been nice knowing you"

  • I just added a new BYOD line. Why don't I get the BYOD discount?

    So I've read that once your contract expires and you are put on month-to-month, you can get a $25 line access discount. But what if you just add a line with your own device and go month-to-month from the beginning? I do not see an option for this discount and I am paying $40/month for a device that I brought over without any subsidy or anything...

    I called and the rep said that the promotion takes 2-3 billing cycles to appear. But it also seemed like he didn't really know and was just trying to placate me.. is this the norm? For it to take 2-3 billing cycles for a promotion to appear? I just feel like by March I'll still see no promo and there will be no record of me even requesting the promo....

  • Adding a new Field to an existing report

    Hi all,
    Can anybody tell me, how to add an extra field in existing
    report, without changing the basic calulation, which i made
    in the same report.
    Regards
    Hema

    okay... that is not a standard program.
    sombody developed it.following is my existing code, here in last column i want to add BOM(mast-stlnr) and Component(stpo-idnrk). remaining things are okay.
    REPORT ZPOTREND NO STANDARD PAGE HEADING
                      LINE-SIZE 195
                      LINE-COUNT 60(3)
                      MESSAGE-ID Z1.
    TABLES: EKBE,
            MARA,
            TCURR.
    SELECT-OPTIONS: S_GJAHR FOR EKBE-GJAHR,
                    S_BUDAT FOR EKBE-BUDAT DEFAULT SY-DATUM NO-EXTENSION,
                    S_MATNR FOR EKBE-MATNR,
                    S_WERKS FOR EKBE-WERKS DEFAULT 'CE',
                    S_MTART FOR MARA-MTART.
    PARAMETERS: X_APP_L TYPE P DECIMALS 2 NO-DISPLAY,
                X_APP_H TYPE P DECIMALS 2 NO-DISPLAY,
                X_DTL   AS CHECKBOX.
    DATA: BEGIN OF I_EKBE OCCURS 0,
          BUDAT LIKE EKBE-BUDAT,
          MENGE LIKE EKBE-MENGE,
          DMBTR LIKE EKBE-DMBTR,
          SHKZG LIKE EKBE-SHKZG,
          EBELN LIKE EKBE-EBELN,
          MATNR LIKE EKBE-MATNR,
          WERKS LIKE EKBE-WERKS,
          MTART LIKE MARA-MTART,
          MEINS LIKE MARA-MEINS,
    END OF I_EKBE.
    DATA: P_EBELN LIKE EKBE-EBELN,
          P_MATNR LIKE EKBE-MATNR,
          P_WERKS LIKE EKBE-WERKS,
          P_MTART LIKE MARA-MTART,
          P_MEINS LIKE MARA-MEINS.
    DATA: BEGIN OF YMTH OCCURS 10,
          YYMM(6),
          MTH(3),
          COL TYPE I,
          MENGE LIKE EKBE-MENGE,
          DMBTR LIKE EKBE-DMBTR,
    END OF YMTH.
    DATA: S_YMTH LIKE YMTH OCCURS 10 WITH HEADER LINE.
    DATA: W_YMTH LIKE YMTH OCCURS 10 WITH HEADER LINE.
    DATA: G_YMTH LIKE YMTH OCCURS 10 WITH HEADER LINE.
    DATA: S_FLAG.                                               "MTART FLAG
    DATA: BEGIN OF CDATE,
          YYMM(6),
          DD(2) VALUE '01',
    END OF CDATE.
    DATA: SDATE LIKE SY-DATUM.
    DATA: CMTH(6),
          PMTH(6),
          LMTH1(6),
          LMTH2(6),
          MTH(2).
    DATA: W_MENGE LIKE EKBE-MENGE,
          W_DMBTR LIKE EKBE-DMBTR,
          W_MENGE1 LIKE EKBE-MENGE,
          W_DMBTR1 LIKE EKBE-DMBTR,
          W_TOTAL TYPE P DECIMALS 2,
          W_COL TYPE I,
          WTEXT(18),
          APP TYPE P DECIMALS 4,
          APP1 TYPE P DECIMALS 4,
          APP2 TYPE P DECIMALS 4.
    PERFORM GET_YMTH.
    SELECT P~BUDAT P~MENGE P~DMBTR P~SHKZG P~EBELN P~MATNR P~WERKS
           Q~MTART Q~MEINS
           INTO TABLE I_EKBE
             FROM EKBE AS P INNER JOIN MARA AS Q
           ON P~MATNR = Q~MATNR
           WHERE P~GJAHR IN S_GJAHR
             AND P~BUDAT IN S_BUDAT
             AND P~MATNR IN S_MATNR
             AND P~WERKS IN S_WERKS
             AND P~BEWTP = 'E'
             AND Q~MTART IN S_MTART.
    FORMAT INTENSIFIED OFF.
    IF X_DTL <> 'X'.
       LOOP AT I_EKBE.
          I_EKBE-EBELN = SPACE.
          MODIFY I_EKBE.
       ENDLOOP.
    ENDIF.
    SORT I_EKBE BY WERKS MTART MATNR EBELN BUDAT.
    LOOP AT I_EKBE.
      CMTH = I_EKBE-BUDAT(6).
      IF P_WERKS IS INITIAL.
        P_WERKS = I_EKBE-WERKS.
        P_MTART = I_EKBE-MTART.
        P_MATNR = I_EKBE-MATNR.
        P_EBELN = I_EKBE-EBELN.
        P_MEINS = I_EKBE-MEINS.
        PMTH = CMTH.
      ENDIF.
      IF P_WERKS NE I_EKBE-WERKS.
        PERFORM CHG_MTH.
        PERFORM CHG_MATNR.
        PERFORM CHG_MTART.
        PERFORM CHG_WERKS.
      ENDIF.
      IF P_MTART NE I_EKBE-MTART.
        PERFORM CHG_MTH.
        PERFORM CHG_MATNR.
        PERFORM CHG_MTART.
      ENDIF.
      IF P_MATNR NE I_EKBE-MATNR.
        PERFORM CHG_MTH.
        PERFORM CHG_MATNR.
      ENDIF.
      IF P_EBELN NE I_EKBE-EBELN.
        PERFORM CHG_MTH.
        PERFORM CHG_MATNR.
      ENDIF.
      IF PMTH NE CMTH.
        PERFORM CHG_MTH.
      ENDIF.
      IF I_EKBE-SHKZG = 'H'.
        I_EKBE-MENGE = I_EKBE-MENGE * -1.
        I_EKBE-DMBTR = I_EKBE-DMBTR * -1.
      ENDIF.
      IF I_EKBE-DMBTR NE 0.
        W_MENGE = W_MENGE + I_EKBE-MENGE.
        W_DMBTR = W_DMBTR + I_EKBE-DMBTR.
      ENDIF.
    ENDLOOP.
    PERFORM CHG_MTH.
    PERFORM CHG_MATNR.
    PERFORM CHG_MTART.
    PERFORM CHG_WERKS.
    TOP-OF-PAGE.
      WRITE:/ SY-DATUM,SY-UZEIT,
              77 'A M T E K   E N G I N E E R I N G   L T D',
              180 'Page', (4) SY-PAGNO.
      WRITE: / SY-REPID,
              77 '     Purchase Price Trending Report      ',
              180 SY-UNAME.
      write: /78 'From Date', S_BUDAT-LOW, 'To Date', S_BUDAT-HIGH.
      SKIP.
      WRITE: / 'SBU :', I_EKBE-WERKS,
               '     Material Type :', I_EKBE-MTART.
      SKIP.
      READ TABLE YMTH WITH KEY YYMM = '999901'.
      IF SY-SUBRC EQ 0.
        WRITE AT YMTH-COL ' APP Change'.
      ENDIF.
      WRITE: /01 'Part No',
              19 'PO No',
              31 'Curr'.
      LOOP AT YMTH.
        YMTH-COL = YMTH-COL + 3.
        IF YMTH-YYMM NE '999901'.
          WRITE AT YMTH-COL YMTH-YYMM(4).
          WRITE YMTH-MTH.
        ELSE.
          WRITE AT YMTH-COL '       %'.
        ENDIF.
      ENDLOOP.
      ULINE.
    *&      Form  get_ymth
          text
    -->  p1        text
    <--  p2        text
    FORM GET_YMTH.
      CMTH = S_BUDAT-HIGH(6).
      PMTH = S_BUDAT-LOW(6).
      IF S_BUDAT-HIGH IS INITIAL.
        CMTH = PMTH.
      ELSEIF S_BUDAT-LOW IS INITIAL.
        PMTH = CMTH.
      ENDIF.
      LMTH1 = CMTH.
      CDATE-YYMM = CMTH.
      SDATE = CDATE.
      SDATE = SDATE - 1.
      LMTH2 = SDATE(6).
      WHILE PMTH <= CMTH.
        MTH = CMTH+4(2).
        CDATE-YYMM = CMTH.
        YMTH-YYMM = CMTH.
        PERFORM GET_MTH.
        APPEND YMTH.
        SDATE = CDATE.
        SDATE = SDATE - 1.
        CMTH = sdate(6).
      ENDWHILE.
      YMTH-YYMM = '999901'.
      YMTH-MTH = ' % '.
      APPEND YMTH.
      SORT YMTH BY YYMM.
      W_COL = 21.
      LOOP AT YMTH.
        W_COL = W_COL + 15.
        YMTH-COL = W_COL.
        MODIFY YMTH.
      ENDLOOP.
      APPEND LINES OF YMTH TO S_YMTH.
      APPEND LINES OF YMTH TO W_YMTH.
      APPEND LINES OF YMTH TO G_YMTH.
      REFRESH YMTH.
      APPEND LINES OF S_YMTH TO YMTH.
    ENDFORM.                                                    " get_ymth
    *&      Form  get_mth
          text
    -->  p1        text
    <--  p2        text
    FORM GET_MTH.
      CASE MTH.
        WHEN '01'.
          YMTH-MTH = 'Jan'.
        WHEN '02'.
          YMTH-MTH = 'Feb'.
        WHEN '03'.
          YMTH-MTH = 'Mar'.
        WHEN '04'.
          YMTH-MTH = 'Apr'.
        WHEN '05'.
          YMTH-MTH = 'May'.
        WHEN '06'.
          YMTH-MTH = 'Jun'.
        WHEN '07'.
          YMTH-MTH = 'Jul'.
        WHEN '08'.
          YMTH-MTH = 'Aug'.
        WHEN '09'.
          YMTH-MTH = 'Sep'.
        WHEN '10'.
          YMTH-MTH = 'Oct'.
        WHEN '11'.
          YMTH-MTH = 'Nov'.
        WHEN '12'.
          YMTH-MTH = 'Dec'.
      ENDCASE.
    ENDFORM.                                                    " get_mth
    *&      Form  chg_matnr
          text
    -->  p1        text
    <--  p2        text
    FORM CHG_MATNR.
      CLEAR W_TOTAL.
      LOOP AT YMTH.
        W_TOTAL = W_TOTAL + YMTH-DMBTR.
      ENDLOOP.
      IF W_TOTAL = 0.
        EXIT.
      ENDIF.
      CLEAR: W_DMBTR, W_MENGE, W_DMBTR1, W_MENGE1, APP, APP1, APP2.
      READ TABLE YMTH WITH KEY YYMM = LMTH2.
      IF SY-SUBRC EQ 0 AND
         YMTH-MENGE NE 0.
        W_DMBTR = YMTH-DMBTR.
        W_MENGE = YMTH-MENGE.
        READ TABLE YMTH WITH KEY YYMM = LMTH1.
        IF SY-SUBRC EQ 0.
          APP = W_DMBTR / W_MENGE.
          APP1 = YMTH-DMBTR / YMTH-MENGE.
          APP2 = ( APP1 - APP ) / APP * 100.
        ENDIF.
      ENDIF.
      IF X_APP_L IS INITIAL AND
         X_APP_H IS INITIAL.
      ELSE.
        IF APP2 < X_APP_L OR
           APP2 > X_APP_H.
          EXIT.
          CLEAR: W_DMBTR, W_MENGE, APP.
          P_MATNR = I_EKBE-MATNR.
          P_EBELN = I_EKBE-EBELN.
          PERFORM CLR_YMTH.
        ENDIF.
      ENDIF.
      SKIP.
    WRITE:/ P_MATNR, ' Amount  ',
             'USD'.
    LOOP AT YMTH.
       WRITE AT YMTH-COL(12) YMTH-DMBTR NO-ZERO.
    ENDLOOP.
    WRITE:/(18) ' ', ' Quantity',
            P_MEINS.
    LOOP AT YMTH.
       WRITE AT YMTH-COL(12) YMTH-MENGE NO-ZERO.
    ENDLOOP.
      WRITE:/ P_MATNR(18), P_EBELN, 'USD' UNDER 'Curr'.
      LOOP AT YMTH.
        IF YMTH-YYMM NE '999901'.
          CLEAR APP.
          IF Ymth-menge ne 0.
            APP = YMTH-DMBTR / YMTH-MENGE.
          ENDIF.
          WRITE AT YMTH-COL(12) APP.
          READ TABLE S_YMTH WITH KEY YYMM = YMTH-YYMM.
          IF SY-SUBRC EQ 0.
            S_YMTH-MENGE = S_YMTH-MENGE + YMTH-MENGE.
            S_YMTH-DMBTR = S_YMTH-DMBTR + YMTH-DMBTR.
            MODIFY S_YMTH INDEX SY-TABIX.
          ENDIF.
          READ TABLE W_YMTH WITH KEY YYMM = YMTH-YYMM.
          IF SY-SUBRC EQ 0.
            W_YMTH-MENGE = W_YMTH-MENGE + YMTH-MENGE.
            W_YMTH-DMBTR = W_YMTH-DMBTR + YMTH-DMBTR.
            MODIFY W_YMTH INDEX SY-TABIX.
          ENDIF.
        ELSE.
          WRITE AT YMTH-COL(12) APP2.
        ENDIF.
      ENDLOOP.
      CLEAR: W_DMBTR, W_MENGE, APP.
      P_MATNR = I_EKBE-MATNR.
      P_EBELN = I_EKBE-EBELN.
      PERFORM CLR_YMTH.
    ENDFORM.                                                    " chg_matnr
    *&      Form  chg_mtart
          text
    -->  p1        text
    <--  p2        text
    FORM CHG_MTART.
      SKIP.
      ULINE.
      CONCATENATE P_MTART 'Total' INTO WTEXT SEPARATED BY SPACE.
      PERFORM PRN_TOT TABLES S_YMTH.
      P_MTART = I_EKBE-MTART.
      LOOP AT S_YMTH.
        CLEAR: S_YMTH-DMBTR, S_YMTH-MENGE.
        MODIFY S_YMTH.
      ENDLOOP.
    ENDFORM.                                                    " chg_mtart
    *&      Form  chg_werks
          text
    -->  p1        text
    <--  p2        text
    FORM CHG_WERKS.
      CONCATENATE P_WERKS 'Total' INTO WTEXT SEPARATED BY SPACE.
      PERFORM PRN_TOT TABLES W_YMTH.
      CLEAR: W_DMBTR, W_MENGE, APP.
      P_WERKS = I_EKBE-WERKS.
      LOOP AT W_YMTH.
        CLEAR: W_YMTH-DMBTR, W_YMTH-MENGE.
        MODIFY W_YMTH.
      ENDLOOP.
      NEW-PAGE.
    ENDFORM.                                                    " chg_werks
    *&      Form  chg_mth
          text
    -->  p1        text
    <--  p2        text
    FORM CHG_MTH.
      READ TABLE YMTH WITH KEY YYMM = PMTH.
      IF SY-SUBRC EQ 0.
        YMTH-MENGE = W_MENGE.
        YMTH-DMBTR = W_DMBTR.
        MODIFY YMTH INDEX SY-TABIX.
      ENDIF.
      CLEAR: W_MENGE, W_DMBTR.
      PMTH = CMTH.
    ENDFORM.                                                    " chg_mth
    *&      Form  clr_ymth
          text
    -->  p1        text
    <--  p2        text
    FORM CLR_YMTH.
      LOOP AT YMTH.
        CLEAR: YMTH-DMBTR, YMTH-MENGE.
        MODIFY YMTH.
      ENDLOOP.
    ENDFORM.                                                    " clr_ymth
    *&      Form  prn_tot
          text
    -->  p1        text
    <--  p2        text
    FORM PRN_TOT TABLES I_YMTH STRUCTURE YMTH.
      CLEAR: W_DMBTR, W_MENGE, W_DMBTR1, W_MENGE1, APP, APP1, APP2.
      READ TABLE I_YMTH WITH KEY YYMM = LMTH2.
      IF SY-SUBRC EQ 0 AND
         I_YMTH-MENGE NE 0.
        W_DMBTR = I_YMTH-DMBTR.
        W_MENGE = I_YMTH-MENGE.
        READ TABLE I_YMTH WITH KEY YYMM = LMTH1.
        IF SY-SUBRC EQ 0.
          APP  = W_DMBTR / W_MENGE.
          APP1 = I_YMTH-DMBTR / I_YMTH-MENGE.
          APP2 = ( APP1 - APP ) / APP * 100.
        ENDIF.
      ENDIF.
    WRITE:/ WTEXT, ' Amount  ',
             'USD'.
      LOOP AT I_YMTH.
        SELECT SINGLE * FROM TCURR
          WHERE FCURR = 'SGD'
          AND   TCURR = 'USD'.
          I_YMTH-DMBTR = I_YMTH-DMBTR * TCURR-UKURS.
       WRITE AT I_YMTH-COL(12) I_YMTH-DMBTR NO-ZERO.
      ENDLOOP.
    WRITE:/(18) ' ', ' Quantity'.
    LOOP AT I_YMTH.
       WRITE AT I_YMTH-COL(12) I_YMTH-MENGE NO-ZERO.
    ENDLOOP.
      WRITE:/(18) ' ', ' APP     ', 'USD'.
      LOOP AT I_YMTH.
        IF I_YMTH-YYMM NE '999901'.
          CLEAR APP.
          IF I_YMTH-MENGE NE 0.
            APP = I_YMTH-DMBTR / I_YMTH-MENGE.
          ENDIF.
          WRITE AT I_YMTH-COL(12) APP.
        ELSE.
          WRITE AT I_YMTH-COL(12) APP2.
        ENDIF.
      ENDLOOP.
      ULINE.
      CLEAR: W_DMBTR, W_MENGE, APP.
    ENDFORM.                    " prn_tot

  • Adding a new field to an existing BDoc.

    I posted this message in other forum, but I think the correct one is this.
    I need to add a new field to bdoc BUS_TRANSACTION_MESSAGE, so I've added a field to structure BAD_BUS_TRANSN_MESSAGE, to the substructure PRODUCT_I.
    What I need to know is how to give value to this field.
    Thank you in advance.

    The below page from the SAP Online help should direct you.
    http://help.sap.com/saphelp_crm50/helpdata/en/25/dd90dac2584cdda1d00200b41c03a5/frameset.htm
    Regards,
    Gervase

Maybe you are looking for

  • Copy_report_object_output does not work

    report is running fine on the server and I can see the output pdf file. for some reason, the copy_report_object_output failing to copy the output file to local machine. here is my code: If rep_status = 'FINISHED' Then message('Report Completed'); cop

  • I cant download itunes 7?

    i used to have the old ipod nano and with that the old itunes. now, i have recently purchased the new ipod nano and have tryed downloading the the required itunes 7 but the operation keeps failing. when i download it this message comes up: this insta

  • Storing expense report creation date and showing in PDF document

    Hi, We have implemented ESS buisness package 1.0. In travel and expense.. travel expense PDF form is generated..which is PDF form from ECC..form name is PTRV_EXPENSE_FORM.. i want to modify this...this form should store the day  when the expense repo

  • Keyboard character setup

    I have the short version of the wireless keyboard and works great except for a few characters that don't corresponde like for instance I have to punch Shift equal and zero to close parenthesis. How do I set up this?

  • RMAN-06094: datafile 1 must be restored

    Hello, in standby database, using RMAN RMAN> recover database noredo; Starting recover at 11-DEC-12 allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=4353 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.