How to Verify the Variable Input in Customer EXIT

Hi,
      I have a requirement to find out "Estimated Hours Total Calculation" with User input date range. I know little bit knowledge about Customer Exits please some one give me how to write code in CMOD. I have requirement how to get the Extimated Hours Total Calculation is follows ....
        Actual hours are the Hour Meter Reading used by the truck, it's calculated based on the "from and to" date parameters.       
Collect the initial hours and adjusted hours from EM.       
Get the PMN and Service Order data close to or within the Date Range.     
1) If the Fleet Management Date (Start-up Date on EM) started before the input date Date Range (From-Date), calculate the average usage (in hours) based on the initial hours and the first PMN (or SO) falls within the Date Range to estimate the hour usage at start of Date Range. 
2) If the Fleet Management Date started after the From-Date, use the Hour Meter (EM) as the Estimated Hours Begin. 
3)If the last PMN (or SO) fell short of the Date Range (To-Date), obtain the Estimated Hours End by applying the average usage to fill the time-gap.       
4)If the last PMN (or SO) fell after the Date Range (To-Date), get the Estimated Hours End by getting the next to last PMN performed inside the window parameter,           
     calculate the average usage between the two PMN's (or SO's) then apply the weighted average to fill the time-gap.       
Adjusted Hours, if not zero or null, needs to be added to the Ending Hours to achieve the real number. 
For Example
User Input Date Range:  Jan. 1, 2006 - Dec. 31, 2006          
Initial Hour (Equipment Master):  10          
Adjusted Hours (Equipment Master): 0          
Fleet Management Date (Equipment Master):  Dec. 1, 2005          
1st PM Notification (Feb. 1, 2006):  410          
Last PM Notification (Feb. 1, 2007):  2810          
Second to last PMN (Dec. 1, 2006):  2410          
     Equipment was put into service (12/1/05) before the Date Range, needs to find the Estimated Hours Begin.     
     The first PM was performed (2/1/06) exactly two months from in-service date (12/1/05).
     Average monthly usuage from first PMN = (410 - 10) / 2 = 200
     Estimated Hours Begin = 200 + 10 = 210 (estimated Hour Meter Reading on Jan. 1, 2006)
     Average monthly usuage from the last 2 PMN = (2810 - 2410) / 2 months = 200
     Estimated Hours End = 2410 + 200 + 0 (adjusted hours) = 2610 (estimated Hour Meter Reading on Dec. 31, 2006)
     Estimated Hours Total = 2610 - 210 = 2400
           Please give me your valuable answers. Please let me know if you need any further information.
Thanks
Dave Sam.

hi,
well, your requirement seems clear but complex and needs more clarification:
- what kind of infoprovider do you use
- what is posted in your provider, I mean which characteristics and and key figures (name and descriptions)
- what is the user input
depending on that, the implementation may vary
Please clarifiy
Olivier.

