Current and Last PO Calculation

Hello All,
0PUR_C01 is my InfoProvider. I also have data in 0PUR_O01, which is an DSO.
I need to build a report giving Current and Last PO details for a Material (independent of vendor).
The user will input only single date. The system should check which is the latest and latest-1 PO using that input date.
I am looking for a customer exit which can solve this.
Thanks,
Mainak

Hi Mainak,
I do not have the exact code as per your requirements.This is sample code for Quantity field with the document date field ( date should be restricted between system date and system date+112 days).
WHEN 'ZPRDATE1'.
IF i_step = 2.
READ TABLE I_T_VAR_RANGE INTO LOC_VAR_RANGE
WITH KEY VNAM = 'ZPRDATE'.
v_date1 = LOC_VAR_RANGE-LOW.
ddate1 = sy-datum.
l_s_range-sign = 'I'.
*l_s_range-opt = 'EQ'.
l_s_range-opt = 'BT'.
l_s_range-low = ddate1.
l_s_range-high = sy-datum + 112. (Check syntax)
Append l_s_range to E_T_RANGE.
ENDIF.
If  your variable  want to be defined as "Ready for Input" ?
pls refer this.
The RSR00001 enhancement ("BW: Enhancements for global variables in reporting") is called repeatedly while the report is being executed. In this case, the I_STEP parameter specifies when the enhancement is being called.
The following values are valid for I_STEP:
I_STEP = 1
Call directly before the variable is entered
I_STEP = 2
Call directly after the variable is entered. This step is activated only if the same variable could not be filled for I_STEP = 1 and it is not ready for input.
I_STEP = 3
In this call, you can check the values of the variables. Activating an exception (RAISE) causes the variable screen to appear again. I_STEP = 2 is also then executed once more.
I_STEP = 0
The enhancement is not called from the variable screen. The call can come from the authorization check or from the monitor.
Source : Note 492504 - Dependent customer exit-type variables
I hope this might helps you a bit,
Regards
CSM Reddy

