Subtraction 3 months from current month and store in a report output

Hi Gurus,
Currently my requirement is my clinet is having 2 sales organization one in usa and one in china.
They are using one report for sales comparison. The issue is  when client enter the sales organization number like 1002 for china the output should like
Period 06 => SEP (usa spetember amount should come in 1002 organization june filed in the report
Period 07 => OCT(like wise oct amount for in august. This process should continue for every month.
provide sample program or logic.

Subtracting days to determine month is not a good idea, as each month can have different number of days.
If you want to be precise act on month value in date like this:
data: period type i, "data for stroing period
        c_period(2) type n. "period in format 01,02, 03
period = sy-datum+4(2) - 3. "take 3 months before actual date
"if the result is less or equal 0 (then we have to back to to previous year)
"it will be applicable only for JAN, FEB and MARCH months
if period le 0.  
ADD 12 to period.
endif.
c_period = period.  "now in c_period you have 3 months before today

Similar Messages

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • How to count records from 2 tables and show in RDLC Report

    hi all,
    its being a one day searching for the solution but No Luck.
     I have two SQL tables tblstudetail and tblfeereceiptdetail.
    i just want to count records from both tables and show in RDLC report.
    I tried SQl Query Like This:
    select a.session, a.course,
    Count(CASE a.ADstatus WHEN 'OK' THEN 1 ELSE 0 END ) AS Admission,
    Count(CASE s .I_receiptstatus WHEN 'OK' THEN 1 ELSE 0 END) AS Feeprint
    from
    tblstudetail a
    FULL join
    tblfeereceiptdetail s on s.studentID = a.studentID
    where a.session = '2015' AND s.Fsession = '2015' AND a.adcat = 'Regular'
    GROUP BY a.session,a.course
    ORDER by a.course
    The result Show the Same Value in Both columns
    Session    Course      Admission       FeeDetail
    2015          B.A. I               275              275
    2015          B.A. II              307             307
    2015         B.A. III             255            255
    2015          B.Sc. I             110             110
    2015           B.Sc. II           105            105
    2015          B.Sc. III            64               64
    Actully I want to Count How many ADMISSION have been Taken(FROM tblstudetail) and How many FEE RECEIPT have been Print (From tblfeereceiptdetail).
    please guide me for this as soon as possible.
    thanks in advance...

    I am counting 'OK' in both the table columns I.e 'ADstatus' in tblstudetail and 'feereceiptstatus' in tblfeereceiptdetail
    please suggest me

  • List of Month and Year in SSRS report parameter?

    Hi, I have two parameters in my SSRS Report i.e. Month and Year. I want to show the list of all Months in dropdown and years for a particular range say 1995-Current Year.
    Can any one suggest me the query for how to get it to work.Thanks!!
    MCP

    I am not sure I what you're business needs are for this report.  You stated that you need the month and year for parameters.  If this is the case then there has to be a date and time column in which you can query against to provide both the month(s) and year.  In order to accomplish this using t-sql without querying an existing column would require a loop or cursor based approach,which can negatively impact performance, or a union statement specifying a string literal and the effort to write either of these would exceed the effort required to statically assign the parameter values in reporting services.  The below query shows how to statically create a query for each month and its ordinal position in the year and the same could be done with the year(s) 1995-2009, but this process involves more resources than assigning the static values for the parameters
    SELECT DATENAME(MONTH, 1 ) AS MONTH,
    1
    UNION
    SELECT DATENAME(MONTH, 2 ) AS MONTH,
    2
    UNION
    SELECT DATENAME(MONTH, 3 ) AS MONTH,
    3
    UNION
    SELECT DATENAME(MONTH, 4 ) AS MONTH,
    4
    UNION
    SELECT DATENAME(MONTH, 5 ) AS MONTH,
    5
    UNION
    SELECT DATENAME(MONTH, 6 ) AS MONTH,
    6
    UNION
    SELECT DATENAME(MONTH, 7 ) AS MONTH,
    7
    UNION
    SELECT DATENAME(MONTH, 8 ) AS MONTH,
    8
    UNION
    SELECT DATENAME(MONTH, 9 ) AS MONTH,
    9
    UNION
    SELECT DATENAME(MONTH, 10) AS MONTH,
    10
    UNION
    SELECT DATENAME(MONTH, 11) AS MONTH,
    11
    UNION
    SELECT DATENAME(MONTH, 12) AS MONTH,
    12
    David Dye

  • How to open and read many files from a directory and store contents in 2D array?

    I want to make a VI that opens and reads the data from various files contained in a directory (200 files each with 2 columns) and store these in a single 2D array. For file number 1 I want to store the data from both columns in the 2D array, but for files 2 to 200 I only want to store the second column of each file. Can someone please help?

    Hi Nadav,
    Thanks for your help. I have followed your instructions but i cannot get it to work. I used the LIST DIRECTORY to list the files in the directory - that works. However, how do I read each of the 200 files using READ FROM SPREADSHEET FILE without me having to manually select each of the 200 files? So, if I use LIST DIRECTORY to list all 200 files in an array, how do I get each of these to open and store the data in a 2D array? Here is what I have done (File called read_files.VI) Could you please help me? Thank you very much in advance.
    Attachments:
    read_files.vi ‏18 KB

  • How to read the data from excel file and store into the table?

    Hi All,
    I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
    All the excel fields and my table columns are same.
    Can you share with me how can acheive this using LOB's?
    Thanks

    Hi OraSuirya,
    you can try with external tables .
    syntax as follows
    create table ext_table_csv (
    i Number,
    n Varchar2(20),
    m Varchar2(20)
    organization external (
    type oracle_loader
    default directory ext_dir
    access parameters (
    records delimited by newline
    fields terminated by ','
    missing field values are null
    location ('file.csv')
    reject limit unlimited;
    For this you need to create directory
    Directory Creation syntax:
    create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
    grant read, write on directory ext_dir to <User>;
    please paste the excel file in the particular directory .
    I hope this will help you.
    Please correct me if I am wrong anywhere .
    Thanks,
    Tippu.

  • Extract data from Oracle Database and store it into a CSV file format

    Hello.
    I'm trying to export a table from an Oracle Database into CSV file format with any Oracle adaptor and store it into a HDFS system.
    How could I do it?
    Thanks in advance!

    Xavi wrote:
    HI Charles. Could I use.. Oracle Data Integrator Application Adapter for Hadoop? For this purpose?
    Thanks in advancePerhaps. I have to confess that I am not familiar enough with ODI to know if that is within its capabilities.
    You might see if there is a forum for ODI and post your question to that.
    Charles Lamb

  • Retrieve Image from SQL Server and Store in Oracle

    Hi All
    I want to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    I tried to retrive the image from sqlserver using getBytes and when storing to Oracle i have to type cast the byte array to BLOB then only it will be inserted please tell how to typecast byte array to BLOB.
    Or is there alternative way how to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    Regards
    Majid

    Hi Rajaram
    Thanks for UR Reply
    I tried what you have suggested but i am getting following exception
    java.lang.NullPointerException
    CDVLogger--getInstance--entered in ----getInstance----- null
    CDVLogger--getInstance--entered in ----logPrinter----- null
    CDVLogger--getInstance--entered in ----logger----- com.uttra.cdv.base.util.CDVLogger@b0ce8f
    at javax.sql.rowset.serial.SerialBlob.<init>(SerialBlob.java:82)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.createFamilyMemberPhotoRec(FamilyMemberPhoto.java:95)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.LoadFamilyMemberPhoto(FamilyMemberPhoto.java:55)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.main(FamilyMemberPhoto.java:136)
    Please Suggest

  • Query to deduct the time from current date and time

    I want to get the query to deduct time(180 mins) from the current date and time.
    Regards
    Pavan

    SQL> select to_char(sysdate,'dd.mm.yyyy hh24:mi:ss') curr,
      2         to_char(sysdate - interval '180' minute,'dd.mm.yyyy hh24:mi:ss') past from dual
      3  /
    CURR                PAST
    24.08.2007 16:18:37 24.08.2007 13:18:37
    SQL> 

  • Download files from the URL and store them in the table

    Hello,
    I want to download files from the URL and want to store them in the table.
    Can I do it using sql/pl-sql.
    Please help me on this.
    Thanks,
    Rajendra Yadav

    Never tried it before...
    Is this what you are talking about?
    http://www.oracle-base.com/articles/10g/file-upload-download-procedures-10g.php
    Cheers,
    Manik.

  • HT204406 I purchased the additional Icloud storage for my ipod touch.  Since it removes all my music from the touch and stores it in Icloud, I find that when I am not at my wifi location or another one,I can't access my music.Is there a solution for that?

    I purchasedhe additional Icloud storage for my ipod touch.  That removes all my music from the ipod and putsd it in Icloud.  I find that when I am away from my wifi connection, like when walking or working out, I can't access my music. Is there a solution for this?

    Download the music to your ipod when you are in a wi-fi area.
    It will be stored on your ipod.

  • Calling Unix-Script from within Oracle and store stdout/stderr in table

    Hi,
    What I want to do is:
    1. Calling a UNIX script (e.g. hello.sh) (from inside the Database)
    hello.sh
    echo “Hello World!“
    2. and get the stdout/stderr output back in my Database in a table (e.g. temp_back)
    table temp_back
    ID     stdout          stderr
    1     Hello World!
    I think Number 1 isn’t a big problem, but how to get stdout back in DB?
    Any solution?
    I searched a bit in this Forum and found this Post.
    re:Calling Host Command Through Database  Procedures or Triggers
    This may be what I am searching for, but can’t access the Link
    Since I am not really fit with UNIX and packages/procedures in Oracle it would be nice if you could post a very detailed answer.
    (Please no java)
    -What packages do I need? (heard DBMS_OUTPUT would be useful)
    -example PL/SQL script
    Thanks a lot!
    Marcus
    Environment:
    Oracle 9.2.0 DB

    Marcus, if you opened the Java sandbox to access any o/s file, you can call any Unix command, shell script, or program, that the Oracle o/s user has exec privs on.
    Just remember that there's a very basic Unix environment when you make the call - the settings in the .profile does not apply. Thus PATH for example is not set. When making the call make sure that the complete path is given. As for the environment, that is a problem as you cannot set that and make the call at the same time.
    In that case it is much simpler to rather write a Unix shell script that does all for you. Set the environment. Run the command(s). Format output. Etc.
    Then you call that Unix script, via Java, from SQL or PL/SQL. Treat the Unix scripts like the Unix-version of stored procedures for your Oracle application.
    Some technical details. When you connect to Oracle, a Unix process services you. This can be either a dedicated server process (servicing only your Oracle session) or a shared server process (from the shared service pool of processes).
    In either case, it is a Unix process running as a background process (thus detached from any tty device). PL/SQL and SQL are executed by this process. The Oracle JVM created by your session also lives in this process. When you therefore make o/s calls, these calls are made by this process.
    Therefore you are limited to what this process can and can't do. E.g. it runs as the oracle o/s user and will fail on accessing paths and commands does the oracle user does not have privs on. Etc.

  • Report on power generation from each plant and shift wise(PP report)

    Hi,
    i got one  Functional spec on pp module. this FS main object is calculate the daily smelter performance.
    Based on this FS  I will make a report on POWER GENERATION FROM EACH PLANT AND  SHIFT WISE.
    so please can  anyone of you  advice to me  , is  there any standard extractors  and standard cubes or ods are there for make this report.
    Regads,
    Suresh.

    Hi,
    here i mentioned tables,fields and logic according to Fspec.
    S.no          Report Field                                      SAP Table-field                                        Logic
       1               Shift                                              AFRU - KAPTPROG                                                                       
        2              Unit                                                MKPF-VERID                                      Pass MATNR and VERID to AFPO and fetch AUFNR for all VERID and pass AUFNR to AFRU and fetch KAPTPROG and GMNGA for that particular BUDAT
      3.            Total Generation                                    -                                         ADD all the unit GMNGA for Individual KAPTPROG
      4.           Total Auxiliary Consumption                   -                                          Pass MATNR and AUFNR to MSEG and fetch the MBLNR and MJAHR. Check MSEG - MBLNR and MSEG u2013 MJAHR = MKPF - MBLNR and MKPF u2013 MJAHR
    and fetch BUDAT for that particular date and pass it those MBLNR and MJAHR to MSEG and check for movement type 201 and fetch MENGE.
    5.            Export to GRIDCO                               -                                            Pass MATNR and AUFNR to MSEG and fetch the MBLNR and MJAHR. Check MSEG - MBLNR and MSEG u2013 MJAHR = MKPF - MBLNR and MKPF u2013 MJAHR
    and fetch BUDAT for that particular date and pass it those MBLNR and MJAHR to MSEG and check for movement type 261 and check for Field SHKZG if H fetch MENGE.
    6.          Import to GRIDCO                               -                                                Pass MATNR and AUFNR to MSEG and fetch the MBLNR and MJAHR. Check MSEG - MBLNR and MSEG u2013 MJAHR = MKPF - MBLNR and MKPF u2013 MJAHR
    and fetch BUDAT for that particular date and pass it those MBLNR and MJAHR to MSEG and check for movement type 101 and check for Field EBELN and fetch the MENGE.
    7.        Smelter Consumption                                -                                            Pass MATNR and AUFNR to MSEG and fetch the MBLNR and MJAHR. Check MSEG - MBLNR and MSEG u2013 MJAHR = MKPF - MBLNR and MKPF u2013 MJAHR
    and fetch BUDAT for that particular date and pass it those MBLNR and MJAHR to MSEG and check for movement type 201 and check for Field WERKS 1400 and display  MENGE.
    8.       Net Export / Import (MW)                                   -                                      Difference between Export to GRIDCO and Import to GRIDCO
    Based on these information ,can please anyone advice to me, is there any standard extractors ,cubes and ods for make this report.
    Thanks,
    Suresh.

  • How to get signal from analog input and send it to analog output (real-time​)

    Hi everyone,
    I am doing simple task in Visual C++ and I am using PCI-6221(37 pin).
    Basically, I want to send same signal from 'analog input' to 'analog output'
    at the same time (almost), to make it real-time application.
    Can someone please provide me sample program. 
    I would appreciate if you could provide me with the good tutorial which explains
    step by step everything about programing NI-DAQmx for C/C++.
    Best Regards,
    Khassan
    Solved!
    Go to Solution.

    This is my code in C++, you can optimize it if it looks too messy. This code reads signal from analog input and outputs it through analog output. 
    To make this code work additional  include directories and library directories must be added from NI.
    I hope it helps someone.
    #include <stdio.h>
    #include <conio.h>
    #include "NIDAQmx.h"
    #include <math.h>
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    int main(int argc, char *argv[])
    int32 error=0;
    TaskHandle taskHandleRead=0,taskHandleWrite=0;
    int32 read=0;
    float64 dataRead[1000];
    char errBuffRead[2048]={'\0'};
    char errBuffWrite[2048]={'\0'};
    bool32 done=0;
    int32 written;
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0​","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Vo​lts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQ​mx_Val_Rising,DAQmx_Val_ContSamps,0));
    DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao​0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleC​lock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1​000));
    DAQmxErrChk (DAQmxStartTask(taskHandleRead));
    DAQmxErrChk (DAQmxStartTask(taskHandleWrite));
    while( !done && !_kbhit() )
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_​GroupByScanNumber,dataRead,1000,&read,NULL));
    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,D​AQmx_Val_GroupByChannel,dataRead,&written,NULL));
    _getch();
    Error:
    if( DAQmxFailed(error) )
    DAQmxGetExtendedErrorInfo(errBuffRead,2048);
    DAQmxGetExtendedErrorInfo(errBuffWrite,2048);
    if( taskHandleRead!=0 )
    DAQmxStopTask(taskHandleRead);
    DAQmxClearTask(taskHandleRead);
    if( taskHandleWrite!=0 )
    DAQmxStopTask(taskHandleWrite);
    DAQmxClearTask(taskHandleWrite);
    if( DAQmxFailed(error) ){
    printf("DAQmx Error: %s\n",errBuffRead);
    printf("DAQmx Error: %s\n",errBuffWrite);
    printf("End of program, press Enter key to quit\n");
    getchar();
    return 0;

  • How to calulate previous fiscal year from current year and periods as input

    hi all,
    i have a report where i have 2 select options as year and period.
    my period can be a range  like( Ex: 1 to 6).
    i like to know previous fiscal year from the following inputs.
    Tel me a suitable conversion routine to calculate
    depending on periods and fiscal year.
    regards
    sivaram.

    Hi
    U need to check the lower period, if it's 1 the previous fyscal year will be the year before:
    IF PERIOD = '1'.
      PREV_YEAR = YEAR - 1.
    ENDIF.
    U can also use the fm FI_PERIOD_DETERMINE, in this case you need a date, u can get it from lower current period:
    Get the first day of the period
    BUDAT(4)   = YEAR.
    BUDAT+4(2) = PERIDO_LOW.
    BUDAT+6(2) = '01'.
    Now get the last day of the previous month:
    BUDAT = BUDAT - 1.
    Use this date to get its period by fm FI_PERIOD_DETERMINE
    Max

Maybe you are looking for

  • B&W 17" CRT Studio Display Monitor

    I have this connected to my G5 P/Mac which works fine. At present it is powered through my old G3, can I power the monitor directly through a power lead to the mains supply? I think the power lead from the G3 might do this?

  • Chequered Video on Mountain Lion

    I'm getting a chequered video whenever I try to play video using the DVD Player and iTunes. The output I am using is a HDMI connection to a Sony AVReceiver which in turn connects to a Samsung TV. I had no problems running on this configuration using

  • HTMLDB_ITME.DATE_POPUP problems

    Hi, Since I did the HTMLDB patch my date_popup item is not working anymore. When I choose date in the popup calendar, the value returns in the first field , not the one where I clicked on the calendar icon. Here is my select : select htmldb_item.hidd

  • Why don't we show up in the "what's new" section of the iBook store?

    We published our first book but it doesn't show up under the "what's new" section of our category. Any ideas why not? The books that are showing up were added ages ago. :(

  • Versions of Reader prior to 9 can't use forms

    Help!  My client is mightily mad.  They have people using versions 7 and 8 or Reader who can't use the forms I'm creating on ES2.  I've enabled reader access and I've saved them as being Adobe Reader 7.0.5 enabled - so what on earth else am I suppose