Similar Messages

  • How to display text variable of type customer exit

    Hi to all,
    I have created a query in query designer which display sales value according to plant.
    There i have also used a variable which will take input from user and restricted on 0CALDAY.
    I have also created 2 text variable to display the text for sales based on input in variable.
    I need when user enter the 01.02.2010 - 31.12.2010 value in variable , text variable should display SALES FROM 01.02.2010 TO 31.12.2010
    i knew how to do that by using text variable of processing type customer exit.
    But display of text variable is like SALES FROM 01022010 TO  31122010  ,
    But i need that SALES  01.02.2010 TO 31.12.2010
    i shall be thankfull to you for this.
    Regards
    Pavneet Rana
    Edited by: pavneet rana on Dec 22, 2010 7:46 AM
    Edited by: pavneet rana on Dec 22, 2010 8:03 AM

    Hi,
    Give Description on Sales Amount  as SALES FROM &ZVAR_YEAR1& TO &ZVAR_YEAR2&.
    ZVAR_YEAR1 & ZVAR_YEAR2 are the two text variables. These two variables should NOT be input enabled.
    In the Exit - under I_STEP = 2, write the below code.
    WHEN 'ZVAR_YEAR1'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-low.
      APPEND l_s_range to e_t_range.
    WHEN 'ZVAR_YEAR2'.
      DATA:   l_s_range       TYPE rs_s_range,
                   loc_var_range TYPE rrs0_s_var_range.
      READ TABLE i_t_var_range INTO loc_var_range WITH KEY vnam = 'ZVAR_INPUT_CALDAY'.
      l_s_range-sign = 'I'.
      l_s_range-opt  = 'EQ'.
      l_s_range-low  = loc_var_range-high.
      APPEND l_s_range to e_t_range.

  • Need clarification on BEX variable usage in customer exit.

    hi,
    i am an ABAP guy,i dont have any idea about BW,But here i got one problem,
    1)Variable has been craeted in BEX Report (processed by Customer exit).
    2)i am trying to write ABAP code in CMOD customer exit(ZXRSRU01),but when i am calling BEX variable it is not taking it is giving error(it should defined by data statment)so how to call the bex varible in Customer exit,if any body have sample code or any idea kindly let me know.

    Hi and welcome to SDN!
    there are a lot of examples and clarifications in these forums. For instance:
    Re: steps for a customer exit.
    Re: Regarding the Code for the Customer Exit
    Best regards,
    Eugene

  • How to change a Manual Input variable into a customer exit variable?

    Hello,
    I need to change the "processing by" option of an used BEx variable from "Manual Input" to "Customer Exit" but this field is not available (= in grey) in modification.
    Does it exist a tip or a standard program to modify this no-accessible field of an existing BEx variable?
    Thanks in advance for your answers,
    Samuel

    Hi,
    I don't think it's possible (unless tweaking some parameters directly in some tables, as stated in the previous post) so you would have to create a new one and replace it.
    Hope it helps,

  • How to capture user input for customer exit processing?

    I need to calculate the number of working days elapsed in the current fiscal quarter BASED on the USER INPUT on the reporting front.  i.e., say the fiscal quarter started on 1 July 2005 and if the user enters 10 July 2005, I should get the value 8 (Assume that Monday through Friday are all workdays).  If the user enters 12 July 2005, I should get 10.  I have written customer exits and know how to use factory calendar, but <b>THE CHALLENGE</b> is how do I <b>CAPTURE</b> the user input and use it in my exit?  During the varible definition, if I select the check box "Ready for input" then the customer exit is not being processed and unless I check that box I can't get a user entry!  If I look at the import values in the customer exit, I see i_t_var_range with type rrs0_t_var_range.  My strong feeling is that this parameter gets the user input, but I am unable to use it as the customer exit is not being called if I make the user to input the data.  Based on the empirical evidence, I felt that user input and customer exit can not co-exist!!  Please somebody prove me wrong and let me know how can I use the user input to process my "customer-exit" variable.  I would really appreciate any input from the BW community here.

    Hi Sameer,
    Most likely, I'm missing something, but I think that the answer is very simple.
    CASE I_VNAM.
    WHEN 'YOUR_CUSTOMER_EXIT_VAR'.
    IF I_STEP = 2. “ After selecting of input variable
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
    WHERE VNAM = 'USER_INPUT_VAR'.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    In this typical user exit coding you have a user entered value in LOC_VAR_RANGE (originally in I_T_VAR_RANGE) and you construct your user exit variable value in E_T_RANGE.
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to get the variable value in description if I am writing a condition

    I have created a query for TOP N Customers and
    and for N  I am passing as a varaible
    & I want the same value to be displayed in the description
    I tried a lot but I dont  know how to do it
    can any one tell me the solution for this
    Thx & regards

    Hi,
    You have to define a Text Variable of type customer exit and pass the value of the Variable you have created for the condition in the Exit Code.
    You have to use the correct I_Step = *.
    Cheers.
    Ranga.

  • Error in the ABAP Code for Customer Exit Variable

    Could you please update me what is the wrong with the below ABAP Code developed for Customer Exit Variable in BW
    i created a Variable (ZVWKNO) of Customer Exit,Single Value ,Mandatory and Variable is ready for input
    In CMOD i had written the below Code:
    When 'ZVWKNO'.
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    But when i execute the query the default value is not populated with Week-1 No in the variable screen
    Please update me what went wrong
    Thanks

    Case ZVWKNO.                "write this with out comments
    When '1'.              "write the value that needs to equal with value in varaible ZVWKNO after when in sungle quotes
    DATA: WEEK(2) TYPE N,
    WEEKNO(2) TYPE N.
    IF i_step = 1.
    l_st_date = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
    EXPORTING
    DATE = l_st_date
    IMPORTING
    WEEK = l_fn_week.
    CHECK sy-subrc = 0.
    WEEK = l_fn_week+4(2).
    If WEEK 0.                                    "check this Week Minimum is '01' and Maximum '52'
    WEEKNO = WEEK - 1.
    l_s_range-low = WEEKNO.
    l_s_range-sign = k_sign_inclusive.
    l_s_range-opt = k_option_equals.
    APPEND l_s_range to e_t_range.
    ENDIF.
    ENDIF.
    Prabhudas

  • Include character value variable processed by customer exit in the report

    I have defined a character value variable' processed by 'customer exit'. i am troubleshooting a problem so I need to see the value of this variable. Is there a way to display this variable in the report. If so, what section, rows or columns? And how to configure?
    Thanks,
    Sharon

    Hi,
    You can add directly the variable, in BEx Analyzer 7.0 you can add variables in the Excel Cell that you would.
    Steps:
    - Select the Excel Cell
    - In the BEx Design Toolbox, select Insert text
    - When you are in Design Mode - click over the text element
    - Go to Constants tab and select the Custom Exit Variable
    - Save the workwook
    Regards,
    Dani

  • How to set the table input in Query template?

    Hi all.
    I need to call a Bapi_objcl_change, with import parameter and a table as an input. I have done this, in BLS. I have set the table input in the
    form of xml. In BLS, I get the output(the value gets change in SAP R3, what i have given in BLS).  But if i set the same xml structure  in
    query template, I didn't get the output. Table input parameter does not take that xml source.  How to set the table input in Query template?
    can anyone help me?
    Regards,
    Hemalatha

    Hema,
    You probably need to XML encode the data so that it will pass properly and then xmldecode() it to set the BAPI input value.
    Sam

  • How to change the reconciliation account in customer master record?

    hi friends,
    i created customer master with wrong reconsiliation account in XD01. i failed when i am trying to change that reconsiliation account in XD02. it was suppressed. how to change the reconcilition account in customer master data?

    Hi,
    Go to this path: Spro>Financial Accounting>Account Receivable & Account Payable>Customer Accounts>Master Data>Preparations for Creating Customer Master Data>Define Account Groups with Screen Layout (Customers)
    Double Click on Your Group, Then Click on Company code Data under Field Status, Then Double click on Account Management, That screen you will find the Reconcilation Account, Select Requred Entry.
    now it will coming Customer master.
    It's useful assigne points as a way to say Thanks
    Regards
    gvr

  • How to use the variables used in the message mapping

    Hi ,
    In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
    I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
    Please guide me how to use the variables declared in the JAVA section in the message mapping .
    Thanks
    Anita Yadav

    Anita,
    I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
    If you declare a variable in the Declaration Section ,
    int i;
    then in any udf you can use if directly. No need to re declare  the variable in the UDF. If you do this, then it becomes a local variable.
    Regards,
    Bhavesh

  • *** How to get the username in a custom password change routine....

    How to get the username in a custom password change routine / procedure / form when a user's password has expired and is redirected automatically to this custom program?
    We use the 2nd parameter in LOGIN_URL column in WWSSO_LS_CONFIGURATION_INFO$ table to get to this custom change-password proc.

    OK !
    Use that maybe good :
    select USERID into v_user from sys.aud$
      where ntimestamp#=(
      select max(ntimestamp#)
      from sys.aud$ );

  • How to clear the variable value in session store?

    I'll try to build form for search. There are LOV and
    search button on form. When user don't select anything then push
    search button, I'd like the report to show query everything. I
    mean the report will show like condition where id like '%'.
    And I send variable between form to report by using session
    store.
    I select nothing in LOV but value that return by LOV is
    not null. It's in stead of old value of LOV.
    Please tell me.. How to clear the variable value in
    session store? I'd like to set it to null. If you have greater
    way to do like this, please tell me.
    Thank you.

    Please suggest on this..
    Thanks.

  • How to set the status for a customer plan to RELEASED.

    Hello all,
    I created a program for mass creation of customer plans. But after the creation of a plan, the status should be set to released, so that the user can go about creating the trade promotions for the customer plan. Can anybody tell me how to set the status of a customer plan to RELEASED.
    Thanks,
    Disha.

    Hi Clemens,
    I am not talking about doing it in the CRM_UI transaction..I created a program..which would create the customer plans based on the planning account data provided. I was succesfull in creating the plans, but I am not knowing how to release it, if only anybody can tell me about a Function module or method, which can help me do this, that would be great
    Thanks,
    Disha.

  • How to display the variable content in message?

    Hi anybody
    please let me know How to display the variable content in message?
    please send few lines of sample code to understand that
    thanks in advance

    Hi,
    Check out the link
    http://help.sap.com/saphelp_nw70/helpdata/en/2c/840b42202cce6ce10000000a155106/content.htm
    REPORT Y9020027 LINE-SIZE 130.    "Release 3.1G, 4.5A                  
    BREAK-POINT.
    MOVE: 'TESTREPORT for    "ASSIGN  FFeld+o(l)  TO  "        '     
            TO SY-TITLE.
          Declaration of variables    **********************
    FIELD-SYMBOLS <FS1>.
    DATA: FFELD8(8)   TYPE F VALUE '1022333'.   "Unusual: Explicit 8 bytes
    *DATA: ZFELD1(2)    TYPE N.            "Here slack bytes are (DW border)
                                         "necessary                      
                  "If you like computing error, please uncomment the above
    DATA: FFELDX(8)   TYPE F VALUE '7777777'.
    DATA: FFELDA(8)   TYPE F VALUE '7333213'.
    DATA: NFELDX(400) TYPE N.
    DATA: OFFX(4) TYPE I VALUE 160.
    DATA: LENX(4) TYPE I VALUE 8.
                  Main Section             *******************
        SKIP.
        WRITE: /5  'Example 1   **** inadmissible ASSIGN ***' COLOR 6.
        WRITE: /10 'Inadmissible ASSIGN: ''ASSIGN FFELD4+1(3) TO <FS1>'' '.
      ASSIGN FFELD4+1(3) TO <FS1>.
        ULINE.
        SKIP 2.
        SKIP.
    ASSIGN FFELD8+8(8) TO <FS1>.     "<-- Assigning of variable  FFELDX  !!
        BREAK-POINT.
        WRITE: / 'ASSIGN command with FFELD8, but FFELDX will be assigned'
                  COLOR 3.
        WRITE: /5 'Example 2'.
        PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
        WRITE: /10 'Content of   FFELDX      :', FFELDX.
        ULINE. SKIP 2.
        SKIP.
    ASSIGN FFELD8+16(8) TO <FS1>.    "<-- Assiging a few FFELDA to <FS1>  
        BREAK-POINT.
        WRITE: / 'ASSIGN with FFELD8, but instead FFELDA is assigned'
                  COLOR 3.
        WRITE: /5 'Example 3'.
        WRITE: /10 'Content of   FFELDA      :', FFELDA.
        PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
        WRITE: /10 'Content of   FFELDA      :', FFELDA.
        ULINE. SKIP 2.
    BREAK-POINT.
       DO 4 TIMES.
         ASSIGN FFELD8+OFFX(LENX) TO <FS1>.     "Zuordnung auf OFFX zu <FS1>
            WRITE: / 'ASSIGN command with FFELD8, es wird NFELDX zugeordnet'
                      COLOR 5.
             WRITE: /5 'Example 4', 'DO-Schleife Nr.:', SY-INDEX.
             PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
             WRITE: /10 'Content of NFELDX145(40)  :', NFELDX145(40).
             ULINE. SKIP 2.
             ADD 8 TO OFFX.
       ENDDO.
                   Subroutines             *******************
               Display of data fields and field symbols                  *
    FORM DISPLAY-FFELD USING FFELD FNAME.
    WRITE: /10 'Content of', FNAME, ':', FFELD.
    PERFORM FELDEIGENSCHAFTEN USING FFELD.
    WRITE: /10 'Content of <FS1> :', <FS1>.
    PERFORM FELDEIGENSCHAFTEN USING <FS1>.
    ADD   111    TO <FS1>.               "<-- Das Feldsybmol wird verwendet
    WRITE: /10 'ADD 111 TO <FS1>'.
    ULINE.
    WRITE: /10 'Content of', FNAME, 35 ':', FFELD.
    WRITE: /10 'Content of <FS1>',  35 ':', <FS1>.
    ENDFORM.
       Determination of field properties (only for information)          *
    FORM FELDEIGENSCHAFTEN USING ALLG.
    DATA: FLAENGE(2) TYPE N.
    DATA: FTYP(1) TYPE C.
    DATA: FOUT(2) TYPE N.
    DATA: FDEZ(2) TYPE N.
      ULINE.
      DESCRIBE FIELD ALLG LENGTH FLAENGE.
      WRITE: /10 'Field length  :', FLAENGE.
      DESCRIBE FIELD ALLG TYPE FTYP.
      WRITE: /10 'Field type    :', FTYP.
      DESCRIBE FIELD ALLG OUTPUT-LENGTH FOUT.
      WRITE: /10 'Output length :', FOUT.
      DESCRIBE FIELD ALLG DECIMALS FDEZ.
      WRITE: /10 'Decimals      :', FDEZ.
      SKIP 1.
    ENDFORM.
    END OF PROGRAM *************************************

