Data Input into a Wizard

Dear Fellow Developers:
I am currently developing a wizard that receives data inputted from a user. At a few points in the process, the wizard requires the user to input several pieces of data in one step, as part of a loop.
For example:
A wizard asks the user, how many friends do you have? The user then inputs an int into a textfield. Based on that number, the next panel then prompts the user to input the names of his/her friends. I don't want to create a panel with a single textfield which corresponds to each friend that the user has, so that if the user said they had ten friends, ten panels are created, allowing the user to enter one name in each panel. I want a SINGLE panel to follow the step where the user is prompted for the number of friends, and regardless of the number entered, the user will be able to enter ALL the names of his/her friends on a SINGLE panel that follows. HOW DO I ACHIEVE THIS IN SWING, AND IS DYNAMIC SO THAT THE NUMBER DOES NOT MATTER, WHATEVER NUMBER IS ENTERED IN THE FIRST PANEL, THE SECOND PANEL WILL ALLOW THE USER TO ENTER THAT MANY NAMES WITHOUT ANY PROBLEMS???
I sincerely apologize for taking up your time, and I thank everyone who responds.
I hope I will be able to reciprocate the generosity that is extended to me by everyone that responds.
Take care, and I wish all developers success in their work.
Sincerely;
Fayyaz

A suggestion: any time you need useability ideas, simply look at how other polished apps acheive the effect you want. On Windows, play with all the Control Panel dialogs.

