Doubt about select in method.

Hi Gurus.
In Webdynpro can we use Select in method?
If dont , how we can use the select comand in method? And why is not permited.?
Thanks

Hi Ronaldo,
Though system does not throw any errors if we write select queries in WD component controller/view controller but we should never write a DB queries like select, insert, update, etc because it has an impact on performance of web dynpro application.
Web dynpro applications are heavy and it runs in front end and hence only the ui logic to be placed in WD components and the business logic/db queries to be placed in a model viz, class / function module, etc.Hence WD implementation should strictly follow the MVC architecture
For more details on MVC in WDA, please refer the below links
Web Dynpro Architecture (SAP Library - Web Dynpro for ABAP)
Architecture of Webdynpro for ABAP - Web Dynpro ABAP - SCN Wiki
Hence, you should use either a class / function module to place your business logic and call the methods/ function modules inside the WD component.
In general, for every WD component, a assistance class will be attached and it assists the component with business logic. So, we can call the method of an assistance class in WD component.
Hope this helps you.
Regards,
Rama

Similar Messages

  • Doubt about Select statement.

    Hi folks!!
                 I have a few doubts about the select statements, it may be a silly things but its useful for me.
    what is   difference between below statment.
    1)SELECT * FROM TABLE.
    2)SELECT SINGLE * FROM TABLE
    3)SELECT SINGLE FROM TABLE.
    Hope i will get answer,thanks in advance.
    Regards
    Richie..

    Hi,
    try this and if possible use sap help.i mean place the cursor on select and press F1.
                 Types of select statements:
    1.     select * from ztxlfa1 into table it.
                 This is simple select statement to fetch all the data of db table into internal table it.
       2.   select * from ztxlfa1 into table it where lifnr between 'V2' and 'V5'.
            Thisis using where condition between v2 and v5.
      4. select * from ztxlfa1 where land1 = 'DE'. "row goes into default table work Area
      5. select lifnr land1 from ztxlfa1
            into corresponding fields of it   "notice 'table' is omitted
             where land1 = 'DE'.
              append it.
               endselect.
         Now data will go into work area. and then u will add it to internal table by     
            append statement.
      6.   Table 13.2 contains a list of the various forms of select as it is used with internal tables and their relative efficiency. They are in descending order of most-to-least efficient.
    Table 13.2  Various Forms of SELECT when Filling an Internal Table
    Statement(s)                                   Writes To
    select into table it                                    Body
    select into corresponding fields of table it   Body
    select into it                                    Header line
    select into corresponding fields of it           Header line
    7. SELECT VBRK~VBELN
           VBRK~VKORG
           VBRK~FKDAT
           VBRK~NETWR
           VBRK~WAERK
           TVKOT~VTEXT
           T001~BUKRS
           T001~BUTXT
        INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
        FROM VBRK
        INNER JOIN TVKOT ON VBRKVKORG = TVKOTVKORG
        INNER JOIN T001 ON VBRKBUKRS = T001BUKRS
        WHERE VBELN IN DOCNUM AND VBRK~FKSTO = ''
       AND VBRK~FKDAT in date.
    Select statement using inner joins for vbrk and t001 and tvkot table for this case based on the conditions
    8. SELECT T001W~NAME1 INTO  TABLE IT1_T001W
    FROM T001W INNER JOIN EKPO ON T001WWERKS = EKPOWERKS
    WHERE EKPO~EBELN = PURORD.
    here selecting a single field into table it1_t001winner join on ekpo.
    9. SELECT BUKRS LIFNR EBELN FROM EKKO INTO CORRESPONDING FIELDS OF IT_EKKO WHERE     EBELN IN P_O_NO.
    ENDSELECT.
    SELECT BUTXT   FROM T001 INTO  IT_T001 FOR ALL ENTRIES IN IT_EKKO WHERE BUKRS = IT_EKKO-BUKRS.
    ENDSELECT.
    APPEND IT_T001.
    here I am using for all entries statement with select statement. Both joins and for all entries used to fetch the data on condition but for all entries is the best one.
    10. SELECT AVBELN BVTEXT AFKDAT CBUTXT ANETWR AWAERK INTO TABLE ITAB
                 FROM  VBRK AS A
                 INNER JOIN TVKOT AS B ON
                 AVKORG EQ BVKORG
                 INNER JOIN T001 AS C ON
                 ABUKRS EQ CBUKRS
                 WHERE  AVBELN IN BDOCU AND AFKSTO EQ ' ' AND B~SPRAS EQ
                 SY-LANGU
                 AND AFKDAT IN BDATE AND AVBELN EQ ANY ( SELECT VBELN FROM
                VBRP WHERE VBRP~MATNR EQ ITEMS ).
        Here we are using sub query in inner join specified in brackets.
    Thanks,
    chandu.

  • Doubt about select performance and keys in Select.

    Hi Gurus.
    I need select data from VBAK with key Vbeln (VBFA has value then i can use your vbelv i think)  then with VBAK-BSTNK and VBAK-KUNNR i goin to select data from KNA1 , only field ADRNR , then i going to ADRC table with field ADRNR  like key, then i could select CITY1, STREET, HOUSE_NUM1, HOUSE_NUM2, CITY2, POST_CODE1 e CITY1.
    1- I know that tables has many data then i need advices for a good performance. suggests is welcome.
    2- If i write any thing wrong please tell me .
    3-If anybody know any key that i don´t write please tell me.
    4-If anybody know other way .suggests is welcome.
    Thanks comunitty for help.

    Hi Ronaldo,
    It seems you have everything you need. You have primary keys for VBAK, KNA1 and ADRC, so the best option in my opinion is one select from vbak inner join KNA1. As fopr ADRC it may be tricy because of the date from / to, so this might be worth going FAE. But test both posibilities before settling for one.  I don't know why you need BSTNK though
    By the way, this I assume you are writing a report? cause if you only need one record at a time I suggest you use BAPIs for customer/address.
    Cheers,
    Custodio

  • Doubt about string.intern()

    Hello
    I have a doubt about string.intern() method.
    The document says
    When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the String.equals(Object) method, then the string from the pool is returned.
    So what is the point of using this intern() method with == or != operators if it aleady calling to equals method internally?
    eg:
    if (studentObject.getName().intern() == "Student Name") {}cannot be better than
    if (studentObject.getName().equals("Student Name")) {}Can someone please explain?

    Easy dude.
    >
    Why do you need to optimize it?>
    Because i want to.
    I would avoid the whole stupid 100 line if-else by doing a Map of type->object and then just clone() the object. But maybe that might not be suitable or "fast enough" for you.I cannot do above because object have it's own behaviors varying at run time
    eg - class One has setOne method and class hundred has setHundred method
    . Even if i use a map and clone it again i have to use above comparison for setting those behaviours.
    Explain your actual problem you're trying to solve, with actual cases. What are these "one" and "Hundred" classes really? Or is your project so top secret that you can't tell us?It is not secret but big. And I need to make the question understandable. If I post the whole code no one will looking at it.
    Now you asking so please have a look.
    still I have cleaned up many.
    My initial question was how to bit speed up the comparison? And can't i use intern() Because here if I got plenty of rectangles(it is the last) performace sucks.
    for (CObject aObject : objList) {
                if (aObject.getType().equals(SConstant.TEMPLATE)) { /* process Template */
                    Template tObj = (Template) aObject;
                    org.apache.velocity.Template template = VelocityTemplateManager.getInstance().getObjectTemplateFromFile(retemplateProperties.getProperty("PAGE"));
                    VelocityContext context = new VelocityContext();
                    StringWriter writer = new StringWriter();
                    context.put(retemplateProperties.getProperty("BAND_OBJECT"), dtmBand);
                    tObj.setTags(writer.toString());
                } else if (aObject.getType().equals(SConstant.LINE)
                        && !isInBandandBandAutoAdjust(aObject)) {
                    Line object = (Line) aObject;
                    org.apache.velocity.Template template = VelocityTemplateManager.getInstance().getObjectTemplateFromFile(retemplateProperties.getProperty("LINE"));
                    VelocityContext context = new VelocityContext();
                    StringWriter writer = new StringWriter();
                    updateContextWithCheckShifting(context, object);
                    context.put(retemplateProperties.getProperty("LINE_OBJECT"), object);
                    template.merge(context, writer);
                    object.setTags(writer.toString());
                } else if (aObject.getType().equals(SConstant.IMAGE) /* process Image */
                        && !isInBandandBandAutoAdjust(aObject)) {
                    REImage imageObject = (REImage) aObject;
                    org.apache.velocity.Template template = VelocityTemplateManager.getInstance().getObjectTemplateFromFile(retemplateProperties.getProperty("IMAGE"));
                    VelocityContext context = new VelocityContext();
                    updateContextWithCheckShifting(context, imageObject);
                    context.put(retemplateProperties.getProperty("IMAGE_OBJECT"), imageObject);
                    mageObject.setTags(writer.toString());
                   else if (aObject.getType().equals(SConstant.RECTANGLE) /* process Rectangle */
                        && !isInBandandBandAutoAdjust(aObject)) {
                    Rectangle rectangleObject = (Rectangle) aObject;
                    org.apache.velocity.Template template = VelocityTemplateManager.getInstance().getObjectTemplateFromFile(retemplateProperties.getProperty("RECTANGLE"));
                    VelocityContext context = new VelocityContext();
                    StringWriter writer = new StringWriter();
                    updateContextWithCheckShifting(context, rectangleObject);
                    context.put(retemplateProperties.getProperty("RECTANGLE_OBJECT"), rectangleObject);
                    template.merge(context, writer);
                    rectangleObject.setTags(writer.toString());
                }And masijade
    Thank you very much for the better explanation.

  • Doubt about preferred or available service.

    I have a doubt about preferred or available service.
    I have a Oracle RAC with 3 nodes.
    I created a service GL, but I didn't setup available instance, only preferred instances with 2 instances (PROD1,PROD2)
    srvctl add service -d PROD -s GL -r PROD1,PROD2
    My doubt is:
    If PROD1 instance dies, I would like to know if rac01 is restored automatically on rac02.
    Anybody can help me?
    Thanks in advance.
    Leonardo.

    There are different ways for configure failover... below just an example :
    mydatabase.us.com =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.124.91)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.124.93)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.100.124.95)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = mydatabase.us.com)
    (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 180)
    (DELAY = 5)
    Or... read the document :
    http://docs.oracle.com/cd/B19306_01/network.102/b14213/tnsnames.htm
    Regards,
    Alex Alvarenga.

  • Doubt about  a null value assigned to a String variable

    Hi,
    I have a doubt about a behavior when assigning a null value to a string variable and then seeing the output, the code is the next one:
    public static void main(String[] args) {
            String total = null;
            System.out.println(total);
            total = total+"one";
            System.out.println(total);
    }the doubt comes when i see the output, the output i get is this:
    null
    nulloneA variable with null value means it does not contains a reference to an object in memory, so the question is why the null is printed when i concatenate the total variable which has a null value with the string "one".
    Is the null value converted to string ??
    Please clarify
    Regards and thanks!
    Carlos

    null is a keyword to inform compiler that the reference contain nothingNo. 'null' is not a keyword, it is a literal. Beyond that the compiler doesn't care. It has a runtime value as well.
    total contains null value means it does not have memory,No, it means it refers to nothing, as opposed to referring to an object.
    for representation purpose it contain "null"No. println(String) has special behaviour if the argument is null. This is documented and has already been described above. Your handwaving about 'for representation purpose' is meaningless. The compiler and the JVM don't know the purpose of the code.
    e.g. this keyword shows a hash value instead of memory addressNo it doesn't: it depends entirely on the actual class of the object referred to by 'this', and specifically what its toString() method does.
    similarly "total" maps null as a literal.Completely meaningless. "total" doesn't 'map' anything, it is just a literal. The behaviour you describe is a property of the string concatenation operator, not of string literals.
    I hope you can understand this.Nobody could understand it. It is compete nonsense. The correct answer has already been given. Please read the thread before you contribute.

  • Doubt about Bulk Collect with LIMIT

    Hi
    I have a Doubt about Bulk collect , When is done Commit
    I Get a example in PSOUG
    http://psoug.org/reference/array_processing.html
    CREATE TABLE servers2 AS
    SELECT *
    FROM servers
    WHERE 1=2;
    DECLARE
    CURSOR s_cur IS
    SELECT *
    FROM servers;
    TYPE fetch_array IS TABLE OF s_cur%ROWTYPE;
    s_array fetch_array;
    BEGIN
      OPEN s_cur;
      LOOP
        FETCH s_cur BULK COLLECT INTO s_array LIMIT 1000;
        FORALL i IN 1..s_array.COUNT
        INSERT INTO servers2 VALUES s_array(i);
        EXIT WHEN s_cur%NOTFOUND;
      END LOOP;
      CLOSE s_cur;
      COMMIT;
    END;If my table Servers have 3 000 000 records , when is done commit ? when insert all records ?
    could crash redo log ?
    using 9.2.08

    muttleychess wrote:
    If my table Servers have 3 000 000 records , when is done commit ? Commit point has nothing to do with how many rows you process. It is purely business driven. Your code implements some business transaction, right? So if you commit before whole trancaction (from business standpoint) is complete other sessions will already see changes that are (from business standpoint) incomplete. Also, what if rest of trancaction (from business standpoint) fails?
    SY.

  • Doubt about uses of OBIEE

    I have some doubts about the possible uses of OBIEE. It happens that using OBIEE sometimes users demand report of an "analytical" type, that is aggregated analysis through OBIEE’s Answers, selecting data from dimension tables and measures from fact tables. That’s the ordinary purpose of business intelligence tools!!!
    Some other times though, users demand to perform through Answers analyses of an "operating" type, that is simple extractions of some fields belonging to dimension tables, linked between each other through joins, (hence without querying fact tables): that happens because some of the tables brought in the datawarehouse are not directly linked to any fact table. In this way users want to use Answers to visualize data even for this kind of extractions (or operating reports).
    Is this a correct use of the tool or is it just a “twisted” way of using it, always leading eventually to incorrect extractions? If that’s the case, is it possible to use instead BI Publisher, extracting the dataset through the "Sql Query" mode in a visual manner? The problem of the latter solution, in my case, relies in the fact that users are not enough skilled from the technical point of view: they would prefer to use Answers for every extraction, belonging both to the first type (aggregations) and the second one (extractions), that I just described. Can you suggest a methodology to clarify this situation?

    Hi,
    I understand your point... But I think OBIEE doesn't allow having dimension "on their own", they must be joined to a fact table somehow. This way, when you do a query in answers using fields of two dimension tables a fact table should be always involved. When dimensions are conformed, several fact tables may be used, and OBIEE uses the "best" one in terms of performance. However, there are some tricks that you can do to make sure a particular fact table is used, like using the "implicit fact column" in the presentation layer.
    So back to your point, using OBIEE for "operational" reporting as you call it is a valid option in my experience, but you have to make sure that the underlaying star schema supports the logic that your end users expect when they use just dimension fields.
    Regards,

  • Doubt about Patch

    Hi everyone!
    I have a doubt about applying patch.
    I just applied this patch (using GUI):
    Oracle® Database Patch Set Notes
    *10g Release 2 (10.2.0.4) Patch Set 3 for Microsoft Windows (32-Bit)*
    Initially, there was an error stating that some other process is accessing one particular dll.
    I ignored it.
    I rerun the patch installation thinking that I need to get that dll as well.
    It gave a list of what has been installed and what can be installed.
    So, I selected all the remainders and installed.
    It was successful. Now, would it have ignored that dll or installed it?
    Please advice.
    Thanks in advance.
    Cheers!
    Nith
    Edited by: user645399 on Nov 26, 2010 10:24 AM

    user645399 wrote:
    Hi everyone!
    I have a doubt about applying patch.
    I just applied this patch (using GUI):
    Oracle® Database Patch Set Notes
    *10g Release 2 (10.2.0.4) Patch Set 3 for Microsoft Windows (32-Bit)*
    Initially, there was an error stating that some other process is accessing one particular dll.
    I ignored it.
    I rerun the patch installation thinking that I need to get that dll as well.
    It gave a list of what has been installed and what can be installed.
    So, I selected all the remainders and installed.
    It was successful. Now, would it have ignored that dll or installed it?
    Please advice.
    Thanks in advance.
    Cheers!
    Nith
    Edited by: user645399 on Nov 26, 2010 10:24 AMEvenif you've stopped all the windows services, sometimes some DLLs remains utilized. What I do is, make all the oracle related services manual and then restart the server.
    You can't ignore any dll related errors. If a dll is in use, oracle patching process will not replace that with a newer version of dll. I'll strongly recommend the use of ' Microsoft Process Monitor' utility to monitor, what is running on my server.
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
    Regards,
    S.K.

  • Doubts about Temporary Table.

    Hi,
    I am using Temporary Table.
    But the insert command takes too much time compare to insert in Normal table.
    One more doubt about Temporary Table is:
    Suppose there are two different users. They connect and first insert rows of their use .Now they go for select.
    Does select of one user goes to check the rows of second user also or the temporary table treats 2 users data as inserted in 2 different tables?
    Help!!!

    Nested structure (not deep - deep means their a string or a table as a component)
    TYPES: BEGIN OF tp_header_type,
             BEGIN OF d,
               empresa TYPE ...
               num_docsap TYPE ...
            END OF d,
            awkey TYPE ...
          END OF tp_header_type.
    matt

  • Doubt about Tunning View Objects

    Hi !. I have the following doubt about tunning View Objects:
    If I have the following configuration on a VO:
    All Rows
    In Batches Of: 11
    As Needed
    Access Mode: Scrollable
    Range Size: 10
    Total Records On The Table: More than 100
    What would happen is that while the initial render, the view cache is fetch with 11 rows from the table and the ui table shows 10. In subsequent scroll events, more queries again will be done but not when the user scrolls back. My doubt is this one: Why, while the initial render If I put a breakpoint in this overrided method executeQueryForCollection, the execution reachs there but in subsequent scroll events (forward) the execution doesn't reach there ?. I understand thast this should happen as the required rows are not yet in the cache. I would like to know a way to test this access mode and what method is executed in every roundtrip to the DB. Thankx !.

    I don't think ADF needs to execute the query again - it just needs to fetch the next set of records.
    So if the cursor is already open, no need to issue another query.
    You can use the HTTP Analyzer to watch network traffic
    Monitoring ADF Pages Round-Trips with the HTTP Analyzer
    And you can use the logging features of ADF to see the queries being executed.
    Declarative View Objects (VOs) for better ADF performance

  • Doubt about Report - Task Sequence - Deployments

    Hello,
    I have a doubt about this report Summary report for a task sequence deployment in Task Sequence - Deployments.
    Last Friday I did deployed in 6 desktop ran this report and display my 6 desktop's all right.
    Today a run this report and display no data.
    Why occurred this? Anyone have idea?
    I think this report have display me all data about my task sequence specific.
    Thanks.

    Are you sure the deployment wasn't deleted or recreated? 
    Query your DB and see what the NumberInstalled says.  That should show you 6 were installed.  You just need the Deployment ID added to this query below.
    select *
    from dbo.DeploymentSummary
    where
    OfferID = 'YOUR DEPLOYMENT ID HERE'
    Best, Jacob I'm a PC.
    My TS wasn't modified or recreated, but in DB display NumberInstalled = 0.
    Anyone have modify this TS since last friday, I don't know the reason this happened.
    I will do news deploys and see this report after if still have same issue.
    Thanks your opinion.

  • Why do I get "Select Input Method" dialog when trying to open tabs on some sites?

    This is what I'm experiencing with Firefox mobile on an Android tablet.
    On some sites, when I click a button which should open a new tab, I get the "Select Input Method" dialog box. First, I don't know why this dialog is popping up. Second, it is an empty dialog; there is nothing to select, only a heading that says "Select Input Method". When I touch the heading, I get another "Select Input Method" dialog, this time with "Android Keyboard" as the sole item to be selected. It is already selected. Touching it or backing up to dismiss it leaves me on the page I started on. Touching the original button which should open a new tab simply repeats the entire dialog sequence. Backing up from the original, empty dialog, does the same thing.
    Once or twice, by magic or something, I was able to get the page to open the new tab. But I cannot confirm what sequence of selecting or backing up out of the dialogs may have led to the correct behavior.
    Any help would be appreciated.

    kbrosnan,
    Thanks for the reply. Sorry it took so long to get back to you.
    My wife is working on a project so I'm a little light on details. Apparently she figured out that her Javascript is calling ShowModalDialog and this was what was causing the Select Input Method dialog to open. I don't fully understand the details but she's looking for a different way to do this. I believe she said she subsequently found out that the Firefiox mobile browser doesn't support ShowModalDialog.
    She's new to mobile web development (and I know nothing about it) so she's kind of feeling her way. If you have a good resource for how the FF Android mobile browser differs from the normal desktop browser, that wouldbe a big help, I think. Otherwise, thanks for you reply and she'll keep plugging away discovering what she needs to change in her program to make it work for mobile.
    Thanks.

  • Doubt about @SequenceGenerator annotation (sequenceName element)

    Hello, everybody!
    I'm with a doubt about the @SequenceGenerator annotation. What is that sequenceName element? Is that a stored procedure in the database that we have to create or what? If we specify it, what do we have to create in the database? If we don't specify the sequenceName element, will the sequence be generated for us?
    Thank you in advance.
    Marcos

    B.Mansour Nizar wrote:
    no i don't want to remove the @GeneratedValue but instead just bypass it just in that case only to gain peformanceEither you bypass JPA altogether for the task and then manually update the sequances afterwards or, if you are using hibernate, you implement a custom Idgenerator that can use a provided ID.
    The implementation involves extending IdentityGenerator and ovveriding the generate method to return super.generate if the entity Id is null and return the supplied entity's Id otherwise. You then set that generator for that entity.

  • DOUBT ABOUT MASTER DATA

    Hey guys!!!
    I have a doubt about master data, i need to add an atribute to a master data characteristic, do i have to erase the data to do this or can i add the atribute without erase the data?
    Thanks and Regards!!

    >
    Koundinya Karanam wrote:
    > Hi,
    > You should delete the Master data with SID's first before adding the attribute to that characteristic.
    >
    > Regards,
    > KK.
    KK,
    Thats not true.
    You neednot delete master data to add attributes to a characteristic.
    Additionally, you cannot delete (there are methods to delete which are not suggested) master data in normal way, if there is transactional data for that characteristic.
    Luis,
    You should be able to add attribute to a characteristic without deleting master data, but make sure you load data for the same for values to reflect.

Maybe you are looking for