Current Position:Home > Re:regarding date function:urgent

Re:regarding date function:urgent

Update:11-30Source: network consolidation
Advertisement
Hi,
        below is my code, i need to run monthly report, s_wadat is select-option variable, if i give 06/26/2003 i should get from month 05/01/2003 to 05/31/2003 data, my below code is working for current year only(2007 only), how to modify
    data: last_month_last_day like S_WADAT.
last_month_last_day =  S_WADAT  .
last_month_last_day+6(2) = '01'.
last_month_last_day = last_month_last_day - 1.
*write:/ last_month_last_day.
data : date1 like S_WADAT.
date1 = last_month_last_day .
date1+6(2) = 01.   "set the date to first of month
*write:/ date1.
SELECT  LIKP~VBELN
          LIKP~WADAT_IST
          KNA1~NAME1
          LIPS~MATNR
          LIPS~CHARG
          LIPS~LFIMG
          LIPS~WERKS
          VBKD~BSTKD
                  INTO CORRESPONDING FIELDS OF TABLE ITAB
                  FROM LIKP
                  JOIN LIPS ON LIKPVBELN = LIPSVBELN
                  JOIN VBKD ON LIPSVGBEL = VBKDVBELN
                  JOIN KNA1 ON KNA1KUNNR = LIKPKUNNR
              WHERE LIPS~LFIMG GT 0 AND
                    LIKP~KUNAG IN S_KUNAG AND
                   LIKP~WADAT_IST between date1 and last_month_last_day
                  AND   "S_WADAT-low and S_WADAT-high  AND
                   LIKP~VBELN IN S_VBELN
              ORDER BY LIKP~WADAT_IST
                       LIKP~VBELN.

The Best Answer

Advertisement
Hi,
The following code i used find last day of last month from sy-datum.
May this one help you
data: date1 like sy-datum.
parameters: p_date like sy-datum default sy-datum.
p_date+6(2) = 01.
date1 = p_date - 1.
aRs
  • Date function: urgent : please help Update:11-30

    This is the problem statement.: Problem: Given two dates (during the years 1901 and 2999, inclusive), find the number of days between the two dates. Input: Two dates consisting of month, day, year. For example, the inputs '6, 2, 1983' and '6, 22, 198

  • Re:regarding date function:urgent Update:11-30

    Hi,         below is my code, i need to run monthly report, s_wadat is select-option variable, if i give 06/26/2003 i should get from month 05/01/2003 to 05/31/2003 data, my below code is working for current year only(2007 only), how to modify     da

  • Pl/sql Year to Date Function Update:11-30

    Dear All! Its very urgent task for me. i'm working on Oracle discoverer. i'm creating Project Year to Date report. i need one year to date function. i've only period name. The scnerio is this, in our company financial year is starting from (April to

  • Data Federator Universe Date Functions Update:10-11

    Hi, I created a Data Federator Universe from target tables (Source Tables from: Sql Server 2005 and Oracle 10g). Now, I want to create a object in the universe: "Days between 2 dates"(coming from 2 different target tables). I don't see any other

  • Print a DayName without using Date functions Update:10-11

    Hi, I have an assignment like without using any date functions i should print a calendar. Below is the code without using any datefunctions like dateadd, datediff, datename a calendar has been generated for month and year entered. I want a week name

  • Date function doesn't work in Message Subject when scheduling batch Update:10-11

    Hi, When I was scheduling a batch and went to PDF attached E-Mail panel, in the Message Subject line I added a function <<Date(yyyy-MM-dd)>>,but when the email was sent, the date function in the subject didn't show the actual date, just showed

  • Date Functions( first day of a month that is 3 months from now....) Update:10-11

    I have recently written my first stored procedure. Its rather a bunch of SQL statements. I had to hard code lot of dates. most of them are first day of the current monthe or last day of current month etc. I thot of parametrizing all the dates, but if

  • Problem overloading "set data" function on Button DataGrid Renderer Update:10-11

    Hi all, I'm hoping this is something simple. I have a class that extends mx.controls.Button and implements mx.core.IDataRenderer.  I need to set the button icon whenever the Data property is set from the DataGrid.  My problem is that my overloaded se

  • Help with Date function in sql query.... Update:10-11

    My question I guess is really 2...I'm trying to use the date function as a comparison in my WHERE clause in my sql command. 1. My date format is dd-MMM-yy eg. (01-Apr-06) ... my problem is the Apr is lower case where my field in the database is 01-AP

  • How to  use data function using characterstics variable for calculation on Update:10-11

    how to  use data function using characterstics variable for calculation on  attribute as key figureHi Gayatri Did you not see my answer for CASE because CASE does indeed offer the use of the BETWEEN clause, but DECODE does not. Let me give you a litt