Coding about 'DATE_COMPUTE_DAY'

Hello,
in transfer rule I want to derive via FM 'DATE_COMPUTE_DAY' the weekday.
As I have no clue about ABAP I tried following:
DATA: l_weekd type /BIC/OIRBLWEEKD.
  CALL FUNCTION 'DATE_COMPUTE_DAY'
    EXPORTING
      date = sy-datum
    IMPORTING
      day  = l_weekd.
RESULT = l_weekd.
But with this coding no records where added.
Any idea what's wrong?

change l_weekd's type to SCAL-INDICATOR and make sure that sy-datum's date format matches with the function's input type. (se37->Display->import).
Hope this helps.

Similar Messages

  • Purchase Order Coding

    Hi All,
                 iam developing a webservice using DI-server in my asp.net application to access my sap company DB.now i have to create a purchase order...can anybody give me some web service coding about how to create a purchase order.....(like creating new customers & updating them...)
    Regads,
    Shangai.

    Hi Shangai
    Below is my sample code about how to add a jornal voucher via DIServer.
    You can add a purchase order in the similar way,the only thing need to be changed is
    the SOAP message format.
        ' add journal voucher
        '<WebMethod()> Public Function AddJV(ByVal SessionID As String, _
        '                                    ByVal xmlJVObject As String) As Xml.XmlDocument
        <WebMethod()> Public Function AddJV(ByVal SessionID As String) As Xml.XmlDocument
            Dim n As SBODI_Server.Node
            Dim s, sCmd As String
            Dim d As Xml.XmlDocument
            d = New Xml.XmlDocument
            n = New SBODI_Server.Node
            sCmd = "<?xml version=""1.0"" encoding=""UTF-16""?> "
            sCmd += "<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> "
            sCmd += " <env:Header> "
            sCmd += "<SessionID>" & CStr(SessionID) & "</SessionID>"
            sCmd += " </env:Header> "
            sCmd += " <env:Body> "
            sCmd += "<dis:AddObject xmlns:dis=""http://www.sap.com/SBO/DIS"" > "
            sCmd += "<BOM>"
            sCmd += "<BO>"
            sCmd += "<AdmInfo>"
            sCmd += "<Object>oJournalVouchers</Object> "
            sCmd += "</AdmInfo> "
            sCmd += "<JournalEntries>"
            sCmd += "<Row>"
            sCmd += "<ReferenceDate></ReferenceDate>"
            sCmd += "<Memo>TEST</Memo>"
            sCmd += "<DueDate>20080325</DueDate>"
            sCmd += "</Row>"
            sCmd += "</JournalEntries> "
            sCmd += "<JournalEntries_Lines> "
            sCmd += "<Row>"
            sCmd += "<AccountCode>111101</AccountCode> "
            sCmd += "<Debit>100</Debit>"
            sCmd += "</Row>"
            sCmd += "<Row>"
            sCmd += "<AccountCode>111101</AccountCode>"
            sCmd += "<Credit>100</Credit>"
            sCmd += "</Row>"
            sCmd += "</JournalEntries_Lines>"
            sCmd += "</BO> "
            sCmd += "</BOM> "
            sCmd += "</dis:AddObject> "
            sCmd += " </env:Body> "
            sCmd += "</env:Envelope> "
            s = n.Interact(sCmd)
            d.LoadXml(s)
            Return (RemoveEnv(d))
        End Function
    I posted the xml template format of purchase order here.
      <?xml version="1.0" encoding="utf-8" ?>
    - <BOM>
    - <BO>
    - <AdmInfo>
      <Object>oDocuments</Object>
      </AdmInfo>
    - <QueryParams>
      <DocEntry />
      </QueryParams>
    - <Documents>
    - <row>
      <DocNum />
      <DocType />
      <HandWritten />
      <Printed />
      <DocDate />
      <DocDueDate />
      <CardCode />
      <CardName />
      <Address />
      <NumAtCard />
      <DocCurrency />
      <DocRate />
      <DocTotal />
      <Reference1 />
      <Reference2 />
      <Comments />
      <JournalMemo />
      <PaymentGroupCode />
      <DocTime />
      <SalesPersonCode />
      <TransportationCode />
      <Confirmed />
      <ImportFileNum />
      <SummeryType />
      <ContactPersonCode />
      <ShowSCN />
      <Series />
      <TaxDate />
      <PartialSupply />
      <DocObjectCode />
      <ShipToCode />
      <Indicator />
      <FederalTaxID />
      <DiscountPercent />
      <PaymentReference />
      <Form1099 />
      <Box1099 />
      <RevisionPo />
      <RequriedDate />
      <CancelDate />
      <BlockDunning />
      <Pick />
      <PaymentMethod />
      <PaymentBlock />
      <PaymentBlockEntry />
      <CentralBankIndicator />
      <MaximumCashDiscount />
      <Project />
      <ExemptionValidityDateFrom />
      <ExemptionValidityDateTo />
      <WareHouseUpdateType />
      <Rounding />
      <ExternalCorrectedDocNum />
      <InternalCorrectedDocNum />
      <DeferredTax />
      <TaxExemptionLetterNum />
      <AgentCode />
      <NumberOfInstallments />
      <ApplyTaxOnFirstInstallment />
      <VatDate />
      <DocumentsOwner />
      <FolioPrefixString />
      <FolioNumber />
      <DocumentSubType />
      <BPChannelCode />
      <BPChannelContact />
      <Address2 />
      <PayToCode />
      <ManualNumber />
      <UseShpdGoodsAct />
      <IsPayToBank />
      <PayToBankCountry />
      <PayToBankCode />
      <PayToBankAccountNo />
      <PayToBankBranch />
      <BPL_IDAssignedToInvoice />
      <DownPayment />
      <LanguageCode />
      <TrackingNumber />
      <PickRemark />
      <ClosingDate />
      <SequenceCode />
      <SequenceSerial />
      <SeriesString />
      <SubSeriesString />
      <SequenceModel />
      <UseCorrectionVATGroup />
      <VatPercent />
      </row>
      </Documents>
    - <Document_Lines>
    - <row>
      <LineNum />
      <ItemCode />
      <ItemDescription />
      <Quantity />
      <ShipDate />
      <Price />
      <PriceAfterVAT />
      <Currency />
      <Rate />
      <DiscountPercent />
      <VendorNum />
      <SerialNum />
      <WarehouseCode />
      <SalesPersonCode />
      <CommisionPercent />
      <TreeType />
      <AccountCode />
      <UseBaseUnits />
      <SupplierCatNum />
      <CostingCode />
      <ProjectCode />
      <BarCode />
      <VatGroup />
      <Height1 />
      <Hight1Unit />
      <Height2 />
      <Height2Unit />
      <Lengh1 />
      <Lengh1Unit />
      <Lengh2 />
      <Lengh2Unit />
      <Weight1 />
      <Weight1Unit />
      <Weight2 />
      <Weight2Unit />
      <Factor1 />
      <Factor2 />
      <Factor3 />
      <Factor4 />
      <BaseType />
      <BaseEntry />
      <BaseLine />
      <Volume />
      <VolumeUnit />
      <Width1 />
      <Width1Unit />
      <Width2 />
      <Width2Unit />
      <Address />
      <TaxCode />
      <TaxType />
      <TaxLiable />
      <BackOrder />
      <FreeText />
      <ShippingMethod />
      <CorrectionInvoiceItem />
      <CorrInvAmountToStock />
      <CorrInvAmountToDiffAcct />
      <WTLiable />
      <DeferredTax />
      <NetTaxAmount />
      <NetTaxAmountFC />
      <LineTotal />
      <TaxPercentagePerRow />
      <ConsumerSalesForecast />
      <ExciseAmount />
      <CountryOrg />
      <SWW />
      <TransactionType />
      <DistributeExpense />
      <ShipToCode />
      <RowTotalFC />
      <CFOPCode />
      <CSTCode />
      <Usage />
      <TaxOnly />
      <UnitPrice />
      <LineStatus />
      <LineType />
      <COGSCostingCode />
      <COGSAccountCode />
      <ChangeAssemlyBoMWarehouse />
      <U_BLD_LyID />
      <U_BLD_NCps />
      </row>
      </Document_Lines>
    - <Document_LinesAdditionalExpenses>
    - <row>
      <LineNumber />
      <GroupCode />
      <ExpenseCode />
      <LineTotal />
      <TaxLiable />
      <VatGroup />
      <TaxPercent />
      <TaxSum />
      <DeductibleTaxSum />
      <TaxCode />
      <TaxType />
      <EqualizationTaxPercent />
      <EqualizationTaxSum />
      <WTLiable />
      <BaseGroup />
      </row>
      </Document_LinesAdditionalExpenses>
    - <WithholdingTaxLines>
    - <row>
      <WTCode />
      <WTAmountSys />
      <WTAmountFC />
      <WTAmount />
      <TaxableAmountinSys />
      <TaxableAmountFC />
      <TaxableAmount />
      <AppliedWTAmountSys />
      <AppliedWTAmountFC />
      <AppliedWTAmount />
      <BaseDocEntry />
      <BaseDocLine />
      <BaseDocType />
      </row>
      </WithholdingTaxLines>
    - <SerialNumbers>
    - <row>
      <ManufacturerSerialNumber />
      <InternalSerialNumber />
      <ExpiryDate />
      <ManufactureDate />
      <ReceptionDate />
      <WarrantyStart />
      <WarrantyEnd />
      <Location />
      <Notes />
      <BatchID />
      <SystemSerialNumber />
      <BaseLineNumber />
      </row>
      </SerialNumbers>
    - <BatchNumbers>
    - <row>
      <BatchNumber />
      <ManufacturerSerialNumber />
      <InternalSerialNumber />
      <ExpiryDate />
      <ManufacturingDate />
      <AddmisionDate />
      <Location />
      <Notes />
      <Quantity />
      <BaseLineNumber />
      </row>
      </BatchNumbers>
    - <DocumentsAdditionalExpenses>
    - <row>
      <ExpenseCode />
      <LineTotal />
      <Remarks />
      <DistributionMethod />
      <TaxLiable />
      <VatGroup />
      <TaxPercent />
      <TaxSum />
      <DeductibleTaxSum />
      <TaxCode />
      <TaxType />
      <EqualizationTaxPercent />
      <EqualizationTaxSum />
      <BaseDocEntry />
      <BaseDocLine />
      <BaseDocType />
      <LastPurchasePrice />
      <Stock />
      <WTLiable />
      </row>
      </DocumentsAdditionalExpenses>
    - <WithholdingTaxData>
    - <row>
      <WTCode />
      <WTAmountSys />
      <WTAmountFC />
      <WTAmount />
      <TaxableAmountinSys />
      <TaxableAmountFC />
      <TaxableAmount />
      <AppliedWTAmountSys />
      <AppliedWTAmountFC />
      <AppliedWTAmount />
      <BaseDocEntry />
      <BaseDocLine />
      <BaseDocType />
      </row>
      </WithholdingTaxData>
    - <TaxExtension>
    - <row>
      <TaxId0 />
      <TaxId1 />
      <TaxId2 />
      <TaxId3 />
      <TaxId4 />
      <TaxId5 />
      <TaxId6 />
      <TaxId7 />
      <TaxId8 />
      <TaxId9 />
      <State />
      <County />
      <Incoterms />
      <Vehicle />
      <VehicleState />
      <NFRef />
      <Carrier />
      <PackQuantity />
      <PackDescription />
      <Brand />
      <ShipUnitNo />
      <NetWeight />
      <GrossWeight />
      <StreetS />
      <BlockS />
      <BuildingS />
      <CityS />
      <ZipCodeS />
      <CountyS />
      <StateS />
      <CountryS />
      <StreetB />
      <BlockB />
      <BuildingB />
      <CityB />
      <ZipCodeB />
      <CountyB />
      <StateB />
      <CountryB />
      </row>
      </TaxExtension>
      </BO>
      </BOM>
    You can also get the template by GetBusinessObjectTemplate method.(oPurchaseOrders)
    <WebMethod()> Public Function GetTemplate(ByVal SessionID As String, ByVal ObjectType As String) As Xml.XmlDocument
            Dim n As SBODI_Server.Node
            Dim s, strXML As String
            Dim d As Xml.XmlDocument
            d = New Xml.XmlDocument
            n = New SBODI_Server.Node
            strXML = "<?xml version=""1.0"" encoding=""UTF-16""?>" & _
            "<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
            "<env:Header>" & _
            "<SessionID>" & CStr(SessionID) & "</SessionID>" & _
            "</env:Header>" & _
            "<env:Body>" & _
            "<dis:GetBusinessObjectTemplate xmlns:dis=""http://www.sap.com/SBO/DIS"">" & _
            "<Object>" & CStr(ObjectType) & "</Object>" & _
            "</dis:GetBusinessObjectTemplate>" & _
             "</env:Body></env:Envelope>"
            s = n.Interact(strXML)
            d.LoadXml(s)
            Return (RemoveEnv(d))
        End Function  

  • TV Show Coding error

    Hey - it looks like someone's mistakenly coded about 16 episodes of "Danny Phantom" as "Avatar the Last Airbender: Season 2" and so not only are they showing up in the episode listing for ALAB:S2, they're automatically downloading for those of us with a Season Pass.
    I suspect Apple didn't intent to just give 16 episode's away as a gift...
    Jim

    To reset the iTunes Store cache:
    Click on the Edit menu > Preferences > Advanced tab
    Next to "Reset iTunes Store cache", click the "Reset cache" button

  • SSRS Timeout issue

    I am using SSRS for generate reports in my .net web application. For one of the report, an error "An error has occurred during report processing." is returned after 100s. The report can be generated successfully in report server
    at around 3 minutes. So, I believed it is caused by timeout issue in one of the processes. However, i have verified the timeout settings but still got no ideas on how to fix it.
    My code is a bit complicated since the connection type of my report's data source is an customized dll. In the dll, i will call an webservice to get data. Below is summary for the flow:
    UI -> Reporting Service -> Customized Dll -> Web service -> SQL/Stored Procedures
    The execution timeount in the web.config of both the reporting service and web service are set to 9000s (<httpRuntime executionTimeout = "9000" />). And coding about timeout of the service is set to 3000s (i.e. ReportingService rs = new ReportingService();
    rs.timeout = 3000000;). In the execution properties of the report, Report Execution Time is set to "Do not timeout report execution" currently.
    I think there is no problem for the customized dll and the web service it calls since it can be generated in report server direclty. But I have no idea about where the timeout occurs. Please kindly help.
    Thanks,
    Shirley

    Hi Shirley,
    According to your description, you encountered time out issue when rendering your report in your web application. Right?
    In Reporting Services, we have report execution timeout value and query timeout value for processing report and dataset. In this scenario, you have already set the report executionTimeout and "Do not timeout report execution" on report level. Since
    this time issue only happens on specific report, it probably cause by processing large amount of data which exceeds the max query timeout. Please go to rsreportserver.config file and change the QueryTimeOut into "0". This file locates at
    xx:\Program Files\Microsoft SQL Server\MSRS12.MSSQLSERVER\Reporting Services\ReportServer
    <Add Key="DatabaseQueryTimeout" Value="0"/>
    Reference:
    Setting Time-out Values for Report and Shared Dataset Processing (SSRS)
    Troubleshooting Timeout errors in Reporting Services
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • IRC Spammer / Impersonator

    This morning I was informed by a TU via Private Message on IRC that there were spammer impersonating me. He first ask what happened last night and as I had no idea what he was talking about this was when I first discovered what happened.
    There are some wonderful people (for lack of a nicer term) who think its funny to impersonate me and spam the channel.
    My hostname is almost always adsl-75-33-32-137.dsl.bcvloh.sbcglobal.net very rarely do I connect to IRC using a different net connection (usually just ssh into my home box). The ip is dynamic so it will change, but it should match with mezoko.net
    I think these spammers are ajnewbold and impl. They helped me out with some php coding about a year ago. They were nice people, but they slowly started pull crap on me and I didn't put up with so I think this their revenge.
    **Ajnewbold and impl (he was under the alias of "hary" something, I don't remember) spammed the channel about a week ago so I'm not sure if they'll stop, hence the reason for this posting.
    So basically I want to clear up a few things
         1. The spammers last night were not me
         2. If username mezoko does not have a host name similar to dsl.bcvloh.sbcglobal.net there is a good chance it is not me
        3. To any TU/OP/Dev please do not ban my user name from IRC, please ban the hostname if the problem arises again.
    Thank you all for your understanding,
    -Mezoko

    mezoko wrote:
    Excuse me, but I want to clear up that I was not spammer. It is hard to leave a message in IRC that everyone will see. I also wanted the OP's to see this so they don't go banning my username.
    Lately there have been a few spammers on different times that have been targeting me, I wouldn't be surprised if they move to the forums next btw :-/
    quite honestly and in all fairness, u are making it worse by taking it public. Trolls never learn and troll bait like this post will just make them target u harder.
    out of sight out of mind.

  • Hierarchical difficult query.

    Hi guys,
    I am trying to solve this issue in one select and still I did not manage to find the sollution.
    I have a table with the following configuration:
    DROP TABLE USERS_TAB;
    create table users_tab (user_id number PRIMARY KEY, group_id number, USERTYPE VARCHAR2 (2));
    --THESE USERS ARE IN THE SAME GROUP id:80 and have different types
    INSERT INTO users_tab VALUES (1,80,'V');
    INSERT INTO users_tab VALUES (2,80,'V');
    INSERT INTO users_tab VALUES (3,80,'E');
    --These are in another group (40) and have different types
    INSERT INTO users_tab VALUES (4,40,'E');
    INSERT INTO users_tab VALUES (5,40,'V');
    INSERT INTO users_tab VALUES (6,40,'E');
    insert into users_tab values (7,null, 'V');
    commit;
    create table links (v_type_users number, e_type_users number);In links table we define the links between users. A link appears only one time in this table (the links are one to one). the v type users appear in v_type_user column and e type users appear in e_type_user
    **I have a procedure that has for input parameter one user_id. I need to selectal users that have the same group_id with the input and that are lnked togheter. if a contract belongs to a group, all memenbers of the group need to be included and the links between groups are made in links table (you will understand from example). **
    For example:
    1.
    truncate table links;
    insert into links values (1,4);user 1 of v type is linked with user 4 of e type.
    if my select has for input user the id 1,
    it will need to return all the users that are in the group of user 1. and for these users all the links with their
    groups and so on.
    1 is in group 80...so I will need to return 1,2,3 users. but 1 is linked with 4 that is in group 40 so I will also return 4,5,6 because they are in the same group
    so in this link I will need to return 1,2,3,4,5,6. they are representing a bigger group
    2.
    truncate table links;
    insert into links values (1,4);
    insert into links values (5,7);--we created a link between 5(type v and 7 type e)if we input user 1, we will need to show all memember from group 80, and because of the link (1,4) we will need to show
    4 and because 4 is in the group with 5 and 6 we will need to show them also and because 5 is in link with 7 we will need to show 7 also
    the group will be: 1,2,3,4,5,6,7.
    **you can see that the bigger group will be the same no matter what the input is. if the input is for example 7 or 5 or (4,3,2,1) we will output*
    *1,2,3,4,5,6,7. because 7 is in link with 5 and 5 is in a group and in that group there is another link to another group**
    3.
    We can have multimple links between groups (I can see here a problem with hierarchical or maybe nocycle and distinct helps?)
    truncate table links;
    insert into links values (1,4);
    insert into links values (5,7);--we created a link between 5(type v) and 7 type e
    insert into links values (2,6);--we created a link between 2(type v) and 6 type ethis will not change the output, although we have multimple links.
    we will need to output:
    1
    2
    3
    4
    5
    6
    7
    4.
    truncate table links;
    insert into links values (3,7);-- we have one link between 3(type v) and 7 (type e)if we have the input user 3. we will need to show all memenber from the group of user 3 and because of the link we will show the user 7.
    we will have
    1
    2
    3
    7
    5.
    truncate table links;
    if we have no link...we will need to show all the users from a group(if the input is a user from a group) and only that user if the input has no group.
    I think this is a difficult one, any help is appreaciated.
    Thanks

    Hi,
    Interesting problem!
    The CONNECT BY should really be done by groups; it doesn't matter that userid 1 is linked to userid 4; all that matters is that group 80 is linked to group 40.
    But if the CONNECT BY is done accrding to groups, what about user_id=7, who is not in a group? For purposes of this query, all rows in users_tab that have NULL group_id will be assigned a unique group_id.
    Sub-query erverybody_in_group below makes up a group_id for rows that do not already have one. It assumes that userid > 0.
    The CONNECT BY will go a lot easier if, for every row like (1, 4) that is in links, we also have the mirror-image (4, 1). The first two branches of the UNION in sub-query group_link do that.
    The last branch of the UNION makes sure all groups are represented in group_link, even if they are not linked to anything. That ensures that all members of the source group get included in hte results, even if they are not connected to any other group. (This incluudes the special case where there are no rows at all in linkls.)
    WITH     everybody_in_group     AS
         SELECT     user_id
         ,     COALESCE ( group_id
                    , user_id + ( SELECT  MAX (group_id)
                                  FROM    users_tab
                    ) AS group_id
         FROM    users_tab
    ,     group_link          AS
         SELECT     v1.group_id     AS from_group_id
         ,     e1.group_id     AS to_group_id
         FROM     links               l1
         JOIN     everybody_in_group     e1     ON     l1.e_type_users     = e1.user_id
         JOIN     everybody_in_group     v1     ON     l1.v_type_users     = v1.user_id
         UNION
         SELECT     e2.group_id     AS from_group_id
         ,     v2.group_id     AS to_group_id
         FROM     links               l2
         JOIN     everybody_in_group     e2     ON     l2.e_type_users     = e2.user_id
         JOIN     everybody_in_group     v2     ON     l2.v_type_users     = v2.user_id
         UNION
         SELECT  group_id     AS from_group_id
         ,     NULL          AS to_group_id
         FROM     everybody_in_group
    SELECT     user_id
    FROM     everybody_in_group
    WHERE     group_id     IN ( SELECT  from_group_id
                        FROM    group_link
                        START WITH      from_group_id = ( SELECT  group_id
                                                          FROM        everybody_in_group
                                          WHERE   user_id     = 1     -- Or use a bind variable
                        CONNECT BY NOCYCLE      from_group_id = PRIOR to_group_id
    ORDER BY  user_id
    ;In the example above, the starting user_id (1) is hard-coded, about 6 lines from the end. This is the only place where that parameter is used.
    The column usertype plays no role in this problem; is that right?
    Thanks for posting the CREATE TABLE and INSERT statements! That really helps.

  • Pls help..Constructor,setter, getter and Exception Handling Problem

    halo, im new in java who learning basic thing and java.awt basic...i face some problem about constructor, setter, and getter.
    1. I created a constructor, setter and getter in a file, and create another test file which would like to get the value from the constructor file.
    The problem is: when i compile the test file, it come out error msg:cannot find symbol.As i know that is because i miss declare something but i dont know what i miss.I post my code here and help me to solve this problem...thanks
    my constructor file...i dont know whether is correct, pls tell me if i miss something...
    public class Employee{
         private int empNum;
         private String empName;
         private double empSalary;
         Employee(){
              empNum=0;
              empName="";
              empSalary=0;
         public int getEmpNum(){
              return empNum;
         public String getName(){
              return empName;
         public double getSalary(){
              return empSalary;
         public void setEmpNum(int e){
              empNum = e;
         public void setName(String n){
              empName = n;
         public void setSalary(double sal){
              empSalary = sal;
    my test file....
    public class TestEmployeeClass{
         public static void main(String args[]){
              Employee e = new Employee();
                   e.setEmpNum(100);
                   e.setName("abc");
                   e.setSalary(1000.00);
                   System.out.println(e.getEmpNum());
                   System.out.println(e.getName());
                   System.out.println(e.getSalary());
    }**the program is work if i combine this 2 files coding inside one file(something like the last part of my coding of problem 2)...but i would like to separate them....*
    2. Another problem is i am writing one simple program which is using java.awt interface....i would like to add a validation for user input (something like show error msg when user input character and negative number) inside public void actionPerformed(ActionEvent e) ...but i dont have any idea to solve this problem.here is my code and pls help me for some suggestion or coding about exception. thank a lots...
    import java.awt.*;
    import java.awt.event.*;
    public class SnailTravel extends Frame implements ActionListener, WindowListener{
       private Frame frame;
       private Label lblDistance, lblSpeed, lblSpeed2, lblTime, lblTime2, lblComment, lblComment2 ;
       private TextField tfDistance;
       private Button btnCalculate, btnClear;
       public void viewInterface(){
          frame = new Frame("Snail Travel");
          lblDistance = new Label("Distance");
          lblSpeed = new Label("Speed");
          lblSpeed2 = new Label("0.0099km/h");
          lblTime = new Label("Time");
          lblTime2 = new Label("");
          lblComment = new Label("Comment");
          lblComment2 = new Label("");
          tfDistance = new TextField(20);
          btnCalculate = new Button("Calculate");
          btnClear = new Button("Clear");
          frame.setLayout(new GridLayout(5,2));
          frame.add(lblDistance);
          frame.add(tfDistance);
          frame.add(lblSpeed);
          frame.add(lblSpeed2);
          frame.add(lblTime);
          frame.add(lblTime2);
          frame.add(lblComment);
          frame.add(lblComment2);
          frame.add(btnCalculate);
          frame.add(btnClear);
          btnCalculate.addActionListener(this);
          btnClear.addActionListener(this);
          frame.addWindowListener(this);
          frame.setSize(100,100);
          frame.setVisible(true);
          frame.pack();     
        public static void main(String [] args) {
            SnailTravel st = new SnailTravel();
            st.viewInterface();
        public void actionPerformed(ActionEvent e) {
           if (e.getSource() == btnCalculate){
              SnailData sd = new SnailData();
           double distance = Double.parseDouble(tfDistance.getText());
           sd.setDistance(distance);
                  sd.setSpeed(0.0099);
              sd.setTime(distance/sd.getSpeed());
              String answer = Double.toString(sd.getTime());
              lblTime2.setText(answer);
              lblComment2.setText("But No Exception!!!");
           else
           if(e.getSource() == btnClear){
              tfDistance.setText("");
              lblTime2.setText("");
       public void windowClosing(WindowEvent e){
                   System.exit(1);
        public void windowClosed (WindowEvent e) { };
        public void windowDeiconified (WindowEvent e) { };
        public void windowIconified (WindowEvent e) { };
        public void windowActivated (WindowEvent e) { };
        public void windowDeactivated (WindowEvent e) { };
        public void windowOpened(WindowEvent e) { };
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;
    }Pls and thanks again for helps....

    What i actually want to do is SnailTravel, but i facing some problems, which is the
    - Constructor,setter, getter, and
    - Exception Handling.
    So i create another simple contructor files which name Employee and TestEmployeeClass, to try find out the problem but i failed, it come out error msg "cannot find symbol".
    What i want to say that is if i cut below code (SnailTravel) to its own file(SnailData), SnailTravel come out error msg "cannot find symbol".So i force to put them in a same file(SnailTravel) to run properly.
    I need help to separate them. (I think i miss some syntax but i dont know what)
    And can somebody help me about Exception handling too pls.
    class SnailData{
       private double distance;
       private double speed;
       private double time;
       public SnailData(){
          distance = 0;
          speed = 0;
          time = 0;
       public double getDistance(){
          return distance;
       public double getSpeed(){
          return speed;
       public double getTime(){
          return time;
       public void setDistance(double d){
          distance = d;
       public void setSpeed(double s){
          speed = s;
       public void setTime(double t){
          time = t;

  • Suddenly unable to send large emails from C# application

    Hi can anyone help?
    I have started to receive :
    System.IndexOutOfRangeException: Index was outside the bounds of the array.
     at System.Net.Base64Stream.EncodeBytes(Byte[] buffer, Int32 offset, Int32 count, Boolean dontDeferFinalBytes, Boolean shouldAppendSpaceToCRLF)
       at System.Net.Base64Stream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.Net.Mime.MimePart.Send(BaseWriter writer)
       at System.Net.Mime.MimeMultiPart.Send(BaseWriter writer)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
    When a large email is sent from a C#app on .NET4
    I read that there is a hotfix for this issue, but I can't see to find it - all I get from MS Connect site is Page Not Found, can anyone help?

    Hi john,
    Thank you for posting in MSND forum.
    Since
    this forum is to discuss: Visual
    Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    Based on your issue, it is related to the C# application,
    so
    I’m afraid that it is not the correct forum
    for this issue.
    To help you find the correct forum support this issue,
    could you please tell me which kind of application you create using C# language? Is it a c# console application or others?
    If possible, I suggest you could share the detailed coded about your issue so that we will better support this issue.
    Thanks for your understanding.
    Best Regards, 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • CFC's - Question about coding guidelines

    I have a question about the following section in the
    CF
    Coding guidelines
    quote:
    {cfmxroot}
    ---wwwroot/ » web-accessible .cfm pages and .cfc Web
    Services
    ---extensions/
    --------components/ » tree for .cfc files
    --------customtags/ » tree for .cfm custom tags
    --------includes/ » tree for include files
    ---config/ » tree for configuration files
    This implies that we have two Custom Tag Paths set up in the
    CFMX Administrator:
    {cfmxroot}/extensions/components/
    {cfmxroot}/extensions/customtags/
    We also have mappings for the root of the includes tree (for
    cfinclude) and the custom tags tree (for cfimport):
    /cfinclude » {cfmxroot}/extensions/includes/
    /customtags » {cfmxroot}/extensions/customtags/
    1. Why would you want to add both a custom tag path
    AND a mapping for " {cfmxroot}/extensions/customtags/"?
    2. The guidelines seems to imply you should use a custom tag
    path for components, instead of a mapping. If the "components"
    directory is already outside the webroot, then adding a CF mapping
    shouldn't make it web accessible, right? So is there any benefit to
    using a custom tag path versus a mapping?

    It is up to you where you put your components and where you
    put your custom tags. The standard way, as I know it, at least, is
    to create a mapping for your cfc directory on the
    Mappings page of the Coldfusion Administrator and to
    register the path to your custom tag directory on the
    Extensions/Custom Tag Paths page. In answer to your first
    question, you will also need to create a mapping for a custom tag
    directory if you intend to call tags using the template-attribute
    of cfmodule.
    Coldfusion considers the directory-path that you register on
    the
    Extensions/Custom Tag Paths page an absolute path. That is
    what enables you to call a tag directly by name on any page of your
    application, for example,
    <cf_myCustomTag>.
    One consequence is, if you stored a component myComp.cfc in
    such a directory, you could instantiate it on any page simply by
    running
    <cfset myObj = createobject("component","myComp")>
    However, this doesn't offer anything a mapping wouldn't. So,
    in answer to the second question, I don't think one should use a
    custom tag path for components. Mixing one's custom tags with one's
    components only produces an oil-plus-water structure.

  • Newbie question about C coding and SDK for iPhone app

    Hello,
    I am interested in trying to create an app. However, I have NO experience writing code I already have downloaded and installed the latest version of the SDK.
    I know I have to learn: C, Objective C, and Cocoa.
    I just picked up "C for Dummies" as a starting point. I figured the K&R might be a bit overwhelming to start with. Thing is, "C for Dummies" suggests doing some exercises in Text Edit and then using GCC to compile and test. But, then again, it has a copyright of 2004--long before Snow Leopard.
    My question is, do I really need to do the exercises in Text Edit? Can I just use Xcode for entering the code and testing it? And, any suggestions for learning C and Xcode tutorials are greatly appreciated.
    Thanks!!

    But, I really want to learn coding and not just take the easy route by using Xcode.
    The simplification of using Xcode may have been a bit exaggerated throughout this thread. You will still learn how to program full-on by using Xcode -- it's not like you're taking a shortcut or anything. Well, technically speaking, you are, but Xcode is the expected way to develop on a Mac nowadays -- it's how Apple expects you to develop and how most people are doing so. Should you choose, you can taking a deeper dive into the inner workings of compiling and whatnot by using a text editor and the Terminal, but keep in mind that the extra complexities here could complicate the more important overall goal of learning the basics of how to program. There is absolutely nothing wrong with simply using Xcode for the novice part of your programming days. In fact, it's probably the path I would recommend. Some here might suggest that it is beneficial to learn the intricacies of compiling through the Terminal and whatnot early on, and they are right -- it is beneficial, but the benefits of taking a route (at least for the time being) that allows you to focus on the more pressing issues of learning how to program without having to delve too deeply can be just as beneficial. After all, it's not like you can't go back and learn how to compile via Terminal later on -- that's what I've done (or, rather, am in the process of doing).
    I always thought Terminal was something not to mess with.
    Not so much. Like most things in programming (or life, for that matter), the Terminal is something not to mess with +if you don't know what you're doing+. Basically, it breaks down like this. The GUI that Apple has created for you in Mac OS X (by GUI I mean "graphical user interface" -- the icons and windows and buttons and so forth that you use to perform tasks on your Mac -- in other words, everything outside the Terminal) is geared toward the common user who does not need to access advance aspects of the system's functionality. Consequently, it makes common tasks much simpler to perform, but in the process it hides some of the deeper levels of the system's functionality from the user. This is a good thing, since most people wouldn't know what to do with this functionality and would create problems for themselves if they did have easy access to it. However, for some users who know more about the inner workings of the operating system, there needs to be a way for them to access this functionality, so that they can do certain things (like accessing certain files and performing certain tasks) that they would not be able to do using the Mac OS X GUI -- that's what the Terminal is for. It allows the user to operate the system on a lower level. In other words, it allows you to get closer to the operating system. This is good in a way, because it allows you to perform tasks that you wouldn't otherwise be able to perform by giving you more control over the operating system, but it is also bad in a way, because it can allow you to mess up some of the deeper aspects of your system if you don't know what you are doing. Most people leave the Terminal alone for this reason, and because they have no need of it, but if you want to be a good developer, you're going to have to work with it sooner or later.
    Now, with all that being said, it's not that easy to mess things up using the Terminal. It's not like your system's going to crash if you misspell a command. All in all, the Terminal is very forgiving, but it will do what you tell it to do, even if you tell it to kill itself, and it is for that reason that you need to know what you are telling it before you try to tell it something. If you understand what you are telling the system, than operating on a lower level and being closer to the operating system is completely safe.
    The Mac OS X operating system is based around Unix, so when you are communicating more directly with the operating system by using the Terminal, you are interacting with its Unix core. For this reason, using the Terminal goes hand in hand with understanding Unix. So, if you're going to want to use the Terminal, then I recommend you get a good book on Unix to teach you the basics of Unix commands and shell programming and whatnot. Any book on Unix will do, since more or less everything you learn will be applicable to the Mac OS X's Terminal, but there are a few that are specifically directed to Mac OS X users, and that always makes things easier. Most of these books aren't updated to cover past Tiger, but this really doesn't matter (someone correct me if I'm wrong). A few examples are O'Reilly's "Learning Unix for Mac OS X Tiger" by Dave Taylor or Peachpit Press's "Unix for Mac OS X Tiger" by Matisse Enzer. Also, the book "Unix Programming Environment" by Kernighan and Pike is an excellent book on Unix, although fairly outdated, so I would highly recommend it, although I would recommend it as a supplement to another, more recent, Mac-based Unix book and not as your primary source for learning Unix. The skills you will acquire from these books will help you later if not sooner, so I recommend giving one of them a read at some point, whether you are planning on compiling using the Terminal right now or not.
    Anyways, I hope this helped to clear some of this up for you, and please let us know if you have any further questions.

  • Question about EJB and thread safe coding - asking again!

    sorry everyone, no one seems to be interested in helping me on this, so i post it again.
    i have a question about the EJB and thread safe coding. when we build EJBs, do we need to worry about thread safe issue? i know that EJBs are single threaded, and the container manages the thread for us. maybe i am wrong about this. if i wasnot, how can we program the EJB so that two or more instance of EJB are not going to have deadlock problem when accessing data resources. do we need to put syncronization in ours beans, do we even need to worry about creating a thread safe EJB? thanks in advance. the question really bothers me a lot lately.

    sorry everyone, no one seems to be interested in
    helping me on this, so i post it again.Excellent plan. Why not search a little bit on your own instead of waiting for your personal forum slaves to answer your call. See below.
    i have a question about the EJB and thread safe
    coding. when we build EJBs, do we need to worry about
    thread safe issue? Read this: http://forum.java.sun.com/thread.jsp?forum=13&thread=562598&tstart=75&trange=15
    i know that EJBs are single
    threaded, and the container manages the thread for us.
    maybe i am wrong about this. if i wasnot, how can we
    program the EJB so that two or more instance of EJB
    are not going to have deadlock problem when accessing
    data resources. do we need to put syncronization in
    ours beans, do we even need to worry about creating a
    thread safe EJB? thanks in advance. the question
    really bothers me a lot lately.
    Java's Thread Tutorial
    JavaWorld: Introduction to Java threads
    IBM: Introduction to Java threads
    Google: java+threads+tutorial

  • Cant seem to find any information about reading text on a pdf browser or open word document for coded UI.

    Hi forum,
            I'm currently building automation for this web application for my job that have links that opens either a word document, a web page or opens up a pdf document in the browser in the same screen.  All i'm trying to do is read
    the text from the pdf browser, or the word document that opens up and read the related text off these documents. 
    I know how to read the related text from the web page that opens but for
    the other two options i dont really know what i have to do.  I read the ALM add for word might
    work but i haven't tried to implement this or know if this will help me. 
    When i read these strings out i plan on comparing them and doing an assertion on them.
    Can someone point me to the right direction on doing this.
    Tahnks

    Hi skinny_Will,
    The coded UI test would have some limitations for the Word/office controls by design.
    To really read and compare the text value, I'm afraid that we would use certain extension tool/add-in and custom code for it.
    Please check the Visual Studio Coded UI for Word Add-In.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/b12f1cf8-322f-4b3a-ad8f-011065d91356/comparing-word-documents-in-coded-ui?forum=vstest
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Please reply me soon about adding coding to adobe muse.

    Hello,
    How to add active server pages or asp code in adobe muse? Asp needs a database but your live chat team said it doesn't need a server. Then, what replaces sql server to process a database?
    Do you give me a hosting? If yes, why does your video lesson about publishing a site talks about godaddy hosting?
    I want to show some of my samples of websites to my client but he wants to see these live on websites. How?
    Thank you.

    Moving this discussion to the Help with using Adobe Muse CC forum.

  • HT2736 I know everything about what is required to be done except the actual itune store to enter my coded number to access my credit.  Any ideas like a log on approach.

    Will you idiots stop this nonsense.  I want to enter my details of my cards so I can down load.  Guess what.  There is no sign on approach to take these details or have you guys just got to much bloody nonsense to put people through the hoops and not enough common sense.  You know sign on enter details get what you want and then sign off.

    No one here is going to do anything about it. Send feedback to Apple.
    http://www.apple.com/feedback/ipad.html
    Basic troubleshooting steps. 
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 

  • Coding language for SRM & information required about Japanese auction

    Hi  ,
    Kindly let me know the programming language for SRM and in particular about the auctioning module of SRM.
    Also can we customise the code to provide japanese auction in SRM or auctioning module.
    Thanks

    Not answered.

Maybe you are looking for