Similar Messages

  • Determining angle between current and last position; 2D

    Hi,
    I have a player on a JPanel from a bird's eye view. I have to determine the angle (0 - 360) of the player's move:
                          0 or 360
                             |
                             |
                             |
                             |
    270--------------------Player--------------------90
                             |
                             |
                             |
                             |
                            180The top of the JPanel corresponds to 0 or 360 degree, the right side to 90 degree etc.
    I have to determine the angle between the current and the last (x, y) coordinates of the player. The player is being moved by mouse clicks.
    I don't know where to start to implement this... and how I can calculate the angle between these 2 positions (which I store in an Ellipse2D ArrayList).
    Thanks for your help!

    Multiply them by -1. Do you understand how degrees
    work? Degrees go counterclockwise. So 0 degrees
    should be on the right, and 90 degrees should be
    straight up.Oh... I didn't know that degrees in Java go counterclockwise and start on the right. Sorry. Is there a way to tell Java to start "at the top" and go clockwise? Or is the solution to change the formula? Thanks! :)

  • Rehire - Current and last employment

    I have a employee table like this
    Sample data
    WITH emp AS
    SELECT 1 PK_ID , '10' EMP_NO , TO_DATE('01-JAN-2012')  HIRE_DATE , TO_DATE('01-APR-2012')  LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 2 PK_ID , '10' EMP_NO , TO_DATE('01-JUN-2012')  HIRE_DATE , NULL LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 3 PK_ID , '20' EMP_NO , TO_DATE('01-FEB-2012')  HIRE_DATE , null LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 4 PK_ID , '30' EMP_NO , TO_DATE('01-AUG-2011')  HIRE_DATE , TO_DATE('01-SEP-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 5 PK_ID , '30' EMP_NO , TO_DATE('01-OCT-2011')  HIRE_DATE , TO_DATE('01-NOV-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 6 PK_ID , '30' EMP_NO , TO_DATE('01-DEC-2011')  HIRE_DATE , NULL  LAST_WORKING_DATE FROM DUAL
    );I need a query to fetch the current and previous employement only if the employee is rehired. Current Employment can be identified if last_working_date is null.
    So from above emp_no 10 and 30 should return pk_id 1 and 2.. where 1 is previous employment and 2 is current employement... Emp_no 20 should not be fetched since he is not been rehired in the company..
    Emp no 30 should be fetched only pk_id 5 and 6... 6 is the current employment and 5 is previous employment
    Thanks
    Vinoth.

    Try this
    SELECT pk_id, emp_no,CURRENT_HIRE_DATE , PREVIOUS_HIRE_DATE, CURRENT_LAST_WORKING_DATE, PREVIOUS_LAST_WORKING_DATE
    FROM (
    SELECT pk_id, emp_no,HIRE_DATE "CURRENT_HIRE_DATE",lead(HIRE_DATE,1,NULL) over(PARTITION BY emp_no ORDER BY DMY_ORDER) "PREVIOUS_HIRE_DATE"
           , LAST_WORKING_DATE "CURRENT_LAST_WORKING_DATE",  lead(LAST_WORKING_DATE,1,NULL) over(PARTITION BY emp_no ORDER BY DMY_ORDER) "PREVIOUS_LAST_WORKING_DATE"
           ,row_number() over (PARTITION BY emp_no ORDER BY hire_date DESC) "DMY_SLCT"
    FROM
    SELECT pk_id, emp_no,HIRE_DATE,LAST_WORKING_DATE, COUNT(emp_no) over (PARTITION BY emp_no) "CNT",
           row_number() over (PARTITION BY emp_no ORDER BY hire_date DESC) "DMY_ORDER"
    FROM 
    SELECT 1 PK_ID , '10' EMP_NO , TO_DATE('01-JAN-2012')  HIRE_DATE , TO_DATE('01-APR-2012')  LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 2 PK_ID , '10' EMP_NO , TO_DATE('01-JUN-2012')  HIRE_DATE , NULL LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 3 PK_ID , '20' EMP_NO , TO_DATE('01-FEB-2012')  HIRE_DATE , null LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 4 PK_ID , '30' EMP_NO , TO_DATE('01-AUG-2011')  HIRE_DATE , TO_DATE('01-SEP-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 5 PK_ID , '30' EMP_NO , TO_DATE('01-OCT-2011')  HIRE_DATE , TO_DATE('01-NOV-2011') LAST_WORKING_DATE FROM DUAL
    UNION ALL
    SELECT 6 PK_ID , '30' EMP_NO , TO_DATE('01-DEC-2011')  HIRE_DATE , NULL  LAST_WORKING_DATE FROM DUAL)
    WHERE CNT >=2 AND DMY_ORDER IN (1,2))
    WHERE DMY_SLCT=1;
    Output..
    PK_ID     EMP_NO     CURRENT_HIRE_DATE     PREVIOUS_HIRE_DATE     CURRENT_LAST_WORKING_DATE     PREVIOUS_LAST_WORKING_DATE
    2     10     6/1/2012     1/1/2012          4/1/2012
    6     30     12/1/2011     10/1/2011          11/1/2011
    Hope its fullfill your requirement.

  • Report on Current and Last Year Sales

    Hi ,
    I have a requirement to create a report which would display in one column sales from current fiscal year/period and 2nd column sales from last fiscal year/period at the same time
    Please guide.

    Hi,
    You can achieve this by creating two selections in columns in query designer.
    First one restrict the key figure with current Fiscal period.
    Second restrict the key figure with Fiscal year with customer exit and -1 as offset value.
    Hope this helps........
    Rgs,
    Ravikanth.

  • How to create report which includes records of current month and last 7 days of previous month.

    Hi Experts,
    I need to create a report which includes records of current month and last 7 days of previous month.
    I will get records of current month by this formula :- month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)
    Please tell me how to add the records of last 7 days of previous Month for the same report.
    Thanks in Advance.

    Hi Ajay,
    If you have more than a year data in your database then your formula will return wrong results. ie. If your data consist of 2012,2013,2014 data then below formula will return all 8th month data irrespective of year. So, you need to check year also here
    month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate)
    Now add Abhilash second statement in OR so, your formula should look like :
    (month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate))
    OR
    Date({PROBSUMMARYM1.OPEN_TIME}) IN [DateAdd('d',-7,Maximum(LastFullMonth)), Maximum(LastFullMonth)
    -Sastry

  • How to show current year and last year sales in a WEBI Report

    Hi Guys
    How can show current YEar Sales in one column and Last YEar Sales in the other column based on a user prompt for the Current YEar Column.
    For Example is user enter 2010 for Year how can i show a Column for Sales-2010 and Sales 2009.
    Thanks

    If you can modify your Universe add an object named New Object Last Year whose SQL is:( yourTableName.Year + 1)
    Then in WebI create two distinct queries in your query Pane. In the first one you could do this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:   Year Equal to '1. Prompt Year'
    Query 2:
    objects: Year, Sales ... etc.
    filters:    New Object Last Year Equal to '1.Prompt Year'
    Then in your report you can drag each object on their respective columns.
    If you don't want to use two distinct queries, use one like this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:        Year Equal to '1. Prompt Year'
                 Or
                      New Object Last Year Equal to '1.Prompt Year'
    Edited by: PadawanGirl on Jun 23, 2011 6:28 PM

  • Finding Last friday and Last monday of current date

    Hi
    Please help me to get the Last friday and Last monday of current date using an sql query.
    If I am running query on 7th July 2008 ,it should give me Last friday as 07/04/2008 and Last monday as 07/07/2008
    I need to compare it with another date filed
    eg: Select * from employee where ReportedDate between [Last Friday] and [Last Monday]

    It works many times but fails for this scenario- If today is Friday and I run following query today, it throws today's date, which is incorrect. I need previous Friday's date to be returned everytime.
    select next_day (sysdate-7,'FRIDAY') Last_Friday from dual
    Edited by: user6402026 on May 22, 2013 1:43 PM
    Edited by: user6402026 on May 22, 2013 1:43 PM

  • First date and last date of current year

    Hi
    how can i get first and last date of current year, thanks for your help

    hi,
    use FM......... FIRST_AND_LAST_DAY_IN_YEAR_GET
    DATA: first LIKE sy-datum,
          last LIKE sy-datum.
    CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
      EXPORTING
        i_gjahr     = '2007'
        i_periv     = '24'
      IMPORTING
        e_first_day = first
        e_last_day  = last.
    WRITE: / 'First Date', first, '    Last Date', last.
    Regards
    CNU

  • Displaying current user's first and last name on a report.

    I would like to dispay the current user's name on a report. I've tried using User() and NQ_SESSION current user .
    These two options display the User ID (i.e. User name is Jon Smith. there ID is COMP/JSMITH.
    Using the two methods above the ID (COMP/JSMITH) is displayed. Is there a way I could display Jon Smith?
    I thought their might be a way to use Full Name or First and Last Name.
    Message was edited by:
    user618827

    VALUEOF(NQ_SESSION.DISPLAYNAME) will do the trick
    Mike L

  • In which table current /and in which table last 5 passwords are stored

    Hello
    in which table current /and in which table last 5 passwords are stored

    hi,
    The password may not be changed to any of a useru2019s last x passwords, if the user changes the password himself or herself.
    Until SAP NetWeaver 6.40 (inclusive), the password history was fixed to the value 5.
    After SAP NetWeaver 6.40, the administrator can set the size of the password history (up to 100 passwords selected by the user).
    The administrator can reset a useru2019s password to any initial password, therefore also to one of the last x passwords for this user. This is necessary, since the administrator should not know the passwords of the users. The user is prompted to change the initial password at the first interactive logon.
    You can change this with the profile parameter login/password_history_size.
    -Gokul

  • How to display records based on current month and last month???

    i have a query that want to display the data for current month and last month. when i try to view the reports, all the data/key figures is return all in 0.00.
    i modify the variables for this current month and last month but still the results is the same. i could not see the data. any advise on how to modify the variables for this current month and last month? i am thinking my variables is wrong.
    for the current month variable:
    the type of variable is characteristic value, processing by customer exit, reference characteristic is calendar year/month.
    thanks for all who are kind to help me here....

    Hi,
       If you install the variables from BC correctly and they are in active state, you can use them directly use them. check for this month the total values at info cube is ZERO or some value. as you told you are getting ZEROS for your input.and check the data at cube level based on your query design, apply all restrictions, fileters and see do you get any data at cube level and compare with report.

  • How to get current month and last month dynamically??

    how to get current month and last month dynamically
    like
    month = getCurrentMonth();
    lastmonth = getcurrentMonth() -1;
    please help
    thanks

    hi :-)
    /* depracated but can be still useful */
    java.util.Date dtCurrent = new java.util.Date();
    int month = dtCurrent.getMonth();
    int lastmonth = dtCurrent.getMonth() - 1;
    System.out.println("* " + month);
    System.out.println("* " + lastmonth);
    /* better to use this one */
    Calendar cal = new GregorianCalendar();     
    int imonth = cal.get(Calendar.MONTH);
    int ilastmonth = cal.get(Calendar.MONTH) - 1;
    System.out.println("*** " + imonth);
    System.out.println("*** " + ilastmonth);
    regards,

  • I am currently a full time college student and last term I had access to the creative cloud products, when I attempt to access InDesign I am asked to purchase products.  Please help.

    I am currently a full time college student and last term I had access to the creative cloud products, when I attempt to access InDesign I am asked to purchase products.  Please help.

    Do you have a subscription that you purchased and still pay into?  If so, contact Adobe support thru chat and see if they can assist you with your subscription.
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Creative Cloud support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html ( http://adobe.ly/19llvMN )
    Did the school provide your access for free?  If so, check with the school to see if they still provide free access to the software for students.
    If neither of the above situations match yours, please provide more detail regarding what gave you access to the software.

  • How to calculate rms voltage, rms current and frequency from real time data?

    Hello,
    I need to calculate the real time rms voltage, rms current and frequency of the received voltage and current graphs using visa read. Actually am trying to monitor the voltage and current parameters of AC load, in this case, am using a set of 4 light bulbs at the moment. Expected frequency is 50 Hz, and rms voltage close to 240v AC, current about 1A. 
    Attached is the vi picture of what I have been able to achieve so far, courtesy of labview forums. But I need to finally finish this vi by calculating the Vrms, Irms and frequecy. The front panel shows the voltage (Chart V) and current (Chart I) after scaling. Chart VI represents ADC value 0 ~ 1023 of received data. Aray V & I show the binary bits received up to 10 bits of useful data from ADC. Each sine wave from ADC is sampled at 25 samples for the ADC conversion, and sampling frequency of 1.28kH.
    I have tried using the RMS vi, but seems I don't know how to configure it correctly to get desired results. Also when I make changes like switching of one of the bulbs so that their is current change, I need to refresh the SERIAL port first before changes show up on the VI. Any ideas on how to improve on this are highly appreciated.
    Otherwise, I would appreciate if somebody helps me MODIFY my VI to read the rms values and frequency from received data. This is the last piece of my project, I do appreciate all the help rendered. Am currently using labview labview 2014, student version!
    Gavin.
    Attachments:
    Test_revised1.vi ‏39 KB
    Test_frontpanel.png ‏196 KB
    Test_blockdiagram.png ‏187 KB

    hello,
    note that peak voltage (Vpeak) is (240 * 1.414) = 399 V and peak current about 1.414 if intended rms current is 1A.
    Gavin.

  • Using different hierarchy in a query and last value error

    Hi guys,
    there is a hierarchy for customers in the 0Customer Infoobject which I should use in my query.
    I have activated the hierarchy in the query and now some results are not appearing but red crosses "x" are shown.
    And the error message: The function Calculate Results as ... could not be applied everywhere.
    I know that I am using the result as "last value" for some columns because I need them there (for example: to determine the last value for the credit limit of the current month). I think these columns where I am using the last value calculation are only affected.
    I mean my query has a lot of characteristics and key figures and I was told that a hiearchy for customers which is available should be used. But now there are these red crosses.
    I don´t see any other solution as not to use this specific hierarchy.
    Has anybody a suggestion what could be an argument to use or not to use a hierarchy?
    Is it sometimes like in my case that a hierarchy is not possible to use?
    Thanks in advance!

    Hi,
    say for example your customer hierarchy is customers grouped under region. You can maintain this region as one of the attribute of customer and you can display this attribute in the report. Indirectly, this will give similar output to that of hierarchy.
    But lot depends on how your hierarchy is formed, before commenting whether it can be moved to master data attributes.
    Thanks.

Maybe you are looking for

  • Total Quantity in Custom Report

    Hello! When we create a report (eg, stock report), How to get the total quantity at the bottom of the report? For example, if i create a report for all purchase orders for a particular item, how to get the total quantity being displayed at the end of

  • Deploying forms on Fusion Middleware 11g

    Hi everyone! I will post my thread in english and spanish. English:_ I have developed a simple form using developer 11g on a windows pc, and now I want to deploy it on a SLES10 server that has installed WebLogic Server 10.3/Fusion Middleware 11g. The

  • Read JSP variables in the % ... % part

    Hi there, got a big problem that i can't solve... maybe you know the answer? How do i (in <% %> section of JSP code) read a JSP variable? Please respond (also if you don't understand the question or so). the code: <%@ page import="java.util.*, javax.

  • I get two tabs with my identical home page every time I open Firefox. How do I "unpin" one of them so that only one tab is populated when I open Firefox?

    When I installed Firefox I inadvertently responded "yes" when asked if I wanted to "pin" my home page to the browser. l also designated that page (my Juno page) as my home page. So now whenever I open Firefox, two tabs appear with my identical home p

  • PostgreSQL doesn't start

    I have installed postgresql using pacman & now it doesn't start. I get "FATAL:  could not create lock file "/run/postgresql/.s.PGSQL.5432.lock": No such file or directory"  full log here: $ sudo rc.d start postgresql :: Starting PostgreSQL [BUSY] pg_