Generic FG/class for spreading non-monthly qty's into monthly buckets

In custom long-term planning reports, we may have to use data like labor hours that are stored in non-monthly buckets, e.g. buckets like
12/15/2010 u2013 1/14/2011  100 hours
1/15/2011 u2013 2/14/2011       80 hours
etc.
But in order to make our long-term reports useful for cash-flow estimation/planning, we may have to reslot such non-monthly data into fiscal monthly buckets like:
Dec 2010
Jan 2011
Feb 2011
In the above simple example, the translation from non-monthly data to monthly data is simple:
half of the hours from the 12/15/2010-1/14/2011 non-monthly bucket go into the Dec 2010 monthly bucket and
half of the hours from the 12/15/2010-1/14/2001 non-monthly bucket go into the Jan 2011 monthly bucket.
etc.
And generalizing from this simple example, you can see that there will always be some ratio in which the non-monthly data can be split into monthly data.  (For example, the ratio between a non-monthly bucket and two successive monthly buckets might be 3:1 if 3 weeks of the non-monthly bucket fall into the first monthly bucket and the fourth week of the non-monthly bucket falls into the second monthly bucket.
These considerations suggest that SAP developers and customers might benefit from a generic FG or class that:
accepted a set of non-monthly buckets plus a set of quantities 
figured out the monthly buckets spanning this set of non-monthly buckets
spread the non-monthly data into the monthly buckets correctly (according to the simple u201Cratiou201D idea outlined above.)
This generic FG or class would do (1-3) regardless of the specific nature of the quantities involved ... because who cares what they are.  Also, one could imagine a version of this class or FG where the output buckets might not be monthly, but rather a different set of non-monthly buckets than the input non-monthly buckets.
So, my four questions are:
Does anyone know of an SAP-delivered class or FG that does (1-3)  (Iu2019m thinking SCM/APO might well have one u2026)
If not, does anyone have anything approaching this class of FG that they would care to share with me (via email, of course)?
If not, does any genius out there have the time to write such a class and put it in the SDN code base?
Do you all agree that the safest way to get the ratio is to take everything to the u201Clowest common denominatoru201D of days and then figure the ratio accordingly?
Thanks for considering this matter.
djh

As you can see from below, the code markers aren't working in Mozilla either ....oh well
FUNCTION ZCK_TRAN_TO_MONTHS.
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(START_DATE) TYPE  FSTAD
*"     REFERENCE(END_DATE) TYPE  FENDD
*"     REFERENCE(AMOUNT) TYPE  ZZVGWRT
*"  TABLES
*"      MONTH_TABLE_FOR_RUN TYPE  ZMMY_MSTR_DATA_EST_YRMO
*"  CHANGING
*"     REFERENCE(MONTH_BUCKETS) TYPE  ZMMS_MSTR_DATA_EST_MOBUCKETS
FIELD-SYMBOLS:
  <fs_mobu>             TYPE zmms_mstr_data_est_mobuckets,
  <fs_mota>             TYPE zmms_mstr_data_est_yrmo,
  <fs_buck>             TYPE zzvgwrt.                        "bucket of month_buckets
DATA:
  lv_month(2)           TYPE n,
  lv_year(4)            TYPE n,
  lv_m_days             TYPE i,
  lv_total_days         TYPE i,
  lv_last_day           LIKE sy-datum,
  lv_out_flag           TYPE c,
  ls_month_buckets      TYPE zmms_mstr_data_est_mobuckets,
  lv_yrmo               TYPE zzbkper,
  lv_index1             LIKE sy-tabix,
  lv_index2             LIKE sy-tabix,
  lt_month_table        TYPE zmmy_mstr_data_est_yrmo.
  lt_month_table[] = month_table_for_run[].
  lv_total_days    = end_date - start_date.
  lv_month         = start_date+4(2).
  lv_year          = start_date(4).
  CLEAR:             lv_out_flag,
                     gt_mo_spread,
                     ls_month_buckets.
  DO.
    IF lv_month = start_date+4(2) AND lv_year = start_date(4).
      CALL FUNCTION 'MM_LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in            = start_date
        IMPORTING
          last_day_of_month = lv_last_day
        EXCEPTIONS
          day_in_no_date    = 1
          OTHERS            = 2.
      lv_m_days = lv_last_day - start_date.
    ELSEIF lv_month = end_date+4(2) AND lv_year = end_date(4).
      lv_m_days = end_date+6.
      MOVE 'X' TO lv_out_flag.
    ELSE.
      CONCATENATE lv_year lv_month '01' INTO lv_last_day.
      CALL FUNCTION 'MM_LAST_DAY_OF_MONTHS'
        EXPORTING
          day_in            = start_date
        IMPORTING
          last_day_of_month = lv_last_day
        EXCEPTIONS
          day_in_no_date    = 1
          OTHERS            = 2.
      lv_m_days = lv_last_day+6.
    ENDIF.
    APPEND INITIAL LINE TO gt_mo_spread ASSIGNING <fs_mosp>.
    <fs_mosp>-year   = lv_year.
    <fs_mosp>-month  = lv_month.
    <fs_mosp>-amount = amount / lv_total_days * lv_m_days.
    IF lv_month EQ 12.
      ADD 1 TO lv_year.
      CLEAR lv_month.
    ENDIF.
    ADD 1 TO lv_month.
    IF lv_out_flag EQ 'X'.
      EXIT.
    ENDIF.
  ENDDO.
* now:
*   loop thru gt_mo_spread
*   pick up month_bucket index from month_table_for_run
*   add amount from gt_mo_spread row to appropriate month_bucket
  ASSIGN ls_month_buckets TO <fs_mobu>.
  LOOP AT gt_mo_spread ASSIGNING <fs_mosp>.
    lv_index1 = sy-tabix.                          "just in case we need it
    CONCATENATE <fs_mosp>-year
                <fs_mosp>-month
           INTO lv_yrmo.
    READ TABLE lt_month_table ASSIGNING <fs_mota>
      WITH KEY
        zzyrmo = lv_yrmo.
    lv_index2  = sy-tabix.
    ASSIGN COMPONENT lv_index2 OF STRUCTURE <fs_mobu> TO <fs_buck>.
    <fs_buck> = <fs_buck> + <fs_mosp>-amount.
  ENDLOOP.
  month_buckets = ls_month_buckets.
ENDFUNCTION.
FORM build_bucketed_detail.
FIELD-SYMBOLS:
  <fs_mobu>                         TYPE zmms_mstr_data_est_mobuckets,
  <fs_comp1>                        TYPE zzvgwrt,  "bucket in ls_mo_buckets/<fs_mobu>
  <fs_comp2>                        TYPE zzvgwrt,
  <fs_mota>                         TYPE zmms_mstr_data_est_yrmo,
  <fs_buck>                         TYPE zzvgwrt.            "bucket of month_buckets
DATA:
  lv_matnr_arbid_cur(26)            TYPE c,
  lv_matnr_arbid_lag(26)            TYPE c,
  lv_dtlh_index                     LIKE sy-tabix,
  ls_month_buckets                  TYPE zmms_mstr_data_est_mobuckets,
  lv_nummo                          TYPE i,
  lv_yrmo                           TYPE zzbkper,
  lv_yindx                          TYPE i,
  lv_bindx1                         LIKE sy-tabix,     "index on ls_month_buckets cmpnts
  lv_bindx2                         LIKE sy-tabix.     "index on <fs_dtlhmo> buckets
                                                       "note: must be lv_bindx1 + 5.
  lv_nummo = LINES( gt_mo_tbl ).
  READ TABLE gt_dtlh_keys INDEX 1 ASSIGNING <fs_dtlh>.
    CONCATENATE <fs_dtlh>-matnr
                <fs_dtlh>-arbid
           INTO lv_matnr_arbid_lag.
  lv_dtlh_index = 1.
  APPEND INITIAL LINE TO gt_dtlhmo_keys ASSIGNING <fs_dtlhmo>.
  <fs_dtlhmo>-matnr      = <fs_dtlh>-matnr.
  <fs_dtlhmo>-arbid      = <fs_dtlh>-arbid.
  <fs_dtlhmo>-arbpl      = <fs_dtlh>-arbpl.
  <fs_dtlhmo>-kostl      = <fs_dtlh>-kostl.
  ASSIGN ls_month_buckets TO <fs_mobu>.
  DO.
    READ TABLE gt_dtlh_keys INDEX lv_dtlh_index ASSIGNING <fs_dtlh>.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
    CONCATENATE <fs_dtlh>-matnr
                <fs_dtlh>-arbid
           INTO lv_matnr_arbid_cur.
    IF lv_matnr_arbid_lag <> lv_matnr_arbid_cur.
      CLEAR <fs_dtlhmo>.
      APPEND INITIAL LINE TO gt_dtlhmo_keys ASSIGNING <fs_dtlhmo>.
      <fs_dtlhmo>-matnr        = <fs_dtlh>-matnr.
      <fs_dtlhmo>-arbid        = <fs_dtlh>-arbid.
      <fs_dtlhmo>-arbpl        = <fs_dtlh>-arbpl.
      <fs_dtlhmo>-kostl        = <fs_dtlh>-kostl.
      CLEAR ls_month_buckets.
      CLEAR <fs_mobu>.
    ENDIF.
    <fs_dtlhmo>-tot_vgw01_03   = <fs_dtlh>-vgw01 +
                                 <fs_dtlh>-vgw02 +
                                 <fs_dtlh>-vgw03.
    IF <fs_dtlh>-fstad+4(02) = <fs_dtlh>-fendd+4(02).
      lv_yrmo = <fs_dtlh>-fstad+0(6).
      READ TABLE gt_mo_tbl ASSIGNING <fs_mota>
        WITH KEY
          zzyrmo = lv_yrmo.
      lv_yindx  = sy-tabix.                                "month number
      lv_yindx  = lv_yindx  + 5.                           "to account for leading fields
      ASSIGN COMPONENT lv_yindx
          OF STRUCTURE <fs_dtlhmo>
                    TO <fs_buck>.
      <fs_buck> = <fs_buck> + <fs_dtlh>-tot_vgw01_03.
    ELSE.
      CALL FUNCTION 'ZCK_TRAN_TO_MONTHS'
        EXPORTING
          START_DATE             = <fs_dtlh>-fstad
          END_DATE               = <fs_dtlh>-fendd
          AMOUNT                 = <fs_dtlhmo>-tot_vgw01_03
        TABLES
          MONTH_TABLE_FOR_RUN    = gt_mo_tbl
        CHANGING
          MONTH_BUCKETS          = ls_month_buckets.
      lv_bindx1 = 1.
      DO.
        IF lv_bindx1 > lv_nummo.
          EXIT.
        ENDIF.
        lv_bindx2 = lv_bindx1 + 5.
        ASSIGN COMPONENT lv_bindx1 OF STRUCTURE <fs_mobu>   TO <fs_comp1>.
        ASSIGN COMPONENT lv_bindx2 OF STRUCTURE <fs_dtlhmo> TO <fs_comp2>.
        <fs_comp2> = <fs_comp2> + <fs_comp1>.
        lv_bindx1 = lv_bindx1 + 1.
      ENDDO.
    ENDIF.
    lv_dtlh_index = lv_dtlh_index + 1.
  ENDDO.
ENDFORM.
Edited by: David Halitsky on Sep 9, 2010 9:42 PM

Similar Messages

  • Generic Java class for working with Context Nodes

    Hi,all
    I would like to write generic Java class for working with Context Nodes:
    populating node,
    add element to node,
    update node element,
    remove node element
    Any ideas how can I do it?

    Hi,Armin
    Thanks for your answer.
    I have many nodes with the same structure,but different data.
    I don't want to work with each one of them individually.
    This is the main reason.
    Regards,
    Michael
    Any ideas?

  • Tutorial for make a non-generic type class from a generic type interface

    Hi there,
    How can I make a non-generic type class from a generic type interface?
    I appreciate if somebody let me know which site can help me.
    Regards
    Maurice

    I have a generic interface with this signature
    public interface IELO<K extends IMetadataKey>
    and I have implemented a class from it
    public class CmsELOImpl<K extends IMetadataKey> implements IELO<K>, Cloneable, Serializable
    then I have to pass class of an instance CmsELOImpl to AbstractJcrDAO class constructor whit below signature
    public abstract class AbstractJcrDAO<T> implements JcrDAO<T> {
    public AbstractJcrDAO( Class<T> entityClass, Session session, Jcrom jcrom ) {
              this(entityClass, session, jcrom, new String[0]);
    So I have made another class extended from AbstractJcrDAO. Below shows the code of this class and itd constructor
    public class ELODaoImpl extends AbstractJcrDAO<CmsELOImpl<IMetadataKey>> {
         public ELODaoImpl( Session session, Jcrom jcrom ) {
         super(CmsELOImpl.class , session , jcrom, MIXIN_TYPES);
    and as you see in its constructor I am calling the AbstractJcrDAO constructor by supper method
    then I got this error on the line of super method
    The constructor AbstractJcrDAO(class<CmsELOImpl>, session, Jcrom, String[]) is undefined.
    as I know java generics are implemented using type erasure. This generics are only
    in the java source file and not in the class files. The generics are only used by the compiler and
    they are erased from the class files. This is done to make generics compatible with (old) non generics java code.
    As a result the class object of AbstractJcrDAO<CmsELOImpl<IMetadataKey>>
    is AbstractJcrDAO.class. The <CmsELOImpl<IMetadataKey>> information is
    not available in the class file. As far as I understand it, I am looking a way
    to pass <CmsELOImpl<IMetadataKey>>, if it is possible at all.
    Maurice

  • Best CC Plan for 10 person graphic design class for 4 months

    Hi all,
    Just wondering what the best plan would be for a 10 person graphic design class I will be teaching next semester.  We will need Adobe Illustrator and Photoshop for 2-4 months only.  What would be the best deal?
    I was looking at the student/teacher special offer for $19.99/month, but I can't figure out if that is just per user, or if that works for the whole classroom (which would be fantastic if that's the case).
    Thanks for your advice!

    Hi Marin Belec,
    You have two options:
    1.You can subscribe to CC complete package month to month subscription if you want it for two months only.
    2. You may subscribe to CC teams package for so many users.
    Regards
    Gurleen

  • Which subscription is best for a non profit organization (with limited funds) who needs CC for 1 day a week for maybe 2 or 3 months?

    Which subscription is best for a non profit organization (with limited funds) who needs CC for 1 day a week for maybe 2 or 3 months?

    Hi sonnetje,
    Kindly go through Creative Cloud pricing and membership plans | Adobe Creative Cloud
    If you need it for 2-3 months please check of month-to-months plan as the Annual membership comes with a contact and there would be an early termination fee attached to it. which is 50% of the remaining months.
    For more info check the below mentioned link.
    Link : Cancel your membership or subscription | Creative Cloud
    Thanks,
    Atul Saini

  • Generic class for deep cloning

    How can I write generic class for deep cloning instead of implementing cloneable for each and every object

    Yes, probably you'd need to use reflection. Though, generic deep copy brings up some issues not readily resolvable at run-time, such as, for example, does the object you want to copy refer to a shared or synchronized resource, such as a db connection? If so, by making a new, say, DBConnection object, you then take up a db connection that you really don't need or want to take up (db conns being scarce in many I.T. shops that own a limited number of Oracle or SQL Server, etc. db conn. licenses). Also, many classes these days are getting written that use "obj = classname.newInstance()" (with their constructors made private so you can't use "new SomeObject()") instead of the more commonsense and traditional "obj = new SomeObject()". [Hey, can anyone explain why it might be preferable to use "classname.newInstance()" at times over "new SomeObject()"?  I can't to this day tell why it might be better or why some hacks have started doing this.]
    I am not saying either that you couldn't do it or that you shouldn't. In fact, if you wrote a really good generic deep copy class, it may very well suit your needs 95+% of the time. It'd be a great programming exercise that would likely result in something very useful to someone somewhere (yourself included), and would get you to really learn the reflect package, time generally well-spent. I also can see how it'd be a great exercise in writing recursive calls (if for example you'd like no limit to the depth of objects created within your deep-copied object). You may need to supply a few caveats for use, such as that there's no guarantee that objects within the object to be copied that don't have public constructors can be copied, and that objects that hold other objects that are limited in availablity due to their very natures, such as db connections, may not get fully copied. Another one may be that no object can be copied as long as a thread created and run from it is executing at the time the copy is done (because you couldn't guarantee the to-be-copied object instance's data or object reference state), or that perhaps in some cases, certain kinds of method-level (ie, what's officially called by Sun, "automatic") variables declared and used within, for example, blocks of code within methods, may not have their values copied correctly if they are not visible to the reflect pkg objects (though I'd have to look into that one myself to be sure it would be an issue).
    Doing a search on "deep copy" or "deep clone" on java.sun.com as well as on the 'net reveals surprisingly little except suggestions for using object serialization to do all the dirty work for you.
    I am surprised there isn't a kind of virtual working group trading ideas on the topic and trying collaboratively to come up with a good, solid generic deep copy class as a public service for all the Java brethren. Does anyone know of one? And if not, wanna start one?

  • No internet or phone service for over a month

    I will try to write calmly, but I am EXTREMELY angry and frustrated with verizon support.
    Our internet and phone service have been down for over a month. We've called over and over, and they've sent technicians. The first two technicians disappeared after fiddling around with our cables. Then someone from Verizon came around and said our cables and setup was fine, but it was something wrong at the Verizon office. They said it would be fixed within 2 days.
    Then about a WEEK after that, we got angry and called Verizon support. They sent a technician 2 days later, who fiddled around. He said that it should be working within an hour and that he'd call us to see if it was working. Well 2 hours later, it still wasn't working..but Verizon sent me a call on my cellphone saying that our "problem" was cleared.Well IT WASN'T.
    And now it's been about 2 weeks since THEN and we haven't had internet or phone service. We filed another request, but it says in the Status that Verizon does not need to send a technician or something. Well WE DO NOT HAVE PHONE OR INTERNET SERVICE. And they have the NERVE to keep sending us bills.
    We are just tired of Verizon. We do not know what to do. Somebody get me a lawyer. Or some verizon support that DOESN'T have an indian accent, and can fix this **bleep** problem.
    Thank you.

    I can see why you would be angry and frustrated. I got the same Central Office story from the (otherwise very helpful) agent with an Indian name that I online chatted with yesterday, which makes that sound like a generic **bleep** response for something that's wrong with the Fios network. I've only been out for about 34 hours so far (they've said I will have service back by the evening of May 3, meaning only 4 1/2  days without service, lucky me!), but I was dumb enough to get phone, internet and TV all through Fios, so I have none of those. Fortunately I kept a Comcast internet account as backup, which is how I can access this forum.  I do have a cell phone and I can get a few TV channels over the air, but that's not why I'm paying {please keep your posts courteous}$155 a month. And it is simply insulting to call Support and get put on hold for an hour. I'm reminded of the old Lily Tomlin SNL skit where she says something along the lines of "we're the telephone company, we don't have to care". Verizon may no longer be Ma Bell, but that attitude hasn't changed.

  • Unable to compile class for JSP

    Please can anyone help me to solve this.
    Actually,this is the condition.
    In my db,there is a table called UserPassword, which has 4
    fields(empNo,UserName,password,level). Now I want to do these things:
    When the user submits the data to create a new account via HTML form, it submits the data to the file called CreateAcc.jsp. In this file it perform some logic,here are they.
    1)To check the empNo,if it is already exist in the DB,
         if empNo =exist then display error.(record already exist)
         if empNo =notexist then do task 2).
    2)check the UserName,if it is already exist in the db,
         if UserName=exist then display error.(because it's a primary key)
         if UserName=notexist then do task 3).
    3)Create a new user account and save it to the db.
    To do these tasks,I never create a new objects for the tasks 1) and 2).
    only for task 3)create an object.
    Is it the right way?
    Here is the file CreateAcc.jsp
    <%@ page language="java" %>
    <%@ page import="core.UserAccManager" %>
    <%@ page import="data.UserPassword" %>
    <jsp:useBean id="UserAccManager" class="core.UserAccManager" scope="session"/>
    <jsp:setProperty name="UserAccManager" property="*"/>
    <jsp:useBean id="UserPassword" class="data.UserPassword" scope="session"/>
    <jsp:setProperty name="UserPassword" property="*"/>
    <%
    String nextPage ="MainForm.jsp";
    if(UserPassword.verifyEmpno()){
         if(UserPassword.verifyUsername()){
              if(UserPassword.createAcc()) nextPage ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>The directory structure:
    UserPassword.java- F:/Project/core/data/UserPassword.java
    UserAccManager.java - F:/Project/core/UserAccManager.java
    Now both are compiling.I put the class files into the TOMCAT,as follows.
    UserAccManager.class - webapps/mySystemName/WEB-INF/classes/core/
    UserPassword.class - webapps/mySystemName/WEB-INF/classes/core/data/
    Here is the full code of the file UserAccManager.java.
    package core;               //Is this right?
    import data.UserPassword;     //Is this right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public final class UserAccManager{
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
       private static PreparedStatement pstmt2;     
       private static PreparedStatement pstmt3;     
       private UserAccManager(){
       // Initializes the connection and statements
       public static void initConnection() {
          if (connection == null) {
             try {
                String sql;
                // Open the database
                Class.forName(DRIVER).newInstance();
                connection = DriverManager.getConnection(URL);
                // Prepare the statements
               sql = "SELECT * FROM UserPassword where empNo= ?";
               pstmt1 = connection.prepareStatement(sql);
                sql = "SELECT UserName FROM UserPassword where UserName= ?";
                pstmt2 = connection.prepareStatement(sql);
             sql ="INSERT INTO UserPassword VALUES(?,?,?,?)";
             pstmt3 = connection.prepareStatement(sql);
             catch (Exception ex) {
                System.err.println(ex.getMessage());
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public  void closeConnection() {
          //same as previous
       public static boolean verifyEmpno(int empno) {
          boolean emp_no_select_ok = false;
          int emp = -1;
          initConnection();
         try {
          pstmt1.setInt(1, empno);
             ResultSet rs1 = pstmt1.executeQuery();
         while(rs1.next()){
              emp=rs1.getInt("empNo");
         if(emp>0)
              emp_no_select_ok = false;
         } else{
              emp_no_select_ok = true;     
            rs1.close();
         pstmt1.close();     
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return emp_no_select_ok;
       public static boolean verifyUsername(String username) {
          boolean user_name_select_ok = false;
          String user = "xxxx";
          initConnection();
          try {
          pstmt2.setString(1, username);
             ResultSet rs2 = pstmt2.executeQuery();
            while(rs2.next()){
              user=rs2.getString("UserName");
               if(!user.equals("xxxx"))
              user_name_select_ok = false;
            } else{
              user_name_select_ok = true;     
           rs2.close();
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return user_name_select_ok;
         public static boolean createAcc(int empno, String username, String password, int
    level){
              boolean create_acc_ok = false;
              initConnection();
              try{
                      //create a new object,from the UserPassword table.
                   UserPassword useraccount = new UserPassword();
                   useraccount.setEmpno(empno);
                   useraccount.setUsername(username);
                   useraccount.setPassword(password);
                   useraccount.setLevel(level);
                   //assign value for ???
                   pstmt3.setInt(1, useraccount.getEmpno());
                   pstmt3.setString(2, useraccount.getUsername());
                   pstmt3.setString(3, useraccount.getPassword());
                   pstmt3.setInt(4, useraccount.getLevel());          
                   if(pstmt3.executeUpdate()==1) create_acc_ok=true;
                   pstmt3.close();
                           //con.close();
                catch(SQLException e2){
                           System.err.println(e2.getMessage());
              return create_acc_ok;
    }here is the bean (part of it)
    package data;               //is it right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UserPassword
         private int empno;
         private String username;
         private String password;
         private int level;
         // Constructor
         public UserPassword()
              this.empno = empno;
              this.username = username;
              this.password = password;
              this.level = level;
         // setters and getters are here.
    //     public boolean verifyEmpno() {
    //               return UserAccManager.verifyEmpno(empno);
    //       public boolean verifyUsername(String username) {
    //            return UserAccManager.verifyUsername(username);
         // These 2 methods not compile with or without para's.So I leave that job for the      
         //controll class UserAccManager.java.
    Now my problem is this: When I submit data, there is an error;org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:8:
    cannot access core.data.UserPassword
    bad class file: C:\Program Files\Apache Group\Tomcat
    4.1\webapps\HRM\WEB-INF\classes\core\data\UserPassword.class
    class file contains wrong class: data.UserPassword
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import core.data.UserPassword;
    ^
    1 error
    Are there any mistakes? If so tell me where is it and how to change them.Please help.

    I try it that way, but it don't compile.
    Error:core\data\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    core\data\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Then it compile well.I goto the directory to get the .class files.
    But there is only UserPassword.class inside the data folder. There is not
    UserAccManager.class in the core folder.
    Then I try this way,I put my 2 java files in to a new folder,
    F:\SystemName\com
    When I try it that way, but it don't compile.
    javac -classpath . -d . com\*.javaError:com\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    com\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Now both are compiling well.There was 2 class files.
    I put them in to the WEB-INF/classes/com directory.
    Start the server.But it gave errors:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserPassword.verifyEmpno(empno)){
                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: non-static method
    verifyUsername(java.lang.String) cannot be referenced from a static context
         if(UserAccManager.verifyUsername(username)){
                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: non-static method
    createAcc(int,java.lang.String,java.lang.String,int) cannot be referenced from a static
    context
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                     ^
    8 errorsTo solve the problem non-static method,I goto the UserAccManager.java file and do these
    things.
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;               //otherwise it tells an error.(package           
                                  //javax.servlet does not exist)
    //import javax.servlet.http.*;
    public  class UserAccManager {
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
        private static PreparedStatement pstmt2;
          private static PreparedStatement pstmt3;
       private UserAccManager() {
       // Initializes the connection and statements
       private static void initConnection() {
             //same
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public static void closeConnection() {
         //same
       public static boolean verifyEmpno(int empno) {
          // same.
       public static boolean verifyUsername(String username) {
         //same.
         public static boolean createAcc(int empno, String username, String password, int      
    level){
              //same
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;
    //import javax.servlet.http.*;
    public class UserPassword {
         // same
    Again compile those files and put .class filses into the WEB-INF/classes/com directory.
    When i submits the data via the form it generates an error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
        [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserAccManager.verifyEmpno(empno)){
                                  ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    6 errorshere is the CreateAcc.jsp file
    <%@ page language="java" %>
    <%@ page import="com.UserAccManager" %>
    <%@ page import="com.UserPassword" %>
    <jsp:useBean id="userPassword" class="com.UserPassword" scope="request"/>
    <jsp:setProperty name="userPassword" property="*" />
    <%
    String nextPage ="MainForm.jsp";
    if(UserAccManager.verifyEmpno(empno)){
         if(UserAccManager.verifyUsername(username)){
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>Please, anyone know how to send these parameters to the java file.
    Thanks.

  • How to use inbound exit class for more than one workflow step

    Hi All,
    In Offline Workflow Approval Scenarios where the work items are sent to outlook of non sap users inbox through workitem exit of the respective workflow item. Based on the user reply from outlook email(either approve or reject) which sends an auto reply to Offline user . We configure an inbound exit class and assign the same in the SMICM transaction. Based on the code written using SAP_WAPI function modules in inbound class exit offline user gets the user approval result and performs the action in SAP.
    My question now Is how can we use this inbound exit class for all the steps of a workflow.
    For ex: In a workflow I have a decision step followed by an activity step. First I will write the work item exit for the user decision step and inbound exit code for the user decision step and offline user executed the user decision step with approve action.
    followed by that I have an activity step for that I will code a work item exit for that activity level but how can I user the same inbound exit class for the activity step as well .
    Quick reply  would be of great  help for me.
    With Best Regards,
    Veni

    For the outbound processing you have the option of replacing the workflow exit by chancing the bsp application of the extended notification (see note 1448241 solution as an example of how to do the change) and replacing the standard links with a "mailto:...".
    As far as the inbound processing, that depends on what should be done in the activity step, if for example you have a bapi which executes what the user does you can call it in the inbound class instead of the user and then the relevant wapi (complete the workitem/raise event etc.).

  • Best Material Type for Handling Non-valuated Materials in Distribution

    Our distribution business will soon be handling non-valuated material and I am trying to determine the best material type to use.  I am considering material type UNBW but would like to know if anyone has advice.  We are strictly providing a service to the vendor for handling these non-valuated materials (for example, wood products).  We will not purchase or sell the product.  Our service consists of receiving the product into inventory from the vendor, tracking the inventory, (in Warehouse Management) and then shipping the material to a customer of the vendor's choosing.  For these non-valuating materials, we are paid strictly for our service of warehousing the material and shipping to a customer.
    Up until now, our distribution business has distributed only valuated materials, i.e., materials we purchase at a price and sell at a price.  We also use vendor consignment.  NOTE: This is not a vendor consignment scenario because we never buy the product.
    Here are our requirements:
    - We don't own the non-valuated product.
    - We need to be able to ship these new non-valuated products on the same shipments as the valuated product we own.
    - We use handling unit and warehouse management for all of our finished goods.
    - We would like to use our existing processes and HU/WM RF transactions to receive and pick the non-valuated product.  This means:
    1) Creating inbound deliveries and packing into HUs.  And applying our HU bar code labels.
    2) Physical inventory counts by HU.
    3) Creating sales orders that have both the non-valuated materials and valuated materials we own.
    4) Creating outbound deliveries and picking via transfer orders in WM.
    5) Assigning the outbound deliveries to a shipment.
    Questions:
    1)  Can a UNBW material that will be stocked but not valuated be received into inventory via a PO?  Any way to receive into inventory with an inbound delivery without using a PO?
    2)  Are there any problems with putting a non-valuated material on a sales order with a zero price?
    3)  Any challenges that other have run into?
    Thanks in advance.
    Rob

    I must be missing something regarding the use of material type UNBW.  When I post the goods receipt for a PO with a UNBW material, no inventory is created.  When I create the PO, an account assignment is required.  I tried both a cost center account assignment (K) and balance sheet account assignment (Z - using a Profit Center).  In both cases, I am forced to check the "Free item" checkbox to avoid entering a price; which also seems strange since the material is UNBW.
    I have searched everywhere for a "Best Practice" for my scenario with little results.  Again, we are simply managing the inventory for a vendor and shipping the inventory to our vendor's customers.  So we are acting as a third pary warehouse and shipper for the vendor.  We do not buy or sell the inventory - we are paid a monthly service fee by the vendor for warehousing their product and shipping it to their customers.  We may ship the product on sales order deliiveries that include both the "non-valuated" product (i.e., free goods we manage for this vendor) and goods that we actually own.
    As an alternative, I am wondering if I should look into somehow using vendor consignment with a settlement price (consignment info record price) of zero.  Vendor consignment is nice because you can track the stock by vendor.  However, we would never truly "settle" with the vendor because we would not be paying the vendor for the inventory and would never own it.
    Our business refers to this as "reload business" but I am not sure this is an industry standard term.
    Any other thoughts out there?

  • Best setup for a non-Mac file server?

    I have a dual xeon server, with a SATA RAID5 I want to use as a file server in a cross-platform environment.
    *What I've tried and the issues...*
    At first I considered using Windows 2003 (Win2k3) but Services for Macintosh (SFM) is an older version of AFP and thus only supports 31 character filenames. With all our Macs supporting SMB/Samba/CIFS and Apple touting that "Macs and PCs can co-exist harmoniously on the same network" I figured I would give that a try.
    SMB doesn't work.
    Sure I can create a connection, but transferring files is a completely different story. I'm trying to backup application and system data, but companies such as Adobe and Apple have named some of their files with special characters that can't be transferred over SMB. I know NTFS doesn't support these characters, but I though a Linux box using SMB would work fine. It doesn't. It's the protocol which keeps me from transferring the data. I end up with the lovely error message of "You cannot copy some of these items to the destination because their names are too long or contain invalid characters for the destination..." (what's sad is, if you google for " because their names are too long or contain invalid characters for the destination" you only get 6 results.)
    So I thought I would give NFS a try. Apple says "Viewed from Mac OS X, [connecting via NFS] is just like connecting to an Apple or Windows server." No. It's not. NFS shares don't even show up in the Finder's Network listing. There are also a pile of other hurdles which are only tackled by savvy, command-line using users.
    So that leaves me with AFP. Win2k3 doesn't support filenames longer than 31 characters, and Win2k8 is dropping SFM altogether. Off to choose a *nix flavor, but that requires Netatalk. It hasn't been updated in years, it has many bad performance reviews... and most distros have removed it. I can download and install it. Oh, but that requires I get the kernel source files. Then I have to create an RPM an that's not working... now I'm several levels deep in trying to figure out how to get Netatalk working and I'm not even sure it will work.
    *What's the best setup for a non-Mac file server?*
    FreeNAS seems promising, but it's in alpha/beta and they have all sorts of warnings regarding potential data loss. Sure there's ExtremeZ-IP, but I really don't want to spend $675 do something Apple claims OS X can already do. I can put just about any non-Mac OS on this thing... what's the best way to set it up so it works?
    Thanks much.

    Rick may be right because although i didnt think of it before i tend to have notoriuosly long classnames for my php classes and i have used samba on occasion (when rsync is out of the question for one reason or another) and never had a problem. I use kubuntu (feisty at the moment )with an ext3 filesystem. if i have a chance this evening ill give it a try and see what happens.
    You could also possibly use FUSE to use an ssh filesystem for the shares... i don tknow how that would figure in your back up though.
    Also if worse comes to worse you could tar or dmg the the necessary files... just some thoughts.
    Ill be interested to know what you end up implementing....
    OH one last thought... Compile Darwin from source and use that as your server

  • Generic Repository class to download BSP into Ms-excel

    Hi,
    we have developed the download utility for BSP-MVC application, we have many BSP-MVC applications so i have to  develop a generic Repository class to download BSP into ms-excel, which is usable for all, the data selection will be done from model at run time by using techniques (field symbols and data references)wolud you please suggest how to achive this.
    Thanks in advance !
    best regards
    ravi

    I have written a generic download utility as a custom BSP Extension Element.  Perhaps it will give you some ideas:
    <a href="/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table a BSP Extension for Downloading a Table</a>
    <a href="/people/thomas.jung3/blog/2005/07/18/bsp-extension-for-downloading-a-table-applying-an-iterator Extension for Downloading a Table: Applying an Iterator</a>

  • Why can we only use 1 release class for overall Release of Purchase Req?

    Hi,
    After realizing that it would be beneficial to use more than one release class for overall release of Purchase Requisition with classification, in use with release groups for overall release, I now ask if someone knows why SAP has chosen to only allow 1 release class for overall release of Purchase Requisition?
    In my scenario I would like Release group US, used for release strategies for US-plant to be able to use 1 release class with a specific set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_USD including a characteristic PR_TOTVAL_USD looking at CEBAN-GFWRT. The chosen currency for this characteristic would be USD.
    I would then like to allow Release group FR, used for release strategies for FRANCE-plant to use another release class with another set of characteristics.
    For example class REL_PREQ_CLASS_OVERALL_VALUE_IN_EUR including a characteristic PR_TOTVAL_EUR looking at CEBAN-GFWRT. The chosen currency for this characteristic would be EUR.
    In this way the release strategies for the respective release groups US and FR, could maintain their overall limit values in their respective release strategies in their own currencies.
    1. Observe that I do not want to use the same Release class for both release groups for overall release, even though I know that this is currently the only allowed option, as far as I've understood.
    2. Observe that I do not want to specify the two characteristics PR_TOTVAL_USD and PR_TOTVAL_EUR for overall value in the same release class, as this would lead to double maintenance for a large number of release strategies. Also consider the maintenance when new countries with new currencies want release strategies.
    3. Observe that I only want to use overall release.
    What I'm trying to avoid is having to continuously translate local business USD overall value limits to limits in the currency chosen for the overall value characteristic. If this for example is specified in DKK, this would lead to a need to adjust the overall value limits as soon as the exchange rate between USD and DKK changes in the system.
    Please consider this simple example:
    Local requirement is that USD purchase requisitions should be blocked when the USD value is above 1000 USD. However in my release strategy I would have to maintain a value of >5365 DDK, if DKK is chosen as the currency for overall characteristic.(e.g exchange rate 5,365).
    Next month the currency exchange rate in the system between USD and DKK has changed, and therefore I would have to go into CL24N and maintain the value to reflect the new exchange rate between USD and DKK. Lets say it has gone up to 5,435. I would now have to maintain a value of > 5435 DKK in my release strategy to correctly reflect the local business requirement of 1000 USD.
    So if anyone could please explain why SAP has taken the decision to make the Release class for overall release client specific that would be much appreciated and awarded accordingly. Also if you have any suggestion on how I could obtain the above scenario on maintaning overall value limits in different currencies than that would be awarded to.
    BR Jakob F. Skott

    You can give feed back to Apple from the iTunes drop-down menu in the iTunes menu bar..
    You can also contact the iTS Customer Service from the links on this page - http://www.apple.com/support/itunes/store/
    MJ

  • Calculate Avg  for the given months based on the no. of days in months

    Dear Experts
    I  have a report in which there is a characterictic claenderyr/month.The Input paramter is claenderyr/month which is restricted by a variable of type interval. i mean user will enter calenderyr/month as interval say 012010 to 06.2010. Now I have to calculate Avg sale Qty for the given months based on the no. of days for the given range of months. How I can achieve this in BW Query. Pl. advice
    Dinesh Sharma

    Hi,
    Create formula for the sales qty.
    maintain the exception aggregation as average based on calday
    Best Regards,
    M.H.REDDY

  • How to create a generic with iMovie for iPad?

    How do i create A generic with iMovie for iPad?

    luckyuis wrote:
    Hi All,
    > I have generated a report showing data for past 12 months and after that i need to include a chart showing Month on X axis with data for past 12 months ..for example if i run the report for June 2011 then on the chart it should take as june 11..>may 11..>april 11........so on june 10 with respect to other values
    >
    > fyi .. i am using type: Numeric Axis..> Date Axis line chart and created seperate formule on top of date field to get past 12 months data
    >
    > Please advise how can i do that on the chart
    >
    > Thanks much,
    > Lucky
    Once you pull the data, goup on the date monthly, most recent first ,and then graph the summaries in the group.

Maybe you are looking for

  • Error when creating master group

    I am trying to set up a replication environment with only one master site. I do it by running SQL script using SQLPlus (rather than using the Wizard). The following is the script I used to create the master site: create user REPADMIN identified by RE

  • Error while generating Rules in GRC5.3  RAR Component

    Hi While generating the rules in Foreground from the GRC 5.3 Risk Analysis & Remediation, we are getting the following error. Error in Rule Generation! Reason:ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.

  • DatagramSockets in stored procedures

    I am having some problems with using JAVA datagram sockets in stored procedures. The code run perfectly when run with JDK. When ran in Oracle8i the call to the procedure is successful, yet no packets are being sent. I am not using a SecurityManager,

  • Cross docking in WM

    HI, can anyone explain about the usage of cross docking functionality and how to use it. how to link an inbound docume

  • Flash Player Upgraded But Lost Capability

    I read thru the other posts with similar/same problems and tried a couple of the recommended mitigations, but did not find an answer that helps me with my situation.  I had visited at least two sites that tell me I don't have the current version of F