Similar Messages

  • Query for data input into IncoCube (Non Integrated Planning)

    Hello Gurus,
    i was trying to search over the internet how to make a query ready for input, but without using integrated planning, but no luck.
    I want to make a bex query (specific form) which could be filled with data by simple user, and then on button click sent to BW InfoCube.
    Is it at all possible or not?
    Thanks and Regards

    Hi,
    Thanks for quick responce.
    So basically what you are saying is that only IP anables me to enter the data through BEX.
    Regards
    Laurynas

  • How to cast a String input into Date variable?

    I am using JOptionPane.showInputDialog to ask user for a date input. This will be read in as a String. I need to pass it to a variable call date. And when I print date using JOptionPane, it should be shown as whatever the user keyed in in this format: 25/2/09. How do I do it?

    By the way, that's not casting. Casting is when you have a variable whose type is at a particular level of detail, and you assign it a different level of detail -- say, casting an int to a long, or a List to an ArrayList.
    What you want to do is convert one type to a completely different one. In particular, you're going to do that by using SimpleDateFormat to parse the String -- that is, SimpleDateFormat will read the string, pick out the individual parts that express the date, and create a Date object that corresponds to it.

  • Input needed for writing data back into BW/ECC data

    Hello Everyone,
    Can anyone please let me know an example or process you have used for writing data back into BW (DSO/Cubes) or ECC systems.
    We do not have integrated planning in our current system configuration currently.
    So, any sample code for using any of the BAPI/RFC for writing data would be appreciated.
    Also, I am trying to find out if there is any way to schedule the models developed in VC 7.1 in background to automate certain type of data processing which goes across multiple systems.
    Any help would be appreciated.
    Thanks.

    Hello,
    Can anyone please help me out on this one....
    I am aware of few BAPI's such as RSDRI_ODSO_INSERT_RFC but I am not aware of what action has to be used to transfer the data from the table within VC to this BAPI and how to define the parameters as the one's available for the BAPI I mentioned do not fit into the data I have in the table within VC.
    The following are the columns I have in the table within VC,
    1. GL Account
    2. Credit Amount
    3. Debit Amount
    4. Sales Amount
    I have defined the DSO with the same where G/L Account is the keyfield and the rest being data fields.
    Any help would be really appreciated.
    Thanks.

  • How to save User input into DB using webdynpro abap

    Hi,
    Im trying to create an application using webdynpro abap.
    I want to know how to save the data input by user, into a database table.
    In my UI, I have a table control which is editable and user inputs data into this. I need to know how i can transfer this data to a DB table.

    hello,
    u can do it by reading ur context node.
    we bind our UI elements to context attributes of appropriate type .
    we read their values using the code wizard or by pressing control+F7, click on radio button read node/attribute
    here for ur specific case , u must have binded ur table control with the context attribute , now u need to simply read this attribute
    eg suppose u have created a context node " cn_table"
      reading context node cn_table
       DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
             lo_el_cn_table TYPE REF TO if_wd_context_element ,
             ls_cn_table    TYPE wd_this->element_cn_table.
    *   navigate from <CONTEXT> to <CN_TABLE> via lead selection
      lo_nd_cn_table = wd_context->get_child_node(
                       name = wd_this->wdctx_cn_table ).
    **    get element via lead selection
      lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
      lo_el_cn_table->get_static_attributes( IMPORTING
                 static_attributes = wa_table ).
    here wa_table is the work area of structure type . u need to create a structure first with the same variables as there are the context attributes in ur node cn_table
    in ur
    now ur wa_tablecontains value
    u can nw use appropriate FM to update , delete and modify the DB table using the value
    u cn directly use SQL statements as well in the method of ur view , but direct SQL statements are nt recommende
    rgds,
    amit

  • Error in saving  large value with the data input query

    Hi,
       I  am  trying to save a large value in 0Quantity using the data input query into a realtime infocube
    e-g
    123456789.1234
    Error says too many digits.
    When i try to save 8 digits before the decimal point ,no error, if it is 9digits before decimal it's thro' error.
    Is there any limitation before the decimal.
    i know that 0Quantity can take 17 digits including the sign.
    Any suggestions.?
    regards,
    ram

    try budgetting in thousands in stead of units? (setting on query itself)
    D

  • Saving data typed into a PDF

    Hi folks,
    There's probably a million questions like this one but I can't concentrate enough right now to try to go through everything.
    I made a list in Excel, exported it as a PDF.
    Opened in Adobe Acrobat 9 Pro.
    Went through the Start Form Wizard, all worked nicely, put all my check boxes and fields in where I wanted.
    Save it - and then open it in Adobe Reader.
    "You cannot save data typed into this form.  Please print your completed form if you would like a copy for your records."
    After some careful googling, I discover to be able to make a form that is savable, I need Adobe LiveCycle.  So I scout around on my work computer and discover I do in fact have LiveCyle Designer ES 8.2.
    Now what?  I do not know what I'm meant to tick in this program to make my PDF savable by other people.
    I appreciate your time and patience!  Hopefully it's a super easy question and that I feel like an idiot for asking
    Kind regards,
    --Sasha

    Hi Sasha,
    Using Acrobat, you can create forms that are called AcroForms. The forms created in LC Designer are called XFA (XML Forms Architecture) and are more data centric. While both will open in Acrobat, they are completely different animals.
    The issue with users not being able to save the data with Reader is that the form is not Reader Enabled. You can Reader Enable a form using one of two methods:
    Reader Enable the form using Acrobat Professional (V8 or below) or Acrobat Standard (V9 or above). Note there are licensing restrictions.
    Reader Enable the form using the full server product Adobe LiveCycle Reader Extensions ES2.5. This involves additional licensing fees.
    Have a look here: http://assure.ly/etkFNU, at the features that are available depending on whether the user has Acrobat or Reader; if the form is Reader Enabled; and how the form was Reader Enabled.
    The issue of Reader Enabling would also apply to AcroForms.
    I don't think that you need to dive into LC Designer just yet, as forms created in LC Designer face the same issues about Reader Enabling as forms developed in Acrobat.
    If your usage complies with the EULA, then you could Reader Enable your form in Acrobat.
    Hope that helps,
    Niall

  • Data load into SAP ECC from Non SAP system

    Hi Experts,
    I am very new to BODS and I have want to load historical data from non SAP source system  into SAP R/3 tables like VBAK,VBAP using BODS, Can you please provide steps/documents or guidelines on how to achieve this.
    Regards,
    Monil

    Hi
    In order to load into SAP you have the following options
    1. Use IDocs. There are several standard IDocs in ECC for specific objects (MATMAS for materials, DEBMAS for customers, etc., ) You can generate and send IDocs as messages to the SAP Target using BODS.
    2. Use LSMW programs to load into SAP Target. These programs will require input files generated in specific layouts generated using BODS.
    3. Direct Input - The direct input method is to write ABAP programs targetting on specific tables. This approach is very complex and hence a lot of thought process needs to be applied.
    The OSS Notes supplied in previous messages are all excellent guidance to steer you in the right direction on the choice of load, etc.,
    However, the data load into SAP needs to be object specific. So targetting merely the sales tables will not help as the sales document data held in VBAK and VBAP tables you mentioned are related to Articles. These tables will hold sales document data for already created articles. So if you want to specifically target these tables, then you may need to prepare an LSMW program for the purpose.
    To answer your question on whether it is possible to load objects like Materials, customers, vendors etc using BODS, it is yes you can.
    Below is a standard list of IDocs that you can use for this purpose to load into SAP ECC system from a non SAP system.
    Customer Master - DEBMAS
    Article Master - ARTMAS
    Material Master - MATMAS
    Vendor Master - CREMAS
    Purchase Info Records (PIR) - INFREC
    The list is endless.........
    In order to achieve this, you will need to get the functional design consultants to provide ETL mapping for the legacy data to IDoc target schema and fields (better to ahve sa tech table names and fields too). You should then prepare the data after putting it through the standard check table validations for each object along with any business specific conversion rules and validations applied. Having prepared this data, you can either generate flat file output for load into SAP using LSMW programs or generate IDoc messages to the target SAPsystem.
    If you are going to post IDocs directly into SAP target using BODS, you will need to create a partner profile for BODS to send IDocs and define the IDocs you need as inbound IDocs. There are few more setings like RFC connectivity, authorizations etc, in order for BODS to successfully send IDocs into the SAP Target.
    Do let me know if you need more info on any specific queries or issues you may encounter.
    kind regards
    Raghu

  • Geting an error trying to import a data file into OWB repository

    Hi,
    We're using OWB 11.1.0.7.0
    I'm trying to import a new data file and I'm getting an error.
    When I go to The Project/Files/ I right click on the module I want to add the files to,
    I get a 'Wizard' titled 'Welcome to the Import Metadata Wizard'.
    I click next.
    I get the 'Filter Information' screen that asks if I want to select 'All Data Files' or a specific file.
    I pick 'All Data Files' and click 'next'.
    I get the 'Object Selection' screen that has a left and right panel. The left side is titled 'Available' and the right side is titled Selected.
    The 'Available' panel had the directory in Linux (/etl/datafeeds/dev) where our data files are stored with a plus sign next to it.
    When I click the plus sign, I get an error message that says:
    API2836: Directory
    /etl/datafeeds/dev does not exist.Has anyone seen this? What is the work around? Is it a bug? How do I import a data file into OWB if this isn't the way to do it?
    Thanks,

    Hi, is there any obligation to use import wizard?
    can you use right click and import view/table?
    Ugur MIHCI
    www.ifslibrary.com

  • Date input & differences between MX & CS

    Have got several forms that I use & they all input dates, all ASP VB. The ones that I have created in dreammweaver MX input the date in the correct, UK format for me. eg: dd-mm-yy
    If I create in CS3 or CS5.5 dates appear in US format eg: mm-dd-yy
    If I just enter <% Response.Write(Date()) %> the webpage will display 05/12/2013 which is correct. My conclusion from this is that LCID & computer settings are correct because date is displayed in correct UK format.
    If I enter <% Response.Write(Date()) %> into a form field & insert this into a Access database it is entered as 12-05-13, 12th May in UK format. Dreamweaver is entering incorrectly & I can't see why. I have looked at many forums, discussion pages etc but can't find anything that explains why MX enters date correctly but CS doesn't.
    Can anyone please offer any suggestions, many thanks in advance.

    attached are 2 sample pages, one created in CS, one in MX.
    MX version:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="Connections/MOcopy.asp" -->
    <%
    ' *** Edit Operations: declare variables
    Dim MM_editAction
    Dim MM_abortEdit
    Dim MM_editQuery
    Dim MM_editCmd
    Dim MM_editConnection
    Dim MM_editTable
    Dim MM_editRedirectUrl
    Dim MM_editColumn
    Dim MM_recordId
    Dim MM_fieldsStr
    Dim MM_columnsStr
    Dim MM_fields
    Dim MM_columns
    Dim MM_typeArray
    Dim MM_formVal
    Dim MM_delim
    Dim MM_altVal
    Dim MM_emptyVal
    Dim MM_i
    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
      MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
    End If
    ' boolean to abort record edit
    MM_abortEdit = false
    ' query string to execute
    MM_editQuery = ""
    %>
    <%
    ' *** Insert Record: set variables
    If (CStr(Request("MM_insert")) = "form1") Then
      MM_editConnection = MM_MOcopy_STRING
      MM_editTable = "mxDate"
      MM_editRedirectUrl = ""
      MM_fieldsStr  = "dateFld|value"
      MM_columnsStr = "dateEntry|',none,NULL"
      ' create the MM_fields and MM_columns arrays
      MM_fields = Split(MM_fieldsStr, "|")
      MM_columns = Split(MM_columnsStr, "|")
      ' set the form values
      For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
        MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
      Next
      ' append the query string to the redirect URL
      If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
        If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
          MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
        Else
          MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
        End If
      End If
    End If
    %>
    <%
    ' *** Insert Record: construct a sql insert statement and execute it
    Dim MM_tableValues
    Dim MM_dbValues
    If (CStr(Request("MM_insert")) <> "") Then
      ' create the sql insert statement
      MM_tableValues = ""
      MM_dbValues = ""
      For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
        MM_formVal = MM_fields(MM_i+1)
        MM_typeArray = Split(MM_columns(MM_i+1),",")
        MM_delim = MM_typeArray(0)
        If (MM_delim = "none") Then MM_delim = ""
        MM_altVal = MM_typeArray(1)
        If (MM_altVal = "none") Then MM_altVal = ""
        MM_emptyVal = MM_typeArray(2)
        If (MM_emptyVal = "none") Then MM_emptyVal = ""
        If (MM_formVal = "") Then
          MM_formVal = MM_emptyVal
        Else
          If (MM_altVal <> "") Then
            MM_formVal = MM_altVal
          ElseIf (MM_delim = "'") Then  ' escape quotes
            MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
          Else
            MM_formVal = MM_delim + MM_formVal + MM_delim
          End If
        End If
        If (MM_i <> LBound(MM_fields)) Then
          MM_tableValues = MM_tableValues & ","
          MM_dbValues = MM_dbValues & ","
        End If
        MM_tableValues = MM_tableValues & MM_columns(MM_i)
        MM_dbValues = MM_dbValues & MM_formVal
      Next
      MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
      If (Not MM_abortEdit) Then
        ' execute the insert
        Set MM_editCmd = Server.CreateObject("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_editConnection
        MM_editCmd.CommandText = MM_editQuery
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        If (MM_editRedirectUrl <> "") Then
          Response.Redirect(MM_editRedirectUrl)
        End If
      End If
    End If
    %>
    <%
    Dim rsDate
    Dim rsDate_numRows
    Set rsDate = Server.CreateObject("ADODB.Recordset")
    rsDate.ActiveConnection = MM_MOcopy_STRING
    rsDate.Source = "SELECT * FROM mxDate ORDER BY ID DESC"
    rsDate.CursorType = 0
    rsDate.CursorLocation = 2
    rsDate.LockType = 1
    rsDate.Open()
    rsDate_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    Repeat1__numRows = 10
    Repeat1__index = 0
    rsDate_numRows = rsDate_numRows + Repeat1__numRows
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>MX dates</title>
    </head>
    <body>
    <form name="form1" method="POST" action="<%=MM_editAction%>">
      <p>
        <input name="dateFld" type="text" id="dateFld" value="<% Response.Write(Date()) %>">
        <input type="submit" name="Submit" value="Submit">
    </p>
      <table width="400" border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td>ID</td>
          <td>Date</td>
        </tr>
        <%
    While ((Repeat1__numRows <> 0) AND (NOT rsDate.EOF))
    %>
        <tr>
          <td><%=(rsDate.Fields.Item("ID").Value)%></td>
          <td><%=(rsDate.Fields.Item("dateEntry").Value)%></td>
        </tr>
        <%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rsDate.MoveNext()
    Wend
    %>
        </table>
      <p>basic date:
        <% Response.Write(Date()) %>
    </p>
      <p>long date:
          <% response.write(FormatDateTime(date(),vblongdate)) %>
      </p>
      <p>   </p>
      <input type="hidden" name="MM_insert" value="form1">
    </form>
    </body>
    </html>
    <%
    rsDate.Close()
    Set rsDate = Nothing
    %>
    =========================================================================================
    CS version:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!--#include file="Connections/MOcopy.asp" -->
    <%
    Dim MM_editAction
    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
      MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
    End If
    ' boolean to abort record edit
    Dim MM_abortEdit
    MM_abortEdit = false
    %>
    <%
    ' IIf implementation
    Function MM_IIf(condition, ifTrue, ifFalse)
      If condition = "" Then
        MM_IIf = ifFalse
      Else
        MM_IIf = ifTrue
      End If
    End Function
    %>
    <%
    If (CStr(Request("MM_insert")) = "form1") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_MOcopy_STRING
        MM_editCmd.CommandText = "INSERT INTO CSdate (dateEntry) VALUES (?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 135, 1, -1, MM_IIF(Request.Form("dateFld"), Request.Form("dateFld"), null)) ' adDBTimeStamp
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        ' append the query string to the redirect URL
        Dim MM_editRedirectUrl
        MM_editRedirectUrl = "CSdate.asp"
        If (Request.QueryString <> "") Then
          If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
            MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
          Else
            MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
          End If
        End If
        Response.Redirect(MM_editRedirectUrl)
      End If
    End If
    %>
    <%
    Dim rsDate
    Dim rsDate_cmd
    Dim rsDate_numRows
    Set rsDate_cmd = Server.CreateObject ("ADODB.Command")
    rsDate_cmd.ActiveConnection = MM_MOcopy_STRING
    rsDate_cmd.CommandText = "SELECT * FROM CSdate ORDER BY ID ASC"
    rsDate_cmd.Prepared = true
    Set rsDate = rsDate_cmd.Execute
    rsDate_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Dim Repeat1__index
    Repeat1__numRows = 10
    Repeat1__index = 0
    rsDate_numRows = rsDate_numRows + Repeat1__numRows
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>CS dates</title>
    </head>
    <body>
    <form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
      <p>
        <label for="dateFld"></label>
        <input name="dateFld" type="text" id="dateFld" value="<% Response.Write(Date()) %>" />
        <input type="submit" name="submit" id="submit" value="Submit" />
      </p>
      <table width="400" border="1" cellspacing="0" cellpadding="0">
        <tr>
          <td>ID</td>
          <td>Date</td>
        </tr>
        <%
    While ((Repeat1__numRows <> 0) AND (NOT rsDate.EOF))
    %>
      <tr>
        <td><%=(rsDate.Fields.Item("ID").Value)%></td>
        <td><%=(rsDate.Fields.Item("dateEntry").Value)%></td>
      </tr>
      <%
      Repeat1__index=Repeat1__index+1
      Repeat1__numRows=Repeat1__numRows-1
      rsDate.MoveNext()
    Wend
    %>
      </table>
      <p>basic date:
        <% Response.Write(Date()) %>
      </p>
      <p>long date:
        <% response.write(FormatDateTime(date(),vblongdate)) %>
      </p>
      <p>  </p>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    </body>
    </html>
    <%
    rsDate.Close()
    Set rsDate = Nothing
    %>

  • Format code cannot appear in date input format - IW related

    Hi,
    please explain what I'm doing wrong:
    SQL>  select to_char(sysdate, 'YYYY-IW') from  dual;
    TO_CHAR
    2010-48
    SQL>  select to_date('2010-22', 'YYYY-IW') from  dual;
    select to_date('2010-22', 'YYYY-IW') from  dual
    ERROR at line 1:
    ORA-01820: format code cannot appear in date input formatOracle 9.2 .
    Regards.
    Greg

    FIrst of all you should stay with the date format. Instead of converting it into a string you could TRUNCATE it to the first day of the Iso-Wekk.
    And to enable index usage you just have to put a certain range on your queries.
    example
    select *
    from t
    where col_date  >= trunc(sysdate, 'IW')  ;if col_date can hold values that are greater than syste. Or if you use another date value to compare than sysdate. Then you need to compare with a range. Just like this
    select *
    from t
    where col_date  >= trunc(sysdate, 'IW') 
    and col_date  < trunc(sysdate, 'IW')+7 ;If you want to input a certain WEEK and get all entries from that week you can start with the first day of the iso-Year and add the number of weeks to it.
    example using iso-Week 40
    select *
    from t
    where col_date  >= trunc(sysdate, 'IYYY')  + 7 * 40
    and col_date  < trunc(sysdate, 'IYYY')+7 * (40 +  1);However calendar arithmetic is complex. We have to be careful for special cases. For example the beginning of the ISO-Year 2011 is the 3rd Jan 2011. So if we run this logic on the first or second of January *2011* we would get the calendar week 40 from *2010*. This is probably not what you want.
    To take this into account we must make sure that we are using the proper year. There are several possibilities how to do it. In this case I choose to use the normal TRUNC to get the first day of the normal year (1.1.2011) then add a week and truncate again.
    example
    select *
    from t
    where col_date  >= trunc(trunc(sysdate,'YYYY)+7, 'IYYY')  + 7 * 40
    and col_date  < trunc(trunc(sysdate,'YYYY)+7, 'IYYY')+7 * (40 +  1);Edited by: Sven W. on Dec 3, 2010 8:52 AM

  • Date Range: Select which Qtr a date falls into

    Hi All
    I am looking for some code that takes a date passed into a variable and calculates which Quarter it is in.
    My client uses Quarters:
    Feb - Apr (Q1)
    May - Jul (Q2)
    Aug - Oct (Q3)
    Nov - Jan (Q4)
    So, if I pass a date of 21-Mar-2007 into the Variable, the code takes the date, calculates that the date is in Q1 and then returns the date of 200702 (the YEAR/ MONTH of the First Month in the Quarter) into the BW report.
    I have searched the forums and can't find anything that would work, so you help is much appreciated.
    DG

    Hi Ajay
    Thanks very much for your response.
    I'm having a few difficulties getting the code to work in our environment, so was hoping you could help me tune it.
    Input is Current Month
    Output is First Month of Current Quarter
    So, using this code, how can I pass the input date into the code?
    (I'm sorry if this is obvious, I'm really new to SAP Development, so the answer may be and most probably is really obvious)

  • Triggering input into a MIO-16XE-50 using a DIO-96

    Hi there,
    I was wondering if anyone knows how to trigger input into an MIO16XE50 using a DIO-96 card. I want to send out a digital pulse to a BNC-2090 that is connected to both the MIO16XE50 and the DIO96 using the DIO96 card. After this digital pulse, I want to collect data before the trigger and after. I am using NIDAQ Tools for Igor Pro to acquire data from the MIO16XE50 and I am using MatLab to send the trigger pulse from the DIO96. Should I use the external trigger option in NIDAQ Tools, or is there a better way to do it? Thanks a lot!
    Arul Thangavel

    Arul;
    The best way to go about that is to set a digital trigger analog input acquisition, and have the trigger channel to be PFI0. Then, you need to make the digital trigger pulse to be wired to the PFI0 pin of your DAQ device connector.
    You can also configure your Software to acquire some points before the trigger. It will acquire data after the trigger by default. The parameter you need to set to acquire data before the trigger is "pre-trigger number of points".
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • In Pages, how to insert a PRINT-DATE field into a doc.?

    Want to insert a field that will show the date of the doc's printing. 
    In MS Word, this is known as 'insert print date'.
    How to do so in Pages?  Thanks.

    You can define placeholder text in Pages v5.5.2 in any of the six header/footer sections. Think of it as a a field code that when you click on it the text you enter replaces the placeholder text using the same style. By example, I placed a combination of text and placeholder text in the lower left footer segment.
    The text and the brackets were selected, and then Format ▸ Advanced ▸ Define as Placeholder Text. Also, because it is in the footer, it is replicated throughout the document. Although you could Insert > Date/Time into this placeholder text, automation may be preferred. I have chosen to use the same date/time style as MS Word uses in its print date field code. You can only change placeholder text programmatically with Pages and AppleScript on Yosemite. Once I run the AppleScript, all placeholder tags are replaced as shown in this image:
    You could make this an Automator Service (e.g. run AppleScript action with no input, and output replacement is checked). One could assign a keyboard shortcut to this service too. One click printed date stamp and document sent to default printer.
    The AppleScript (Yosemite only).
    property tagStr : "[print-date]"
    --- used for testing ---
    -- set f to POSIX path of ((path to desktop) as text) & "arg.pages"
    -- set hf to POSIX file f as alias
    set printDate to "" as text
    set theTags to {}
    tell application "Pages"
          activate
          -- open hf
          tell front document
               set theTags to the tag of every placeholder text whose tag is equal to tagStr
               -- Word print-date field code uses this 12-hour date/time format as mm/dd/YY 00:00 AM/PM
               set printDate to do shell script ("/bin/date +'%D %l:%M %p'") as text
               repeat with i from 1 to count of theseTags
                     set thisTag to item i of theseTags
                     set (every placeholder text whose tag is thisTag) to printDate
               end repeat
               -- use your own System Preferences printer name string
               tell application "Samsung ML-2950 Series (Sammy)"
               activate
               -- no print dialog
                    print front document without «class pdlg»
                    quit
               end tell
          end tell
          -- close front document saving no
    end tell

  • Aggregating data loaded into different hierarchy levels

    I have some problems when i try to aggregate a variable called PRUEBA2_IMPORTE dimensinated by time dimension (parent-child type).
    I read the help in DML Reference of the OLAP Worksheet and it said the follow:
    When data is loaded into dimension values that are at different levels of a hierarchy, then you need to be careful in how you set status in the PRECOMPUTE clause in a RELATION statement in your aggregation specification. Suppose that a time dimension has a hierarchy with three levels: months aggregate into quarters, and quarters aggregate into years. Some data is loaded into month dimension values, while other data is loaded into quarter dimension values. For example, Q1 is the parent of January, February, and March. Data for March is loaded into the March dimension value. But the sum of data for January and February is loaded directly into the Q1 dimension value. In fact, the January and February dimension values contain NA values instead of data. Your goal is to add the data in March to the data in Q1. When you attempt to aggregate January, February, and March into Q1, the data in March will simply replace the data in Q1. When this happens, Q1 will only contain the March data instead of the sum of January, February, and March. To aggregate data that is loaded into different levels of a hierarchy, create a valueset for only those dimension values that contain data. DEFINE all_but_q4 VALUESET time
    LIMIT all_but_q4 TO ALL
    LIMIT all_but_q4 REMOVE 'Q4'
    Within the aggregation specification, use that valueset to specify that the detail-level data should be added to the data that already exists in its parent, Q1, as shown in the following statement. RELATION time.r PRECOMPUTE (all_but_q4)
    How to do it this for more than one dimension?
    Above i wrote my case of study:
    DEFINE T_TIME DIMENSION TEXT
    T_TIME
    200401
    200402
    200403
    200404
    200405
    200406
    200407
    200408
    200409
    200410
    200411
    2004
    200412
    200501
    200502
    200503
    200504
    200505
    200506
    200507
    200508
    200509
    200510
    200511
    2005
    200512
    DEFINE T_TIME_PARENTREL RELATION T_TIME <T_TIME T_TIME_HIERLIST>
    -----------T_TIME_HIERLIST-------------
    T_TIME H_TIME
    200401 2004
    200402 2004
    200403 2004
    200404 2004
    200405 2004
    200406 2004
    200407 2004
    200408 2004
    200409 2004
    200410 2004
    200411 2004
    2004 NA
    200412 2004
    200501 2005
    200502 2005
    200503 2005
    200504 2005
    200505 2005
    200506 2005
    200507 2005
    200508 2005
    200509 2005
    200510 2005
    200511 2005
    2005     NA
    200512 2005
    DEFINE PRUEBA2_IMPORTE FORMULA DECIMAL <T_TIME>
    EQ -
    aggregate(this_aw!PRUEBA2_IMPORTE_STORED using this_aw!OBJ262568349 -
    COUNTVAR this_aw!PRUEBA2_IMPORTE_COUNTVAR)
    T_TIME PRUEBA2_IMPORTE
    200401 NA
    200402 NA
    200403 2,00
    200404 2,00
    200405 NA
    200406 NA
    200407 NA
    200408 NA
    200409 NA
    200410 NA
    200411 NA
    2004 4,00 ---> here its right!! but...
    200412 NA
    200501 5,00
    200502 15,00
    200503 NA
    200504 NA
    200505 NA
    200506 NA
    200507 NA
    200508 NA
    200509 NA
    200510 NA
    200511 NA
    2005 10,00 ---> here must be 30,00 not 10,00
    200512 NA
    DEFINE PRUEBA2_IMPORTE_STORED VARIABLE DECIMAL <T_TIME>
    T_TIME PRUEBA2_IMPORTE_STORED
    200401 NA
    200402 NA
    200403 NA
    200404 NA
    200405 NA
    200406 NA
    200407 NA
    200408 NA
    200409 NA
    200410 NA
    200411 NA
    2004 NA
    200412 NA
    200501 5,00
    200502 15,00
    200503 NA
    200504 NA
    200505 NA
    200506 NA
    200507 NA
    200508 NA
    200509 NA
    200510 NA
    200511 NA
    2005 10,00
    200512 NA
    DEFINE OBJ262568349 AGGMAP
    AGGMAP
    RELATION this_aw!T_TIME_PARENTREL(this_aw!T_TIME_AGGRHIER_VSET1) PRECOMPUTE(this_aw!T_TIME_AGGRDIM_VSET1) OPERATOR SUM -
    args DIVIDEBYZERO YES DECIMALOVERFLOW YES NASKIP YES
    AGGINDEX NO
    CACHE NONE
    END
    DEFINE T_TIME_AGGRHIER_VSET1 VALUESET T_TIME_HIERLIST
    T_TIME_AGGRHIER_VSET1 = (H_TIME)
    DEFINE T_TIME_AGGRDIM_VSET1 VALUESET T_TIME
    T_TIME_AGGRDIM_VSET1 = (2005)
    Regards,
    Mel.

    Mel,
    There are several different types of "data loaded into different hierarchy levels" and the aproach to solving the issue is different depending on the needs of the application.
    1. Data is loaded symmetrically at uniform mixed levels. Example would include loading data at "quarter" in historical years, but at "month" in the current year, it does /not/ include data loaded at both quarter and month within the same calendar period.
    = solved by the setting of status, or in 10.2 or later with the load_status clause of the aggmap.
    2. Data is loaded at both a detail level and it's ancestor, as in your example case.
    = the aggregate command overwrites aggregate values based on the values of the children, this is the only repeatable thing that it can do. The recomended way to solve this problem is to create 'self' nodes in the hierarchy representing the data loaded at the aggregate level, which is then added as one of the children of the aggregate node. This enables repeatable calculation as well as auditability of the resultant value.
    Also note the difference in behavior between the aggregate command and the aggregate function. In your example the aggregate function looks at '2005', finds a value and returns it for a result of 10, the aggregate command would recalculate based on january and february for a result of 20.
    To solve your usage case I would suggest a hierarchy that looks more like this:
    DEFINE T_TIME_PARENTREL RELATION T_TIME <T_TIME T_TIME_HIERLIST>
    -----------T_TIME_HIERLIST-------------
    T_TIME H_TIME
    200401 2004
    200402 2004
    200403 2004
    200404 2004
    200405 2004
    200406 2004
    200407 2004
    200408 2004
    200409 2004
    200410 2004
    200411 2004
    200412 2004
    2004_SELF 2004
    2004 NA
    200501 2005
    200502 2005
    200503 2005
    200504 2005
    200505 2005
    200506 2005
    200507 2005
    200508 2005
    200509 2005
    200510 2005
    200511 2005
    200512 2005
    2005_SELF 2005
    2005 NA
    Resulting in the following cube:
    T_TIME PRUEBA2_IMPORTE
    200401 NA
    200402 NA
    200403 2,00
    200404 2,00
    200405 NA
    200406 NA
    200407 NA
    200408 NA
    200409 NA
    200410 NA
    200411 NA
    200412 NA
    2004_SELF NA
    2004 4,00
    200501 5,00
    200502 15,00
    200503 NA
    200504 NA
    200505 NA
    200506 NA
    200507 NA
    200508 NA
    200509 NA
    200510 NA
    200511 NA
    200512 NA
    2005_SELF 10,00
    2005 30,00
    3. Data is loaded at a level based upon another dimension; for example product being loaded at 'UPC' in EMEA, but at 'BRAND' in APAC.
    = this can currently only be solved by issuing multiple aggregate commands to aggregate the different regions with different input status, which unfortunately means that it is not compatable with compressed composites. We will likely add better support for this case in future releases.
    4. Data is loaded at both an aggregate level and a detail level, but the calculation is more complicated than a simple SUM operator.
    = often requires the use of ALLOCATE in order to push the data to the leaves in order to correctly calculate the aggregate values during aggregation.

Maybe you are looking for