Maybe you are looking for

  • Difference Between Shutdown and Close Database

    Hi all, Let say I want to start the instance of database with the following processes : 1. STARTUP MOUNT 2. ALTER DATABASE OPEN With two commands above, now the database is open. Then, I want to close the database with command : 3. ALTER DATABASE CLO

  • Unboxing MSI Z97 Mpower Max AC Overclocking Motherboard

    Intel Z97 chipset based motherboards is already out and I’m glad that Intel decided it to make the CPU socket the same LGA 1150 as before. Backward compatibility for the current CPUs and at the same time will have support for the upcoming Haswell Ref

  • Prob in printing cheque

    hello all, I hav problem when I am printing a chq.In sapscript,I hav created 3 pages :first,next,page1.When I execute The program then Itgives two cheq for one vendor becauz line item is geater then main window. I applied one method i.e when I put lo

  • Image Maps

    Is there any way to edit the html so that within the same file, instead of hotspots linking to new pages, you can just use them for behavioural edits. What I want to do is use the hotspots in connection with rollovers so that different layers appear

  • I can`t active my  unlocked factory (UF)  Iphone4

    In the first,my friend bought me an IPHONE4 from UK apple store. And it`s unlocked (sim free). The problem happened whene I tried to active it. Itunes say the sim you insert,,,is not supported?? So the question :- Is there another problem that may oc