Incripting Data Output

Many of my programs use the write to measurement file.vi or the write to spreadsheet file.vi and save the output data as a standard tab-deligniated spreadsheet, .lvm file.  My question is if there is a way to make an incripted file so that it is saved in a read-only mode, so that you can't just go in and change the data that was saved.
Solved!
Go to Solution.

I decided that just adding 1 to each byte is too simple for encryption.  Basically, it just moves every character over one in the alphabet so that "Hello" becomes "Ifmmp".
That might be enough to stop the causal user, but could be easily cracked.
To make it just a little better, I multiply each byte by 2 before saving.  Besides scrambling the data more, there are a couple of other things you have to watch out for:  Multiplying a byte results in a Long, which is 32 bits instead of 8 bits.  So the data file will be four times longer.  When you read in the data file, you have to count the total number of bytes and divide by 4.  Also, you have to make sure you read in a Long data type instead of a byte.
Other than that, it works like the previous version.  I have to warn you, this still results in weak encryption, but it will be sufficient to keep casual users from messing with files.
Attachments:
Encrypt-Decrypt.vi ‏13 KB

Similar Messages

  • Report is executing in background and need data(output) in excel format

    Report is executing in background and need data(output) to get downloaded in excel format in my PC from an internal table;;in any drive i.e. C: or D: .When executing in backround it prompt to user with which location excel file to be saved and the name of file.How to download in background in excel format?
    Edited by: PRASHANT BHATNAGAR on Aug 26, 2008 6:24 AM

    Hi
    Download a report to excel with format (border, color cell, etc)
    Try this program...it may help you to change the font ..etc.
    Code:
    REPORT ZSIRI NO STANDARD PAGE HEADING.
    this report demonstrates how to send some ABAP data to an
    EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT,        " Excel object
          H_MAPL TYPE OLE2_OBJECT,         " list of workbooks
          H_MAP TYPE OLE2_OBJECT,          " workbook
          H_ZL TYPE OLE2_OBJECT,           " cell
          H_F TYPE OLE2_OBJECT.            " font
    TABLES: SPFLI.
    DATA  H TYPE I.
    table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *&   Event START-OF-SELECTION
    START-OF-SELECTION.
    read flights
      SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    display header
      ULINE (61).
      WRITE: /     SY-VLINE NO-GAP,
              (3)  'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (4)  'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
              (8)  'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
      ULINE /(61).
    display flights
      LOOP AT IT_SPFLI.
      WRITE: / SY-VLINE NO-GAP,
               IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
               IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
      ENDLOOP.
      ULINE /(61).
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-007
           EXCEPTIONS
                OTHERS     = 1.
    start Excel
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    PERFORM ERR_HDL.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
    CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
    PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-008
           EXCEPTIONS
                OTHERS     = 1.
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
      PERFORM ERR_HDL.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - start
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2.
      PERFORM ERR_HDL.
    tell user what is going on
      SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
              PERCENTAGE = 0
               TEXT       = TEXT-009
           EXCEPTIONS
                OTHERS     = 1.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
      PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
      PERFORM FILL_CELL USING 1 3 1 'Von'(003).
      PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
      PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
      LOOP AT IT_SPFLI.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
        PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
        PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
        PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
        PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
      ENDLOOP.
    changes by Kishore  - end
    disconnect from Excel
         CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING  #1 = 'C:\SKV.XLS'.
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL.
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD VAL.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL.
    ENDFORM.
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
      WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
      STOP.
    ENDIF.
    ENDFORM.                    " ERR_HDL
    Regards
    Murali Papana

  • How to pull data output of TCODE "MRKO" into a BI Cube.....??

    Hi Gurus:
    One of the business requirement is to EXTRACT data from relevant tables that the R/3 TCode "MRKO" provides in a report format in to BI. I don't tknow if there is any std. SAP extractor that would provide me the details. We need this data to determine the payment DATE based on "Payment Terms" using a logic, then summarize the data at each Vendor level and pass this information to the BI Cube. We need this information for a Cash Flow Forecasting project.
    I am not familiar with the Tcode MRKO or the program. I would appreciate it if anyone can shed some light here. I basically need a Total Due amount for a month period, Vendor, The date on which the payment has to be made in future based on the Payment terms and Company code. I don't know the tables involved, but the TCODE provides a "Total" per Vendor and thats what I would like to capture and pass to BI. How can I achieve this?
    Appreciate the name of the STD extractor if one exists or the table(s), and if any logic is necessary.....?
    Thanks a lot in advance.....!
    PBSW

    HI,
    I am not aware of any standard extractor for the report that you get from Tcode MRKO, But I can suggest you in a very customized way to extract the data into BW.
    When you run the transaction "MRKO", please check the program that is running in the background for that report to run and get the data output. You could easily find from the lower side menu bar.
    Once if you get to know the program, create a structure and create a datasource assigned to that structure, where  the datasource uses funcion module as its extraction method. In SAP you can easily convert a program into a function module and let the extractor fill your datasource for extraction.
    - Another way of doing it, is to find out the tables that it is retrieving from the report MRKO and create a structure with those fields filled up using a function module. And then use that structure and function module for your new datasource to extract.

  • How to show data output in SSRS

    Below is my simply query.  I need to use Matrix SSRS format. I will put "Region" in "row" column, Header will use "Customer_Requested_Date" field, and will use "Amount" in the data session.
    The data output in the "Header" field will show January.....until December (current month is December).  In the Amount field under "December" (current month), I need to compute the formula like "Customer_Request_Month"
    < =  Current Month".  (I do not have the field name called Current Month, need to get a Date/Time function to display Current Month).
    How I can come up the data output under December Header field to show the current Amount in that section?
    November, 2014
    December,2014
    Region
    Amount
    CRD Month < = Current Month
    Select
    Customer_Request _Date,
    Customer_request_Month,
    Transaction_Type,
    Region,
    Amount
     From Table
    Thanks,
    Josephine
    Josey Tang

    Hi Josey,
    According to your descritption, you want to show the current month in your tablix. Right?
    In Reporting Services, we can use the Now() and datepart() function to get the current month. Please use the expression below:
    =Datepart("m",Now())
    In this scenario, since you want to show the amount of current month within the column group, you need to create another dataset which always show the data of current month. Then you can use lookup() function to get the amount value from the current dataset
    based on the Region. Please follow the steps below:
    Create a same dataset(DataSet2) using your query. Add a filter on this dataset. Make Fields!Customer_request_Month.Value
    =
    Datepart("m",Now())
    Then add a column inside of column group, using the expression below:
    =lookup(Fields!Region.Value,Fields!Region.Value,Fields!Amount.Value,"DataSet2")
    The design and result look like below:
    Reference:
    Expression Examples (Report Builder and SSRS)
    Lookup Function (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • XML data output in a custom grid table

    Hi!
    I was wondering if it is possible to display xml data output in a custom-made grid table? Important is the ability to
    arrange the fields on the grid layout (not a fixed layout with columns and rows).
    I am using the latest JDeveloper release.
    Thanks!

    See [url http://docs.oracle.com/cd/E14072_01/server.112/e10592/functions251.htm#CIHGGHFB]XMLTABLE
    For example:
    -- INSERT INTO <your table name>
    WITH x AS
    (SELECT XMLTYPE('<?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <EMPNO>7782</EMPNO>
    <ENAME>CLARK</ENAME>
    <JOB>MANAGER</JOB>
    <MGR>7839</MGR>
    <HIREDATE>09-JUN-81</HIREDATE>
    <SAL>2450</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
    <EMPNO>7839</EMPNO>
    <ENAME>KING</ENAME>
    <JOB>PRESIDENT</JOB>
    <HIREDATE>17-NOV-81</HIREDATE>
    <SAL>5000</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
    <EMPNO>7934</EMPNO>
    <ENAME>MILLER</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7782</MGR>
    <HIREDATE>23-JAN-82</HIREDATE>
    <SAL>1300</SAL>
    <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>') myxml
    FROM DUAL)
    SELECT *
    FROM   x
    ,      XMLTABLE('/ROWSET/ROW'
             PASSING x.myxml
             COLUMNS empno, ename, job, mgr, hiredate, sal, deptno);

  • How do I create individual xml files from the parsed data output of a xml file?

    I have written a program (DOM Parser) that parses data from a XMl File. I would like to create an individual file with the corresponding name for each set of data parsed from the xml document. If the parsed output is Single, Double, Triple, I would like to create an individual xml file (Single.xml, Double.xml, Triple.xml)with those corresponding names. How do I create the xml files and give each file the name of my parsed data output? Thanks in advance for your help.
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println("Template" + ": " +templateElement.getAttribute("name")+ ".xml");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

    Ive posted the new code but now I'm getting a FileAlreadyExistException error. How do I handle this exception error correctly in my code?
    import java.io.IOException;
    import java.nio.file.FileAlreadyExistsException;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.xml.sax.SAXException;
    public class MyDomParser {
      public static void main(String[] args) {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      try {
      DocumentBuilder builder = factory.newDocumentBuilder();
      Document doc = builder.parse("ENtemplate.xml");
      doc.normalize();
      NodeList rootNodes = doc.getElementsByTagName("templates");
      Node rootNode = rootNodes.item(0);
      Element rootElement = (Element) rootNode;
      NodeList templateList = rootElement.getElementsByTagName("template");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      System.out.println(templateElement.getAttribute("name")+ ".xml");
      for(int i=0; i < templateList.getLength(); i++) {
      Node theTemplate = templateList.item(i);
      Element templateElement = (Element) theTemplate;
      String fileName = templateElement.getAttribute("name") + ".xml";
      Files.createFile(Paths.get(fileName));
      System.out.println("File" + ":" + fileName + ".xml created");
      } catch (ParserConfigurationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();

  • Can you please provide an example of test case using "Standard Data Output Cascade Mode"?

    Hi,
    I have tried creating a test to check  the "Standard Data Output Cascade Mode". In Vivado 15.1, Ultrascale,  it is working when I have data_width=1. However, if I modify the data_width to greater than 1, then I am not seeing the proper value for .CASCADE_ORDER_B.  Is this expected?
    The RTL is top.v. The addr_width=16, data_width=4. The synthesized vm netlist, test_syn.vm. It contains  8 BRAMS but the .CASCADE_ORDER_B parameter setting in the vm netlist is:
    .CASCADE_ORDER_B("FIRST"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("MIDDLE"),
    .CASCADE_ORDER_B("LAST"),

    Hi 
    The parameter "CASCADE_ORDER_B" specifies the order of the cascaded block RAMs from the bottom to the top of the chain
    for port B.
    So the attribute value FIRST represents the bottom BRAM with respect to cascading. You can cross these attributes by opening synthesized design and observing the property of each BRAM.
    Thanks,
    Vinay

  • User Defined Field that gives the date output of the last price update.

    We would like to create a User Defined Field (UDF) with a Formatted Search (FMS) on the Item Master form that gives the date output of the last price update specifically the wholesale price.
    Last Price Update
    Pricelist 2 = Wholesale
    Is this feasible?
    If it is feasible what is the recommended approach?
    Current working UDF on Item Master.
    /* Date output is based on all the latest updates on the Item Master.*/
    select max(updatedate)
    from aitm
    where itemcode = $[oitm.itemcode]
    Resources that were helpful.
    1.(Note:1165947 - Tracking Item Price Changes.)
    2. Case 4-I6: Query on price updates. Mastering SQL Queries for SAP Business One By: Gordon Du

    Thank you Gordon,
    We are looking for the date output of the 'Last Price Update' based on 'Pricelist 2 = Wholesale' which is the challenge.
    These 2 are the parameters for the date output, I should have mentioned that in my original message.
    Last Price Update
    Pricelist 2 = Wholesale
    Per reading a bunch of other similar Forum Questions it looked like it is might not be possible to do. With there being no date on the AIT1 table and AITM.Updatedate is based on any and all updates not just last 'Last Price Update' and not sure how to use the loginstanc.
    Thanks,
    Vern

  • CSV Data Output

    Hi, I would like to know how I can automate the output of data collected in CSV format? Manual intervention i.e. output and subsequent Server upload is not efficient. I would like to have the data output, such as a CSV file, as an email attachment which could be "pulled" by my server and integrated into a "CRM" and such like for better data manipulation. Does anyone have any suggestions?

    I am sorry but we don't have this facility within Formscentral at this time.
    Andrew

  • Reverse data output from Agilent 3458A

    I'm taking 500 sub-samples of a 500mS ramp waveform from a function generator with the attached vi, and the data output is reversed in time. That is, the data as displayed on the waveform chart shows the TRAILING edge first - a time-mirror image of the actual waveform captured. I thought this had to do with LIFO/FIFO, so I forced FIFO, but it doesn't help. What must I do to get the proper time-sequence data from the DMM?
    Can't seem to attach my vi , but it's identical to the Labview sample Agilent 3458 Acquire Multiple Measurement.vi, with the addition of a VISA Write MEM FIFO.

    Ok, the data just comes out as an array.  Well if you know that the data is backwards, just use Reverse 1D Array (as I already stated) to flip it back.
    I remember working with that DMM before.  I never found a way to get the data to come out like a FIFO.  That's just the way the instrument works.  Reverse the array and be done with it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • SQL for dates output

    SQL pasted below is expected to return dates output in format shown,
    with weekday begining 'MONDAY'. The SQL can be ran by creating
    a dummy table 'CAL_MONTHS' with one number column with around 200 null rows.
    The SQL I have written works fine up to the month and week level but it gets
    messed up when trying to print the dates/days for the particular week.
    I would greatly appreciate any help.
    OUTPUT format I am trying to get:
    Month: JAN-2007
    ================
    Week NO. 1
    Week-Day Date Day
    Monday 1/1 01-JAN-07 01
    Tuesday 2/1 02-JAN-07 02
    Wednesday 3/1 03-JAN-07 03
    Thursday 4/1 04-JAN-07 04
    Friday 5/1 05-JAN-07 05
    Saturday 6/1 06-JAN-07 06
    Sunday 7/1 07-JAN-07 07
    Week NO. 2
    Week-Day Date Day
    Monday 8/1 08-JAN-07 08
    Tuesday 9/1 09-JAN-07 09
    Wednesday 10/1 10-JAN-07 10
    Thursday 11/1 11-JAN-07 11
    Friday 12/1 12-JAN-07 12
    Saturday 13/1 13-JAN-07 13
    Sunday 14/1 14-JAN-07 14 AND SO ON........
    Week NO. 3
    Week-Day Date Day
    Week NO. 4
    Week-Day Date Day
    Week NO. 5
    Week-Day Date Day
    Following is the SQL
    set serveroutput on
    begin
    for xx in(
    SELECT months v_months, to_date('01-'||months,'DD-MON-YYYY') v_dt
    FROM ( SELECT distinct TO_CHAR(days,'MON-YYYY') months
    FROM (SELECT to_date('01/01/2007','dd/mm/yyyy') + (ROWNUM-1) days
    FROM cal_months
    WHERE ROWNUM <= to_number(to_date('01/03/2007','dd/mm/yyyy') - to_date('01/01/2007','dd/mm/yyyy')) +1)
    ORDER BY to_date('01-'||months,'DD-MON-YYYY')) loop
    dbms_output.put_line(chr(10));
    dbms_output.put_line('Month: '||xx.v_months);
    dbms_output.put_line(' ================ ');
    for xy in(
    SELECT distinct
    TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'IW') -
    TO_CHAR(TRUNC(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'MM'),'IW')+1 week_no
    FROM cal_months
    WHERE ROWNUM <= TO_CHAR(LAST_DAY(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY')),'DD')) loop
    --dbms_output.put_line(chr(10));
    dbms_output.put_line(' Week NO. '||xy.week_no);
    dbms_output.put_line(' ---------- ');
    dbms_output.put_line(' Week-Day Date Day');
    dbms_output.put_line(' ------------------------------------------ ');
    for zz in(
    SELECT
    TO_CHAR((TO_DATE('01-'||xx.v_months,'DD-MON-YYYY') -
    DECODE(TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'Dy'),
    TO_CHAR(TO_DATE('01-JAN-2007','DD-MON-YYYY'),'Dy'), 0,
    TO_CHAR(TO_DATE('02-JAN-2007','DD-MON-YYYY'),'Dy'), 1,
    TO_CHAR(TO_DATE('03-JAN-2007','DD-MON-YYYY'),'Dy'), 2,
    TO_CHAR(TO_DATE('04-JAN-2007','DD-MON-YYYY'),'Dy'), 3,
    TO_CHAR(TO_DATE('05-JAN-2007','DD-MON-YYYY'),'Dy'), 4,
    TO_CHAR(TO_DATE('06-JAN-2007','DD-MON-YYYY'),'Dy'),5,
    TO_CHAR(TO_DATE('07-JAN-2007','DD-MON-YYYY'),'Dy'), 6)) + (ROWNUM-1) ,'FMDay dd/mm') datee,
    '' day, to_date('') the_date
    FROM cal_months
    WHERE ROWNUM <= DECODE(TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'Dy'),
    TO_CHAR(TO_DATE('01-JAN-2007','DD-MON-YYYY'),'Dy'), 0,
    TO_CHAR(TO_DATE('02-JAN-2007','DD-MON-YYYY'),'Dy'), 1,
    TO_CHAR(TO_DATE('03-JAN-2007','DD-MON-YYYY'),'Dy'), 2,
    TO_CHAR(TO_DATE('04-JAN-2007','DD-MON-YYYY'),'Dy'), 3,
    TO_CHAR(TO_DATE('05-JAN-2007','DD-MON-YYYY'),'Dy'), 4,
    TO_CHAR(TO_DATE('06-JAN-2007','DD-MON-YYYY'),'Dy'),5,
    TO_CHAR(TO_DATE('07-JAN-2007','DD-MON-YYYY'),'Dy'),6)
    UNION ALL
    SELECT
    TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY'),'FMDay dd/mm') datee,
    TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY'),'dd') day,
    TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') the_date
    FROM cal_months
    WHERE
    ROWNUM <= TO_CHAR(LAST_DAY(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY')),'DD')
    and
    TO_CHAR(TO_DATE('01-'||xx.v_months,'DD-MON-YYYY'),'MON-YYYY') = xx.v_months
    and
    TO_CHAR(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'IW') -
    TO_CHAR(TRUNC(TO_DATE(ROWNUM||'-'||xx.v_months,'DD-MON-YYYY') ,'MM'),'IW')+1 = xy.week_no
    ) loop
    dbms_output.put_line(zz.datee||' '||zz.the_date||' '||zz.day); end loop;
    end loop;
    end loop;
    end;

    Try that:
    With weeks of month
    declare
    vyear number:=2007;
    vmes number := 9;
    vdays number;
    week_day number:=0;
    num_day number:=0;
    fx date;
    begin
    vdays := to_char(last_day(to_date(vmes, 'mm')), 'dd');
    dbms_output.put_line(to_char(to_date(vmes, 'mm'), 'Mon') || '-' || vyear);
    for j in 1..vdays loop
         fx := to_date(lpad(j,2,0) || lpad(vmes,2,0) || vyear, 'ddmmyyyy');
    if to_char(fx, 'w')!= week_day then
         week_day := to_char(fx, 'w');
         dbms_output.put_line('Week No.'|| week_day);
         dbms_output.put_line('-----------');          
         dbms_output.put_line('Week_Day     Date     Day');
         dbms_output.put_line('---------------------------');
    end if;
         num_day := to_char(fx, 'd');
         dbms_output.put_line(
              to_char(fx, 'Day') || chr(9) ||
              to_char(fx, 'dd/mm') || chr(9) ||
              to_char(fx, 'dd-Mon-yy') || chr(9) ||
              to_char(fx, 'dd')
    end loop;
    end;
    Sep-2007
    Week No.1
    Week_Day Date Day
    Saturday 01/09 01-Sep-07 01
    Sunday 02/09 02-Sep-07 02
    Monday 03/09 03-Sep-07 03
    Tuesday 04/09 04-Sep-07 04
    Wednesday 05/09 05-Sep-07 05
    Thursday 06/09 06-Sep-07 06
    Friday 07/09 07-Sep-07 07
    Week No.2
    Week_Day Date Day
    Saturday 08/09 08-Sep-07 08
    Sunday 09/09 09-Sep-07 09
    Monday 10/09 10-Sep-07 10
    Tuesday 11/09 11-Sep-07 11
    Wednesday 12/09 12-Sep-07 12
    Thursday 13/09 13-Sep-07 13
    Friday 14/09 14-Sep-07 14
    Week No.3
    Week_Day Date Day
    Saturday 15/09 15-Sep-07 15
    Sunday 16/09 16-Sep-07 16
    Monday 17/09 17-Sep-07 17
    Tuesday 18/09 18-Sep-07 18
    Wednesday 19/09 19-Sep-07 19
    Thursday 20/09 20-Sep-07 20
    Friday 21/09 21-Sep-07 21
    Week No.4
    Week_Day Date Day
    Saturday 22/09 22-Sep-07 22
    Sunday 23/09 23-Sep-07 23
    Monday 24/09 24-Sep-07 24
    Tuesday 25/09 25-Sep-07 25
    Wednesday 26/09 26-Sep-07 26
    Thursday 27/09 27-Sep-07 27
    Friday 28/09 28-Sep-07 28
    Week No.5
    Week_Day Date Day
    Saturday 29/09 29-Sep-07 29
    Sunday 30/09 30-Sep-07 30
    With weeks of years
    declare
    vyear number:=2007;
    vmes number := 9;
    vdays number;
    week_day number:=0;
    num_day number:=0;
    fx date;
    begin
    vdays := to_char(last_day(to_date(vmes, 'mm')), 'dd');
    dbms_output.put_line(to_char(to_date(vmes, 'mm'), 'Mon') || '-' || vyear);
    for j in 1..vdays loop
         fx := to_date(lpad(j,2,0) || lpad(vmes,2,0) || vyear, 'ddmmyyyy');
    if to_char(fx, 'ww')!= week_day then
         week_day := to_char(fx, 'ww');
         dbms_output.put_line('Week No.'|| week_day);
         dbms_output.put_line('-----------');          
         dbms_output.put_line('Week_Day     Date     Day');
         dbms_output.put_line('---------------------------');
    end if;
         num_day := to_char(fx, 'd');
         dbms_output.put_line(
              to_char(fx, 'Day') || chr(9) ||
              to_char(fx, 'dd/mm') || chr(9) ||
              to_char(fx, 'dd-Mon-yy') || chr(9) ||
              to_char(fx, 'dd')
    end loop;
    end;
    Sep-2007
    Week No.35
    Week_Day Date Day
    Saturday 01/09 01-Sep-07 01
    Sunday 02/09 02-Sep-07 02
    Week No.36
    Week_Day Date Day
    Monday 03/09 03-Sep-07 03
    Tuesday 04/09 04-Sep-07 04
    Wednesday 05/09 05-Sep-07 05
    Thursday 06/09 06-Sep-07 06
    Friday 07/09 07-Sep-07 07
    Saturday 08/09 08-Sep-07 08
    Sunday 09/09 09-Sep-07 09
    Week No.37
    Week_Day Date Day
    Monday 10/09 10-Sep-07 10
    Tuesday 11/09 11-Sep-07 11
    Wednesday 12/09 12-Sep-07 12
    Thursday 13/09 13-Sep-07 13
    Friday 14/09 14-Sep-07 14
    Saturday 15/09 15-Sep-07 15
    Sunday 16/09 16-Sep-07 16
    Week No.38
    Week_Day Date Day
    Monday 17/09 17-Sep-07 17
    Tuesday 18/09 18-Sep-07 18
    Wednesday 19/09 19-Sep-07 19
    Thursday 20/09 20-Sep-07 20
    Friday 21/09 21-Sep-07 21
    Saturday 22/09 22-Sep-07 22
    Sunday 23/09 23-Sep-07 23
    Week No.39
    Week_Day Date Day
    Monday 24/09 24-Sep-07 24
    Tuesday 25/09 25-Sep-07 25
    Wednesday 26/09 26-Sep-07 26
    Thursday 27/09 27-Sep-07 27
    Friday 28/09 28-Sep-07 28
    Saturday 29/09 29-Sep-07 29
    Sunday 30/09 30-Sep-07 30

  • Date output comes out DDMMYYYY instead of MMDDYYYY? Hint on fixing this?

    Hi,
    1. If my date output comes out as DDMMYYYY, where in my infoojbect shipdate, can I modify it to come out as MMDDYYYY?
    2. While on this, how do I add a new Unit in my flat file transaction data to 0UNIT?
    3. Also, the Price column comes out as 25,00 instead of 25.00  i.e. the decimals are coming out as commas, any help?
    Thanks
    Edited by: AmandaBaah on Apr 23, 2010 9:47 PM

    Hi AmandaBaah,
    Not sure about this, but this is what I would try:
    Regarding 1 and 3:
    Try to check on SU01D for your Username, check de Default tab.
    Date format
    Decimal Notation
    Regarding: 2
    Normally 0UNIT are filled up via Source system. But, you can try to use transaction CUNI
    (SPRO -> SAP NetWeaver -> General Settings -> Check Units of Measurement)
    Hope it helps,
    Marcelo

  • Express DAQ data output to two numerical indicators

    Hi,
    I'm a complete Labview newbie, so apologies if this is a really obvious question, but after reading through pages of documentation I still can't get anywhere.
    I'm using a PCI 6220 data acquisition card, and want to measure 2 independant currents, outputting each value on a seperate numeric indicator.
    I used the DAQ assistant, and set up the two signals without too much trouble in the box that appears when you double click the assistant. If I connect the data output on the box diagram to a graph indicator, I can see both signals fine, but I would much prefer a numeric indicator for each signal. I can connect one, and that works fine: displaying the first current measurement I defined, but I can't see any way to get the second current measurement displayed in the same manner.
    All help welcome!
    Thank you

    I've attached a screenshot of the VI and the DAQ assistant configuration window thing - hopefully this helps explain what I mean(!)
    I don't seem to be able to choose a channel for the numeric indicator?
    Attachments:
    VI_screenshot1.jpg ‏366 KB
    daq_assist screenshot1.jpg ‏146 KB

  • Not able to flush the data output stream in n/w prg.

    Hi,
    I am trying to send and receive the data using TCP/IP channel using socket programming.
    Following is the server side code I have
    Socket socket = server_socket.accept();
    OutputStream output = socket.getOutputStream();
    BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String inputMessage = (String) input.readLine();
    System.out.println(inputMessage);
    output.write("Message from server");
    output.flush();I am able to receive the message from the client and as per the code the message is getting printed in the console. But I am unable to send the message back to the Client inspite of flushing the output stream.
    I am sure that the problem is because of the flush method which is not acutally flushing the data. If I use the "println" method instead of the write & flush method, everything seems to be working fine. I do not want to use the "println" method because I get an extra new line character in the msg I send to the Client.
    Any help on this is appreciated!

    No. I am not using BufferedReader to listen for the server response. Given below is my client side code.
    Socket socket = new Socket(<ip>, <port>);
    InputStream input = socket.getInputStream();
    PrintWriter output = new PrintWriter(socket.getOutputStream(),true);
    output.println("Request from the client");
    System.out.println("Waiting for the server response...");
    byte buffer[] = new byte[2000];
    input.read(buffer);
    System.out.println(new String(byte));I am not receiving the message from server, it hangs on "Waiting for the server response..".

  • 1)form to capture data 2) massage data/output 3) import data from Step 2 to PDF FORM 4) save for download

    I have a project that entails tax forms from the IRS  -- I know everyone's favorite stuff.
    1)I need to setup a form that asks the webusers questions regarding their personal tax information -
    2) then validate/massage that data/information and determine what PDF form template to output this data to. (possibly output to 4 forms determined by users response)
    3) output the data collected in step 1 to the correct PDF template/form example template= http://www.irs.gov/pub/irs-pdf/f1040.pdf  - applying the data to the correct fields - bascially filling out the users name, address, calculations etc.
    4)allow the user to save/print/download the produced form in step 3
    I know I am not the first person to need this functionality. Can you please simply answer my question - can this be done?  Does it require software from other companies, or is this something that can be accomplished with just adobe products?  If so, can you point me to some tutorials that show me the necessary process to do this?
    I very much appreciate any support you can provide me - I need to start on this project yesterday.
    Thanks in advance for your time.

    In your PHP code, change this -
    $editFormAction = $_SERVER['PHP_SELF'];
    to this -
    ?>
    <?php
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "registreren")) {
    // add your captcha verification code here ....
    // captcha most likely ends with a header command to relocate failed attempts, so make sure you add
    // an exit() command after that header.  Otherwise, allow the successful captcha to fall into the following
    // block of code.
    // don't ignore that closing brace
    ?>
    <?php
    $editFormAction = $_SERVER['PHP_SELF'];

Maybe you are looking for