Pass as a parameter or use set() method?

This question may be a bit too abstract:
A method of ClassB needs the HashMap member variable 'map' from ClassA. Should I pass map as a parameter into a method of ClassB, i.e.
ClassB b = new ClassB();
b.aMethod(map);or should I use a set() method in ClassB to set a member variable of type HashMap in ClassB, i.e.
ClassB b = new ClassB();
b.setMap(map); //sets the HashMap member variable in ClassB to equal map
b.aMethod(); //aMethod now performs its operation on the HashMap member variable of ClassBHow do you decide which way is prefereable?

Depends on your model, I suppose. Form the example, though, I wouldn't make the map a member of Class B, unless Class B should logically possess such a map. If the method in Class B is just operating on some values from the map, it makes more sense to me just to pass it in as an argument.

Similar Messages

  • Setting value for attribute  'PO_NUMBER_SOLD'  using setter method

    Hi Experts,
    I need to set the value of a screen field according to some condition. I am using setter method of this attribute to set the value but it is not getting changed.
    I have written following code in DO_PREPARE_OUTPUT method of implementation class ZL_ZZBT131I_ZCREDITCHECK_IMPL using setter method of attribute
    Get Referral Authorization Code
          lv_val1 = me->typed_context->crechkresph->get_po_number( attribute_path = 'PO_NUMBER' ).
          me->typed_context->crechkresph->set_po_number( attribute_path = 'PO_NUMBER'
                                                            value     = ' ' ).
    while debugging I found that in method set_po_number set_property method has been used:--
    current->set_property(
                          iv_attr_name = 'PO_NUMBER_SOLD' "#EC NOTEXT
                          iv_value     = <nval> ).
    In set_property method  following code is getting executed
    if ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY.
              if <VALUE> ne IV_VALUE.
                if ME->MY_MANAGER_ENTRY->DELTA_FLAG is initial.
                first 'change' -> proof that entity is locked
                  if ME->MY_MANAGER_ENTRY->LOCKED = FALSE.
                    if ME->LOCK( ) = FALSE.
                      return.
                    endif.
                  endif.
                flag entity as modified
                  ME->MY_MANAGER_ENTRY->DELTA_FLAG = IF_GENIL_CONTAINER_OBJECT=>DELTA_CHANGED.
                endif.
                ME->ACTIVATE_SENDING( ).
              change value
                <VALUE> = IV_VALUE.
              log change
                set bit LV_IDX of ME->CHANGE_LOG->* to INDICATOR_SET.
              endif.
            else.
            check if it is a real read-only field or a display mode violation
              assert id BOL_ASSERTS subkey 'READ-ONLY_VIOLATION'
                     fields ME->MY_INSTANCE_KEY->OBJECT_NAME
                            IV_ATTR_NAME
                     condition ME->CHANGEABLE = ABAP_TRUE.
            endif.
    and in debugging I found that if part ( ME->IS_CHANGEABLE( ) = ABAP_TRUE and
               LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY) fails and hence else part is getting executed and hence my field a real read-only field or a display mode violation is happening according to comments in code.
    What shall I do so that I would be able to change the screen field value?
    Any help would be highly appreciated.
    Regards,
    Vimal

    Hi,
    Try this:
    data: lr_entity type cl_crm_bol_entity.
    lr_entity = me->typed_context->crechkresph->collection_wrapper->get_current( ).
    lr_entity->set_property( iv_attr_name = 'PO_NUMBER' value = '').
    Also, make sure the field is not read-only.
    Regards
    Prasenjit

  • Unable to set panel  using set method.

    Dear friends,
    I declared a class called EntryPanel in which I declared and initialized the emty panel which I later want to override with new Panel in Child classes. Now I declared an internal frame where I initialized this Panel and later I extended it by Material internal frame in this class I want to override the panel I created in EntryPanel using set but I am unable to do that I am posting the code below. I hope someone would have faced similar problem
    I have created classes as below.
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.GridBagConstraints;
    import javax.swing.JPanel;
    import javax.swing.border.BevelBorder;
    import javax.swing.border.EtchedBorder;
    import noptics.client.lens.gui.AddCancelBtnPanel;
    public class EntryPanel extends javax.swing.JPanel {
         private AddCancelBtnPanel btnPanel;
         private JPanel fieldPanel;
         public EntryPanel() {
              initGUI();
         * Initializes the GUI.
         public void initGUI(){
              try {
                   fieldPanel = new JPanel();
                   btnPanel = new AddCancelBtnPanel();
                   GridBagLayout thisLayout = new GridBagLayout();
                   this.setLayout(thisLayout);
                   fieldPanel.setBorder(new EtchedBorder(BevelBorder.LOWERED, null, null));
                   GridBagConstraints c = new GridBagConstraints();
                   c.gridx = 0;
                   c.gridy = 0;
                   c.gridwidth = 1;
                   c.gridheight = 1;
                   c.weightx = 1.0;
                   c.weighty = 1.0;
                   c.anchor = GridBagConstraints.NORTH;
                   c.fill = GridBagConstraints.BOTH;
                   c.insets = new Insets(5, 5, 5, 5);
                   c.ipadx = 0;
                   c.ipady = 0;
                   this.add(fieldPanel, c);
                   c.gridy = 1;
                   c.weightx = 0.0;
                   c.weighty = 0.0;
                   c.anchor = GridBagConstraints.NORTH;
                   c.fill = GridBagConstraints.HORIZONTAL;
                   c.insets = new Insets(0, 0, 5, 0);
                   this.add(btnPanel, c);
              } catch (Exception e) {
                   e.printStackTrace();
          * @return <code>AddCancelBtnPanel</code> -
          * This can be used to get reference to button panel. 
         public AddCancelBtnPanel getBtnPanel() {
              return btnPanel;
          * @return <code>JPanel</code> - Reference to fieldPanel;
         public JPanel getFieldPanel() {
              return fieldPanel;
          * @param <code>JPanel</code> - panel Replace with orignal Panel
          * with fields.
         public void setFieldPanel(JPanel panel) {
              fieldPanel = panel;
    import javax.swing.JSplitPane;
    import noptics.client.lens.gui.EntryPanel;
    import noptics.client.lens.gui.ListPanel;
    public class ListEntryInternalFrame extends javax.swing.JInternalFrame {
         private EntryPanel entryPanel;
         private ListPanel listPanel;
         private JSplitPane listEntrySplitPane;
          * @param string
         public ListEntryInternalFrame(String string) {
              super(string);
              initGUI();
         public ListEntryInternalFrame() {
              this("");
         * Initializes the GUI.
         public void initGUI(){
              try {
                   listEntrySplitPane = new JSplitPane();
                   listPanel = new ListPanel();
                   entryPanel = new EntryPanel();
                   this.setResizable(true);
                   this.setClosable(true);
                   this.setMaximizable(true);
                   this.setToolTipText("Default List Entry Screen");
                   this.setPreferredSize(new java.awt.Dimension(400,200));
                   this.setAutoscrolls(true);
                   listEntrySplitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
                   listEntrySplitPane.setOneTouchExpandable(true);
                   this.getContentPane().add(listEntrySplitPane);
                   listEntrySplitPane.add(listPanel, JSplitPane.RIGHT);     
                   listEntrySplitPane.add(entryPanel, JSplitPane.LEFT);
              } catch (Exception e) {
                   e.printStackTrace();
          * @return
         public EntryPanel getEntryPanel() {
              return entryPanel;
          * @return
         public JSplitPane getListEntrySplitPane() {
              return listEntrySplitPane;
          * @return
         public ListPanel getListPanel() {
              return listPanel;
    public class MaterialInternalFrame extends ListEntryInternalFrame {
         MaterialPanel material;
          * Default Constructor
         public MaterialInternalFrame() {
              this("Material Entry Screen");          
          * @param <code>String</code> - string
         public MaterialInternalFrame(String string) {
              super(string);
         public void postInitGUI() {
              material = new MaterialPanel();
              super.getEntryPanel().getFieldPanel().add(material);          
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.GridBagConstraints;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    * This panel contains entry field for Material.
    public class MaterialPanel extends javax.swing.JPanel {
         private JTextField nameTxt;
         private JLabel fieldLbl;
         private JLabel titleLbl;
         public MaterialPanel() {
              initGUI();
         * Initializes the GUI.
         public void initGUI(){
              try {
                   titleLbl = new JLabel();
                   fieldLbl = new JLabel();
                   nameTxt = new JTextField();
                   GridBagLayout thisLayout = new GridBagLayout();
                   this.setLayout(thisLayout);
                   thisLayout.columnWidths = new int[] {1,1};
                   thisLayout.rowHeights = new int[] {1,1};
                   thisLayout.columnWeights = new double[] {0.1,0.1};
                   thisLayout.rowWeights = new double[] {0.1,0.1};
                   // this.setPreferredSize(new java.awt.Dimension(200,100));
                   titleLbl.setText("Material");
                   GridBagConstraints c = new GridBagConstraints();
                   c.gridx = 0;
                   c.gridy = 0;
                   c.gridwidth = 2;
                   c.gridheight = 1;
                   c.weightx = 0.0;
                   c.weighty = 0.0;
                   c.anchor = GridBagConstraints.NORTH;
                   c.fill = GridBagConstraints.NONE;
                   c.insets = new Insets(5, 0, 5, 0);
                   c.ipadx = 0;
                   c.ipady = 0;
                   this.add(titleLbl, c);
                   fieldLbl.setText("Name:");
                   c.gridy = 1;
                   c.gridwidth = 1;
                   c.anchor = GridBagConstraints.NORTHEAST;
                   c.insets = new Insets(0, 0, 0, Constants.RIGHTGAP);
                   this.add(fieldLbl, c);
                   nameTxt.setColumns(20);
                   nameTxt.setText("Material Name");
                   nameTxt.setText("Material Name");               
                   nameTxt.setMaximumSize(new java.awt.Dimension(100,40));
                   nameTxt.setMinimumSize(Constants.txtDimension);
                   nameTxt.setPreferredSize(Constants.txtDimension);
                   c.gridx = 1;
                   c.gridheight = 1;
                   c.weightx = 1.0;
                   c.weighty = 1.0;
                   c.anchor = GridBagConstraints.NORTHWEST;
                   c.insets = new Insets(0, 0, 0, 0);
                   this.add(nameTxt, c);
              } catch (Exception e) {
                   e.printStackTrace();
    }

    Sorry, this is just a quick response...i haven't
    really read your code too thoroughly.
    You could try calling
    super.getEntryPanel().validate(); after setting the
    field panel
    or super.getEntryPanel().updateUI();I have tried both but it doesn't work
    when I change my postInitGUI function code as given below I am able to see the Label but the new panel I want to set is not getting set. I can add material panel in old panel but I am unable to reset that panel with new Panel.
    // Function postInitGUI in MaterialInternalFrame class
    public void postInitGUI() {
         super.getEntryPanel().getFieldPanel().add(new JLabel("Hello World"));
         material = new MaterialPanel();
         super.getEntryPanel().setFieldPanel(material);
    }

  • Pass control references to subVI using Invoke Method

    Hi guys,
    Can I use <Control Value Set invoke method> to pass some control references to a sub VI, then use the <Run VI invoke method> to run the sub VI with the previously passed data?  The control refnums are for some frontpanel controls in the Main VI.
    I was able to pass other data but the refnum didn’t work.
    Thanks

    Hi there, There are a couple examples that use the same method. Check them here:
    - Set Control Values and Trigger UI Events in Another VI        
    - Set Values and Properties of Controls in a SubVI
    - Save and retrieve front panel control values
    Alejandro | Academic Program Engineer | National Instruments

  • Set Methods v/s Vector

    Hello,
    In my Java Program, I have a doubt.
    I have 2 set methods, setName(string) and setData(int)
    Eg:
    Name = A
    Data (for A) = 12, 14, 20, 22
    I am having a 'Vector of Array' for storing the data, where each position of the Vector will contain an array. From the Eg., Assume....A will be stored as the 0th element of the array in the 2nd position of the vector. A will be followed by the data items which will occupy the array from the 1st element onwards.
    With respect to the Bean Standards, I can have only one parameter passed into a set method. I am not able to understand how do I add the name and the data inside the Vector. Where exactly should I call my 'addData(String, int)' method?
    Since setName() and setData() come in the 'Properties Window', I am unable to understand how to add the data in the vector. The properties change when there is a 'lost focus', so the method gets called even if either is entered. Whereas, I need the 'Name' and the 'Data' to go into the Vector together.
    Waiting for reply
    Thanks

    In this case directly call the function name and pass the arguments..The get set methods sometimes do not behave properly
    Hello,
    In my Java Program, I have a doubt.
    I have 2 set methods, setName(string) and
    setData(int)
    Eg:
    Name = A
    Data (for A) = 12, 14, 20, 22
    I am having a 'Vector of Array' for storing the data,
    where each position of the Vector will contain an
    array. From the Eg., Assume....A will be stored as
    the 0th element of the array in the 2nd position of
    the vector. A will be followed by the data items which
    will occupy the array from the 1st element onwards.
    With respect to the Bean Standards, I can have only
    one parameter passed into a set method. I am not able
    to understand how do I add the name and the data
    inside the Vector. Where exactly should I call my
    'addData(String, int)' method?
    Since setName() and setData() come in the 'Properties
    Window', I am unable to understand how to add the data
    in the vector. The properties change when there is a
    'lost focus', so the method gets called even if either
    is entered. Whereas, I need the 'Name' and the 'Data'
    to go into the Vector together.
    Waiting for reply
    Thanks

  • How to pass value to select-option parameter using SET PARAMETER Command

    Hi,
        Am passing values to selection-screen fields in report RV13A004 ( used in VK11, VK12 and VK13). using below statement but material number is select-option in this report. am able to pass  MATERIAL FROM using SET PARAMETER ID, can i know how to pass values MATERIAL TO range in select-options fields using SET PARAMETER Command ??
    Passing values to parameter id
    set parameter id 'VKS' field kschl.
    set parameter id 'VKO' field vkorg.
    set parameter id 'VTW' field vtweg.
    set parameter id 'KDA' field erdat.
    set parameter id 'MAT' field matnr_from.
    Change condition price.
    call transaction 'VK12' and skip first screen.
    Thanks in advance.
    Regards,
    Balamurugan.

    Hi,
    instead of using set parameters and dden call transaction use this..........
    submit RV13A004  WITH SELECTION-TABLE rspar
    Effect
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    Notes
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
    When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.
    Cheers
    Will.

  • How to use  SET and GET parameter commands ?

    Explain these two giving an example?As which is used for what?

    Hi Albert,
             SAP allows you to make use of SPA/GPA technique to fill the input fields of a called transaction with data from the calling program.SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
    To fill the initial screen of a program using SPA/GPA parameters, you normally only need the SET PARAMETER statement.
    The relevant fields must each be linked to an SPA/GPA parameter.
    On a selection screen, you link fields to parameters using the MEMORY ID addition in the PARAMETERS or SELECT-OPTIONS statement. If you specify an SPA/GPA parameter ID when you declare a parameter or selection option, the corresponding input field is linked to that input field.
    On a screen, you link fields to parameters in the Screen Painter. When you define the field attributes of an input field, you can enter the name of an SPA/GPA parameter in the Parameter ID field in the screen attributes. The SET parameter and GET parameter checkboxes allow you to specify whether the field should be filled from the corresponding SPA/GPA parameter in the PBO event, and whether the SPA/GPA parameter should be filled with the value from the screen in the PAI event.
    When an input field is linked to an SPA/GPA parameter, it is initialized with the current value of the parameter each time the screen is displayed. This is the reason why fields on screens in the R/3 System often already contain values when you call them more than once.
    When you call programs, you can use SPA/GPA parameters with no additional programming overhead if, for example, you need to fill obligatory fields on the initial screen of the called program. The system simply transfers the values from the parameters into the input fields of the called program.
    However, you can control the contents of the parameters from your program by using the SET PARAMETER statement before the actual program call. This technique is particularly useful if you want to skip the initial screen of the called program and that screen contains obligatory fields.
    If you want to set SPA/GPA parameters before a program call, you need to know which parameters are linked to which fields on the initial screen. A simple way of doing this is to start the program that you want to call, place the cursor on the input fields, and choose F1 followed by Technical info. The Parameter ID field contains the name of the corresponding SPA/GPA parameter. Alternatively, you can look at the screen definition in the Screen Painter.
    The SPA/GPA parameter for the input field Company has the ID CAR. Use this method to find the IDs CON, DAY, and BOK for the other input fields.
    The following executable program is connected to the logical database F1S and calls an update transaction:
    REPORT BOOKINGS NO STANDARD PAGE HEADING.
    TABLES SBOOK.
    START-OF-SELECTION.
      WRITE: 'Select a booking',
      SKIP.
    GET SBOOK.
      WRITE: SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
      HIDE:  SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
    AT LINE-SELECTION.
      SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
                        'CON' FIELD SBOOK-CONNID,
                        'DAY' FIELD SBOOK-FLDATE,
                        'BOK' FIELD SBOOK-BOOKID.
      CALL TRANSACTION 'BOOK'.
    The basic list of the program shows fields from the database table SBOOK according to the user entries on the selection screen. These data are also stored in the HIDE areas of each line.
    Cheers
    Nishanth

  • Using "Set Control Value" to pass a reference

    Hi,
    every time I tried to passe a Control Reference using "Set Control Value" I have the Error 1 (invalid input parameter at invoke node). Why is it not possible to pass a control reference using the invoke node??
    Thanks
    Golzio

    Hi,
    This is possible. Trick is, the type of the control reference needs to be
    the same as the input. E.g. a string control reference is a different type
    as a numeric control reference (, or a control reference).
    To avoid this conflic, make sure the input of the vi is a control reference
    (and not a e.g. string control reference). Also make sure the to convert the
    reference you pass to a control reference (using Application Control>To More
    Generic Class).
    Regards,
    Wiebe.
    "Golzio" wrote in message
    news:506500000008000000C1F00000-1079395200000@exch​ange.ni.com...
    > Hi,
    > every time I tried to passe a Control Reference using "Set Control
    > Value" I have the Error 1 (invalid input parameter at invoke node).
    > Why is it not possible to pass a control re
    ference using the invoke
    > node??
    >
    > Thanks
    > Golzio

  • How the sContainerLocation parameter has been set and used?

    Hi,
    I'm confused with the following 2 methods in IContainerProvider Interface (Java EDK5.0):(1) public IContainer attachToContainer(String sContainerLocation, ChildRequestHint oHint, String Locale);(2).public ChildContainer[] getChildContainers();
    I'm not sure how the sContainerLocation parameter has been set correctly for the top lever container and the sub level (child containers). What i intended to do is crawl all documents (all have a unique ID) into Plumtree portal. I plan to set the parent folder ObjectID as a datasource parameter. Can anyone please tell me how to use the "parent folder ObjectID" in those 2 methods.
    Thanks in advance,

    Mihir,
    For the top-level container, set parent folder Object ID equal to CrawlerConstants.TAG_PATH. I've only configured this via a custom SCI page in the Crawler admin object, so I'm not sure if it will work as a setting in the Data Source as you wish to do. You can try it in the data source and if it doesn't work, then try it in the Crawler. When set correctly, the portal will automatically call attachToContainer with sContainerLocation equal to whatever value you have for TAG_PATH.
    For child containers, just set the sLocation in the ChildContainer equal to the folder ObjectID and the portal will use that as the value for sContainerLocation on its subsequent attachToContainer calls.
    -Dave
    I've set this in the crawler UI, and I'm not sure if it will work in the data source.

  • Passing values from applet using POST method to PHP page

    Hello there ;)
    I realy need a help here.. I`ve been working all day on sending mail from applet. I didn`t succeed bcs of the security restrictions.
    So I decided just to pass arguments into PHP page, which process them and send e-mail to me.
    So here is the problem.. I need to send String variables througth POST into my php page. Now I`m using GET method, but I need more than 4000 characters.
    My actual solution is:
      URL url = new URL("http://127.0.0.1/index.php?name=" + name + "&message=" + message);
    this.getAppletContext().showDocument(url,"_self");I really need to rewrite it into POST. Would you be so kind and write few lines example [applet + php code]? I`ve already searched, googled, etc.. Pls don`t copy links to other forums here, probably I`ve read it.
    Thanx in advance to all :)

    hi!
    i`ve got some news about my applet.. so take this applet code:
    public class Apletik extends JApplet {
        public void init() { }
        public void start()
        try
          String aLine; // only if reading response
          String  parametersAsString = "msg=ahoj&to=world";
          byte[] parameterAsBytes = parametersAsString.getBytes();
          // send parameters to server
          URL url = this.getCodeBase();
          url = new URL(url + "spracuj.php");
          URLConnection con = url.openConnection();
          con.setDoOutput(true);
          con.setDoInput(true); // only if reading response
          con.setUseCaches(false);
          con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length));
          OutputStream oStream = con.getOutputStream();
          oStream.write(parameterAsBytes);
          oStream.flush();
          String line="";
          BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
          while ((aLine = in.readLine()) != null)
           JOptionPane.showMessageDialog(null, aLine);      
           if(aLine.equals("")) break;
          in.close();      
          oStream.close();
        catch (Exception ex)
          JOptionPane.showMessageDialog(null, ex.toString());
    }here is code of spracuj.php which is on server:
    <?php
      if(isset($_POST['msg']))
        echo('hurray!');
    ?>it has only 1 problem.. when i test it on my localhost, everything seems to be all right. but when i post it to my server, i got IOException HTTP 400 error code :( where is the problem? please help me, i`m so close :D thanx

  • Default sales org on selection screen using set and get parameter!!

    Hi,
    I need to default value on selection screen using SET n GET parameter...logic to be used should be:
    Sales Organisation:
    This field should be filled by default using the user parameter id VKO. (using sentence GET PARAMETER and SET PARAMETER)...
    Hope i need to write the code in initialisation and what shud b the content?
    Regards
    Gunjan

    hi,
    TABLES <table name>.
      SET PARAMETER ID VKO FIELD <tablename-fieldname>.
    call transaction 'zxx'.
    try this sample program,
    REPORT BOOKINGS NO STANDARD PAGE HEADING.
    TABLES SBOOK.
    START-OF-SELECTION.
      WRITE: 'Select a booking',
      SKIP.
    GET SBOOK.
      WRITE: SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
      HIDE:  SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
    AT LINE-SELECTION.
      SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
                        'CON' FIELD SBOOK-CONNID,
                        'DAY' FIELD SBOOK-FLDATE,
                        'BOK' FIELD SBOOK-BOOKID.
      CALL TRANSACTION 'BOOK'.
    regards,
    siva
    Message was edited by:
            Shan

  • Parameter form using LOV based on SQL  to pass param to Discoverer portlet

    Hi all
    I have a design issue:-
    I want to create a parameter form in Oracle Portal to allow users to select the department using searchable LOV (like the torch that is there in various oracle products) and pass the selected parameter to the Oracle Discoverer worksheet portlet. The LOV values is required to come from a SQL query which in turn is dependent on User_name varia ble from the session.
    I am looking for any out of the box portlet which can be configured to achieve the same. Any help or pointers in this regard would be greatly appreciated.
    Thanks
    Puneet

    Hi,
    Please refer to the answer in this question Re: OC4J Memory question
    It is similar to your requirement.
    Thanks,
    Sharmila

  • Getter/setter methods -- how do I use the return values

    I'm just learning Java, and I haven't been to this site since the end of July, I think. I have a question regarding getter and setter methods. I switched to the book Head First Java after a poster here recommended it. I'm only about a hundred pages into the book, so the code I'm submitting here reflects that. It's the beginnings of a program I'd eventually like to complete that will take the entered information of my CD's and alphabetize them according to whatever criteria I (or any user for that matter) choose. I realize that this is just the very beginning, and I don't expect to have the complete program completed any time soon -- it's my long term goal, but I thought I could take what I'm learning in the book and put it to practical use as I go along (or at lest try to).
    Yes I could have this already done it Excel, but where's the fun and challenge in that? :) Here's the code:
    // This program allows the user to enter CD information - Artist name, album title, and year of release -- and then organizes it according the the user's choice according to the user's criteria -- either by artist name, then title, then year of release, or by any other order according to the user's choice.
    //First, the class CDList is created, along with the necessary variables.
    class CDList{
         private String artistName;//only one string for the artist name -- including spaces.
         private String albumTitle;//only one string the title name -- including spaces.
         private int yearOfRelease;
         private String recordLabel;
         public void setArtistName(String artist){
         artistName = artist;
         public void setAlbumTitle(String album){
         albumTitle = album;
         public void setYearOfRelease(int yor){
         yearOfRelease = yor;
         public void setLabel(String label){
         recordLabel = label;
         public String getArtistName(){
         return artistName;
         public String getAlbumTitle(){
         return albumTitle;
         public int getYearOfRelease(){
         return yearOfRelease;
        public String getLabel(){
        return recordLabel;
    void printout () {
           System.out.println ("Artist Name: " + getArtistName());
           System.out.println ("Album Title: " + getAlbumTitle());
           System.out.println ("Year of Release: " + getYearOfRelease());
           System.out.println ("Record Label: " + getLabel());
           System.out.println ();
    import static java.lang.System.out;
    import java.util.Scanner;
    class CDListTestDrive {
         public static void main( String[] args ) {
              Scanner s=new Scanner(System.in);
              CDList[] Record = new CDList[4];
              int x=0;     
              while (x<4) {
              Record[x]=new CDList();
              out.println ("Artist Name: ");
              String artist = s.nextLine();
              Record[x].setArtistName(artist);
              out.println ("Album Title: ");
              String album = s.nextLine();
              Record[x].setAlbumTitle(album);
              out.println ("Year of Release: ");
              int yor= s.nextInt();
                    s.nextLine();
              Record[x].setYearOfRelease(yor);
              out.println ("Record Label: ");
              String label = s.nextLine();
              Record[x].setLabel(label);
              System.out.println();
              x=x+1;//moves to next CDList object;
              x=0;
              while (x<4) {
              Record[x].getArtistName();
              Record[x].getAlbumTitle();
              Record[x].getYearOfRelease();
              Record[x].getLabel();
              Record[x].printout();
              x=x+1;
                   out.println("Enter a Record Number: ");
                   x=s.nextInt();
                   x=x-1;
                   Record[x].getArtistName();
                Record[x].getAlbumTitle();
                Record[x].getYearOfRelease();
                Record[x].getLabel();
                Record[x].printout();
         }//end main
    }//end class          First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.
    Edited by: Straitsfan on Sep 29, 2009 2:03 PM

    Straitsfan wrote:
    First, I'd like to ask anyone out there to see if I could have written this any more efficiently, with the understanding that I'm only one hundred pages into the book, and I've only gotten as far as getter and setter methods, instance variables, objects and methods. The scanner feature I got from another book, but I abandoned it in favor of HFJ.Yes, there is tons you could have done more efficiently. But this is something every new programmer goes through, and I will not spoil the fun. You see, in 3 to 6 months when you have learned much more Java, assuming you stick with it, you will look back at this and be like "what the hell was I thinking" and then realize just haw far you have come. So enjoy that moment and don't spoil it now by asking for what could have been better/ more efficient. If it works it works, just be happy it works.
    Straitsfan wrote:
    Secondly --
    I'm confused about getter and setter methods -- I'd like someone to explain to me what they are used for exactly and the difference between the two. I have a general idea, that getters get a result from the method and setters set or maybe assign a value to variable. I submitted this code on another site, and one of the responders told me I wasn't using the returned values from the getter methods (he also told me about using a constructor method, but I haven't got that far in the book yet.). The program compiles and runs fine, but I can't seem to figure out how I'm not using the returned values from the getter methods. Please help and if you can explain in 'beginners terms,' with any code examples you think are appropriate. It will be greatly appreciated.
    By the way, I'm not a professional programmer -- I'm learning Java because of the intellectual exercise and the fun of it. So please keep that in mind as well.First, if you posted this somewhere else you should link to that post, it is good you at least said you did, but doubleposting is considered very rude because what inevitably happens in many cases is the responses are weighed against each other. So you are basically setting anyone up who responds to the post for a trap that could make them look bad when you double post.
    You are setting you getters and setters up right as far as I can tell. Which tells me that I think you grasp that a getter lets another class get the variables data, and a setter lets another class set the data. One thing, be sure to use the full variable name so you should have setRecordLabel() and getRecodLabel() as opposed to setLabel() and getLabel(). Think about what happens if you go back and add a label field to the CDList class, bad things the way you have it currently. Sometimes shortcuts are not your friend.
    And yes, you are using the getters all wrong since you are not saving off what they return, frankly I am suprised it compiles. It works because you don't really need to use the getters where you have them since the CDList Record (should be lowercase R by the way) object already knows the data and uses it in the printout() method. Basically what you are doing in lines like:
    Record[x].getArtistName();is asking for the ArtistName in Record[x] and then getting the name and just dropping it on the floor. You need to store it in something if you want to keep it, like:
    String artistName = Record[x].getArtistName();See how that works?
    Hope this helped, keep up the good learning and good luck.
    JSG

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • Problem when using WEB.SHOW_DOCUMENT and passing in lexical parameter

    Hi,
    I got a blank page with error "An error has occured while trying to use this document" when I tried to use web.show_document and passing a lexical parameter to 10g report on 10gAS. The URL in the web.show_document is:
    http://<srvname>:<portnum>/reports/rwservlet?server=repserver90&report=myrpt.rdf&destype=Cache&desformat=pdf&userid=<usr>/<pw>@<db>&where_clause=where%20product_type%20in%20('REPORT')
    If I change the desformat to htmlcss, it is fine to display the report. But doesn't work with desformat=pdf. The pdf file has been generated in the cache. Why can't it display on the screen.
    Also I tried to use double quote the value for where_clause. The pdf report showed up. But it ignored the where clause.
    Experts please help.
    Ying

    I use lexical parameters and they work fine, but I use a parameter list. The code is contained in a form that is called by all forms that wish to run a report. This way you only need the logic for printing in a single form. If you want the form, email me at [email protected]

Maybe you are looking for