How to handle multi canvas?

Hi People,
I have two canvases.CANVAS2 and CANVAS53.when form gets loaded i need CANVAS53 to be appeared.but cursor is only on CANVAS2.what shall
i do to point the cursor on CANVAS53?
With Regards
Vids

Vidu,
you can also do like this.
in form property set navigatation to BLOCK and use the below code. in WNFI
BEGIN
        SHOW_VIEW('CANVAS53');
         HIDE_VIEW('CANVAS2');
END;ON KEY-F5 TRIGGER
BEGIN
   NULL;
END;Regards
Moazam
Edited by: Moazam Shareef on Oct 6, 2010 3:09 AM
Edited by: Moazam Shareef on Oct 6, 2010 3:10 AM
Edited by: Moazam Shareef on Oct 6, 2010 3:11 AM

Similar Messages

  • How to handle multi valued attributes

    Hi All,
    I am supposed to populate multivalued attributes for a field in oim resource profile. Lets assume the field is mailbox. The issue is that I am supposed to reconcile this field from the directory server during initial load. The mailboxes are fetched from the DS based on organization. For provisioning I have to get the mailboxes from the database and these mailboxes are based on the role a user has. At the time of provisioing, I am supposed to populate the mailbox field with values the user already has been provisioned with and also display the mailboxes that he can get access to. I have created the mailbox as a resource with id and name as two of its fields. Could someone please tell me how do I handle this?
    Thanks,
    Supreetha

    I am not sure if I could follow the same thing as mentioned in the link above. Here is my case, Role is a multi valued attribute which i need to handle in oim and is very different from the usual roles. For this purpose, I have created roles as a resource object with role_id as field in its process form.When an admin logs in to assign a new role_id, he should be able to see only those roles for assignment that the admin's org has. I have these org and role mappings in a custom table that I have created in the oim schema. How will I able to display only these available role_ids so that the admin can choose them and assign for the role resource.
    Could you please let me know how do I do the config in oim?
    Thanks,
    supreetha
    Edited by: Supreetha on Nov 13, 2010 2:54 AM

  • How to handle multi row update in table?!

    Hello,
    I am searching for a solution to edit/update a lot of rows of a table at one time. The user has the ability to edit all cells of this table and then update this by pressing a submit button.
    I have a managed bean with an collection of objects. Each object represents on row.
    How is this handled in JSF? Is it only necessary to bind the datatable to the collection?
    Thanks,
    Thomas

    Is it only necessary to
    bind the datatable to the collection?Yes.
    Don't forget to put the collection in session scope.

  • How to Handle Multi Value  Indexes

    Hi all,
    i'm a newbye and i've a class attribute which is a String Array, and i want to create a secondary index on this attibute.
    I'm wondering which is the best solution to achieve this.

    For new users we recommend the DPL. It was created for ease of use.
    However, the DPL doesn't support arrays as key fields. So you would have to concatenate the strings with a delimiter and use a single String field, or if the number of strings is fixed use a composite key with a separate String field for each element. Some references are:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/SecondaryKey.html
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/KeyField.html
    If you use the Base API or the Collections API you can use a tuple binding to create a secondary key DatabaseEntry from a String array. For example, you can call TupleOutput.writeString for each element.
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/bind/tuple/TupleBinding.html
    What sort order for your key are you expecting? I assume you want the keys sorted by each string in array element order. That means you should NOT write the length of the array at the beginning of the key, since that will cause the sort order to be primarily based on the array length. Instead you can write an empty string as a terminator, or use TupleInput.available to test for whether you've read all strings in the key. The latter is recommended.
    I assumed above that the array length is variable. If it is fixed length, you don't need a terminator.
    If you don't care about key sort order, consider using a hash of the String array as the key. The hash field could be a single key field, which would work with the DPL.
    I'm giving you a lot of general info. If you can be more specific about what you're doing, I can give more specific advice. I suggest that you start with one of the APIs and try doing what you want. Then you can post specifics about the questions you run into.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Handling multi byte languages in Web Service

    Hi,
    I am calling a web service and its working fine with English language i.e web service is returning correct parameters with English.
    But it's returning me Junk characters when i call web service with multi byte languages like Japanese, Russian etc.,
    Generally while configuring Web Service or calling a web service using proxy - it asks for a user id/ Pwd but not a logon language (unlike while you login SAP it asks for Logon Language) so i am thinking since there is no option to enter log on language, its taking a default language i.e English so when i am passing japanese its returning me Junk Values.
    Can any one please help me with this? How to handle multi byte webservice call? I am using ECC 5.0.
    Thanks & Regards,
    Pavan.

    I appreciate your thought but our webservice must be able to handle multiple languages not only Japanese. Users might call webservice in any language they prefer. If i change it my default to Japanese, i will have problem when users call webservice in Russian.

  • How does IDP handle multi-value attributes in directory?

    I have a directory referenced by the IDP where the mail attribute is multi-value. Assertions being received by the SP are indicating that the mail attribute is null or empty. How does the Oracle IDP handle multi-value attributes from a directory? Is there a way to select the first entry in an array of multi-values?

    On the IdP side, passing of multi-valued attributes is supported. Read this section:
    http://download.oracle.com/docs/cd/E10773_01/doc/oim.1014/b25355/configuring.htm#BCGCGFCJ
    Snippet (under 'Delimited Data'):
    "In addition to supporting and passing multi-valued attributes, Oracle Identity Federation can also support delimited data to provide multiple values for assertion attributes ......"
    This information is also available on the OIF screen for 'Add Assertion Profile'.
    On the SP side, mapping a multi-valued assertion attribute to a local user attribute is NOT supported. Read this section:
    http://download.oracle.com/docs/cd/E10773_01/doc/oim.1014/b25355/configuring.htm#BCGGEAEA
    Snippet (under Submit/Reset button):
    "Note: Mapping an assertion attribute containing multiple values to a local user is not supported."
    So, basically, there is no way to send only the first value of an LDAP attribute.
    -shetty2k

  • Newbie: How to handle a multi-step dialogue with no session?

    I can't see how to handle the following trivial problem:
    1. The user clicks on a button to retrieve values from the database
    2. The values returned are displayed in a table on the same page
    3. The user clicks a button next to the desired element
    4. Some action is performed
    I can achieve steps 1, 2, 3 but fail on step 4: the action is not called.
    One prerequisite is that I don't want to store anything in the session or application scope.
    In the example that follows, when you click on "Show Element" the action is not performed.
    This is myExample.jsp:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <TITLE>Test</TITLE>
    </HEAD>
    <f:view>
         <BODY>
         <h:form>
              <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
              <p/>
              <h:dataTable value="#{myExample.elements}" var="elem" binding="#{myExample.dataTable}">
                   <h:column>
                        <h:outputText value="#{elem}"/>
                   </h:column>
                   <h:column>
                        <h:commandButton type="submit" value="Show Element"     action="#{myExample.doShowElement}"/>
                   </h:column>
              </h:dataTable>
         </h:form>
         </BODY>
    </f:view>
    </HTML>This is myExample.java:
    package example;
    import javax.faces.component.html.HtmlDataTable;
    public class MyExample {
         private HtmlDataTable dataTable;
         private String[] elements;
         public MyExample() {
         private String[] readFromDatabase() {
              return new String[] {"one", "two", "three"};
         public String[] getElements() {
              return elements;
         public void setElements(String[] elements) {
              this.elements = elements;
         public HtmlDataTable getDataTable() {
              return dataTable;
         public void setDataTable(HtmlDataTable dataTable) {
              this.dataTable = dataTable;
         public String doSearch() {
              elements = readFromDatabase();
              return "";
         public String doShowElement() {
              String selected = (String) dataTable.getRowData();
              System.out.println("Selected element: " + selected);
              return "";
    }This is in faces-config.xml
         <managed-bean>
              <managed-bean-name>myExample</managed-bean-name>
              <managed-bean-class>example.MyExample</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
         </managed-bean>

    Thank you for your answer.
    I didn't realise I could use inputHidden for anything more complex than a single string...
    I have added a h:inputHidden for the elements array but it still doesn't work.
    How should it be used?
         <h:form>
              <h:inputHidden value="#{myExample.elements}"/>
              <h:commandButton action="#{myExample.doSearch}" value="Search Database" />
    ...While debugging I noticed that at the last button-press the getElements method is called twice before setElements, returning null.

  • How to handle multiple records in BPMN process

    Hi All,
    We are using Oracle BPM 11g.In my requirement,I am using the database adapter to get the data from table and I need to validate the each record and update the status of that record from the BPM Process.But I dont know how to handle if multiple records come at a time.Can anybody please helpout from this problem.
    Thanks in advanced.
    Narasimha Rao.

    Can you have a look at this post: http://redstack.wordpress.com/2010/09/30/iteratingtraversing-arrays-in-bpm/
    It's solving a different problem, but the key is that it's using a multi-instance subprocess to iterate over an array of "things" that need to be acted in. In your case it's the set of results from the db query rather than the set of tests in the example. But the principle is the same. You'd take collection of rows from the DB and process them in a multi-instance subprocess. The text that begins with the following would be good place to start:
    "Now let’s implement the body of our process. We will use the Subprocess object to handle the traversal of the array of tests. Drag a Subprocess from the component palette on the right into the process and drop it on the line between the Start and End nodes."
    In the loop characteristics you'd define whether you want to execute serially or in parallel.

  • How to handle selection event in alv component

    Hi all,
        i am new to webdynpro abap. and i want to know how to handle selection event(such as select all / unselect ) in my simple alv application.
    Thanks very much

    Hi,
    By default when you use the selection mode for the ALV as Multi/Mutli No Lead then this option is enabled.
    Try to implement the event ONLEADSELECT and check wether this event is triggered or not.
    DATA: lo_value type ref to cl_salv_wd_config_table.
        CALL METHOD  lo_value->if_salv_wd_table_settings~set_selection_mode
          EXPORTING
            value = cl_wd_table=>e_selection_mode-multi_no_lead.
    Try to implement these event for ALV and put a break-point and test which event is getting triggered.
    ON_CLICK           
    ON_DATA_CHECK      
    ON_FUNCTION        
    ON_LEAD_SELECT     
    ON_STD_FUNCTION_AFTE
    ON_STD_FUNCTION_BEFO
    Please provide more inputs.
    Regards,
    Lekha.

  • How to handle the trigger sequence

    I really do not have any idea for this question.
    the trigger need to implement:      
    An employee can not work on more than 2 projects supervised by any given department.
    DEPARTMENT (dname, dnumber, mgrssn, mgrstartdate) KEY: dnumber.
    PROJECT (pname, pnumber, plocation, dnum)      KEY: pnumber.
    CREATE TABLE WORKS_ON
    ( ESSN VARCHAR2(9) NOT NULL,
      PNO NUMBER NOT NULL,
      HOURS NUMBER(3,1) NOT NULL,
    PRIMARY KEY (ESSN, PNO));
    DESC WORKS_ON;
    INSERT INTO WORKS_ON VALUES
    ('123456789',1,32.5);
    INSERT INTO WORKS_ON VALUES
    ('123456789',2 ,7.5);
    INSERT INTO WORKS_ON VALUES
    ('666884444',3 ,40.0);
    INSERT INTO WORKS_ON VALUES
    ('453453453',1 ,20.0);
    INSERT INTO WORKS_ON VALUES
    ('453453453',2,20.0);
    CREATE TABLE PROJECT
    (PNAME VARCHAR2(15) NOT NULL,
    PNUMBER NUMBER NOT NULL,
    PLOCATION VARCHAR2(15),
    DNUM NUMBER NOT NULL,
    PRIMARY KEY (PNUMBER), UNIQUE(PNAME));
    DESC PROJECT;
    INSERT INTO PROJECT VALUES(
    'ProjectX',1, 'Bellaire',5);
    INSERT INTO PROJECT VALUES(
    'ProjectY',2, 'Sugarland',5);
    INSERT INTO PROJECT VALUES(
    'ProjectZ',3,'Houston',5);
    INSERT INTO PROJECT VALUES(
    'Computerization',10,'Stafford',4);i create package and two trigger like following in order to avoid mutating table.
    PACKAGE                     "HW4AIDB" AS
    TYPE EmploadY IS RECORD(
         Empessn varchar2(9),
         Empprojectcount number,
         Empdepartcount number
    TYPE EmploadarrayY is table of EmploadY
                          index by BINARY_INTEGER;
    Empload EmploadarrayY;
    Emploadsize number;
    END;
    create or replace
    TRIGGER TPROJECTA AFTER INSERT OR UPDATE OR DELETE ON WORKS_ON
    DECLARE
    i number:=0;
    BEGIN
      HW4AIDB.Emploadsize :=0;
      for m in (select w.essn empessn,
      count(w.pno) empprojectcount, count(distinct p.dnum) empdepartcount
      from works_on w, project p
      where w.pno=p.pnumber
      group by w.essn)loop
      i :=i+1;
      HW4AIDB.Empload(i).Empessn := m.empessn;
      HW4AIDB.Empload(i).Empprojectcount := m.empprojectcount;
      HW4AIDB.Empload(i).Empdepartcount := m.empdepartcount;
      dbms_output.PUT_LINE('TPROJECTA '||' '||m.empessn||' '||m.empprojectcount||
                           ' '||m.empdepartcount);
      end loop;
      HW4AIDB.Emploadsize :=i;
      dbms_output.PUT_LINE('==================================');
    END;TRIGGER TSALARYB BEFORE INSERT OR UPDATE OR DELETE ON EMPLOYEE
    FOR EACH ROW
    DECLARE
    w HW4AID.EmploadX;
    i number;
    mypos number;
    BEGIN
    mypos :=-1;
    for i in 1..HW4AID.Emploadsize loop
    if(:new.ssn = HW4AID.Empload(i).Empssn) then
    w.Empmgrsalary := HW4AID.Empload(i).Empmgrsalary;
    w.Empsalary := HW4AID.Empload(i).Empsalary;
    mypos :=i;
    exit;
    end if;
    end loop;
    i :=mypos;
    dbms_output.put_line('NEW '||:new.ssn||'-'||:new.salary);
    if updating then
    dbms_output.put_line('updating......');
    if(:new.salary > w.Empmgrsalary) then
    raise_application_error(-20005,'the salary is higher than that of department manager');
    end if;
    dbms_output.PUT_LINE('update done');
    end if;
    END;
    i defined two trigger for AFTER, trigger run orders are acorrding to. before statement level, before row-level, after row level and after statement level.
    so my trigger actually can not implement requirement. how to handle it. now i try to use this rule: select w.essn, w.pno,p.pnumber, p.dnum from works_on w, project p where w.pno=p.pnumber; in statement level trigger. howerver in row-level trigger i can not get value i need(p.dnum i can not get its count). if you guy have any other ideas, pls give me some advise. my brain is really run out of.
    Thanks for your help!!!

    I would recommend creating a package/procedure that is the only way to insert a user into the works_on table. Then inside this procedure you need to serialize access to the works_on table by using a select for update. Then you can count the number of projects and ensure that the new works on is valid.
    If you try to use triggers then due to Oracle's mutli-versioning, if two users insert the same data at the same time, the data integrity will be violated.
    You will obviously have an employee table. I have created one here as follows:
    create table employee (essn varchar2(9) primary key);
    insert into employee values ('999999999');
    Then you can use this table to serialize access to the works_on table by issuing a select for update against it. If you don't do this then two users executing the procedure at the same time will violate the constraint. It is important that you understand this and try it out with multiple sessions so that you understand it.
    create or replace procedure insert_works_on
    (p_essn varchar2, p_pno number, p_hours number)
    as
    l_essn varchar2(9);
    l_count number;
    begin
    select essn
    into l_essn
    from employee
    where essn = p_essn
    for update;
    select count(*)
    into l_count
    from works_on w
    join project p on p.pnumber = w.pno
    where w.essn = p_essn
    and p.dnum = (select dnum
    from project
    where pnumber = p_pno);
    if l_count < 2
    then
    insert into works_on values (p_essn, p_pno, p_hours);
    else
    dbms_output.put_line('Employee works on more than 1 project for dept');
    end if;
    end;
    Then you can try it out:
    begin
    insert_works_on('999999999',1, 10);
    end;
    commit;
    begin
    insert_works_on('999999999',2, 20);
    end;
    commit;
    begin
    insert_works_on('999999999',3, 30);
    end;
    commit;
    The first two will succeed and the last will fail. Try it out in multiple session as well to ensure it works for a multi-user scenario.

  • How to handle the multiple message on the screen

    I am new to j2me. I am trying to write a simple program for instant messaging. I want to write a program that to handle incoming messages. Now I am able to display one message at a time but I dont know how to handle multiple messages. Do anyone can give an example?
    Is that anyway that pop up an indication for new messages in j2me?
    Need yours expertise to help me. Thanks.

    Use a custom canvas to display messages. Then you can do whatever you want with it!

  • How to protect multi-logon..

    Dear Experts,
    I want to protect multi-logon for business.
    Although I knew how to handling on SAP GUI, (using SUSR0001 - enhancement).
    But I can't handle it on BSP.
    Please, tell me how to protect multi-logon... (only one instance by id)
    Thank you in advance.
    regards,
    kn.

    Hi,
    you have to enhance the class CL_ICF_BASIC_LOGIN in the same way.
    Best regards, Stefan

  • How to handle exception CX_SY_REF_IS_INITIAL

    hi experts,
    im working on a test scenario for abap mapping in SAP XI im getting this error
    An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference
    i understand that i need to catch this exception in the abap coding but i'm not familiar with oops concepts
    can any one please suggest me how to handle this exception for the following code...
    method IF_MAPPING~EXECUTE.
      break x1149.
    * initialize iXML
      TYPE-POOLS: ixml.
      class cl_ixml definition load.
    ** Instances & Variable declaration =======================
    * instance main factory
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA: l_ixml TYPE REF TO if_ixml,
    * instance input stream factory
       l_streamfactory TYPE REF TO if_ixml_stream_factory,
    * instance input stream
      l_istream  TYPE REF TO if_ixml_istream,
    * instance input document
      l_document TYPE REF TO if_ixml_document,
    * instance parse input document
      l_parser TYPE REF TO if_ixml_parser,
    * instance for elements within the nodes
      node      TYPE REF TO if_ixml_node,
    *instance of nodemap
      nodemap   TYPE REF TO if_ixml_named_node_map,
    * instance for iterator
      iterator  TYPE REF TO if_ixml_node_iterator,
      name      TYPE string,
      value     TYPE string,
    * instance main factory
       o_ixml   TYPE REF TO if_ixml,
    * instance output document
       o_document TYPE REF TO if_ixml_document,
    * instance output stream
      o_istream  TYPE REF TO if_ixml_ostream,
    * instance parse output document
      o_parser  TYPE REF TO if_ixml_parser,
    * instance fot renderer
      renderer type ref to if_ixml_renderer,
      irc type i,
      l_xml_size   TYPE i,
    *ROOT ELEMENT
    l_element_MT_DEMANDTEC_COST TYPE REF TO if_ixml_element,
    *NEXT CHILD ELEMENT FROM THE ABOVE PARENT
    l_element_DT_DEMANDTEC TYPE REF TO if_ixml_element,
    *CHILDREN1 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_WHSE  TYPE REF TO if_ixml_element,
    *CHILDREN2 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_DC    TYPE REF TO if_ixml_element,
    *CHILDREN3 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_PLANT    TYPE REF TO if_ixml_element,
    *CHILDREN4 ELEMENT FOR DT_DEMANDTEC
    l_element_DT_QTY    TYPE REF TO if_ixml_element.
    *saving the xml document
      DATA: l_xml_table       TYPE TABLE OF t_xml_line.
      types: begin of t_source,
              whse(5),
              dc(4) ,
              plant(4),
              qty    type i,
             end of t_source.
      types: tt_source TYPE STANDARD TABLE OF t_source.
      data:  wa_source type t_source.
      data: it_source TYPE  tt_source,
            ivalue type string.
    * Procedures and business logic =======================================
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    * how do i catch the exception for type CX_SY_REF_IS_INITIAL ...?
    endmethod.
    full reward points for answers.
    Thanks & Regards,
    Uday Kumar.
    Edited by: UDAY on May 6, 2008 9:32 PM

    Hi Uday,
    Its occurs because you're trying to access a objects with null reference. Or you forgot to create an instance or an error occurs during the instance creation. So You should put all your "Procedures and business logic" inside a Try/catch block. as follow.
    " Define a class exception object to get error message......
    DATA o_exception TYPE REF TO cx_sy_ref_is_initial.
    "// Use the statment Try block to catch the error.
    TRY.
    *   Creating the main iXML factory
      l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
    * create input stream
      l_istream = l_streamfactory->create_istream_xstring( source ).
    *  initialize input document
      l_document = l_ixml->create_document( ).
    *  Create a Parser
      l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    * parse input document
      l_parser->parse( ).
    *   Validate a document
      l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
    *   Parse the stream
      IF l_parser->parse( ) NE 0.
        IF l_parser->num_errors( ) NE 0.
          DATA: parseerror TYPE REF TO if_ixml_parse_error,
                str        TYPE string,
                i          TYPE i,
                count      TYPE i,
                index      TYPE i.
          count = l_parser->num_errors( ).
          WRITE: count, ' parse errors have occured:'.
          index = 0.
          WHILE index < count.
            parseerror = l_parser->get_error( index = index ).
            i = parseerror->get_line( ).
            WRITE: 'line: ', i.
            i = parseerror->get_column( ).
            WRITE: 'column: ', i.
            str = parseerror->get_reason( ).
            WRITE: str.
            index = index + 1.
          ENDWHILE.
        ENDIF.
      ENDIF.
    *   Process the document
      IF l_parser->is_dom_generating( ) EQ 'X'.
        refresh : it_source.
        node ?= l_document.
        CHECK NOT node IS INITIAL.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
            WHEN if_ixml_node=>co_node_text.
    *         text node
              value  = node->get_value( ).
              if name eq 'DT_WHSE'.
                wa_source-whse = value.
              ELSEIF name eq 'DT_DC'.
                wa_source-DC = value.
              ELSEIF name eq 'DT_PLANT'.
                wa_source-PLANT = value.
              ELSEIF name eq 'DT_QTY'.
                wa_source-QTY = value.
                COLLECT wa_source INto it_source.
                CLEAR   wa_source.
              ENDIF.
          endcase.
          node = iterator->get_next( ).
        endwhile.
      ENDIF.
      loop at it_source into wa_source .
        at first.
    *       Creating a ixml factory
          o_ixml = cl_ixml=>create( ).
    *       Creating the dom object model
          o_document = l_ixml->create_document( ).
        endat.
    *       Build and Fill  root node MT_DEMANDTEC_COST
        AT FIRST.
          l_element_MT_DEMANDTEC_COST    =
    O_document->create_simple_element(
                                  name   = 'MT_DEMANDTEC_COST'
                                  parent = o_document ).
        ENDAT.
    *      Build and Fill  Child node DT_DEMANDTEC for parent
    *                                                  MT_DEMANDTEC_COST
        l_element_DT_DEMANDTEC    = O_document->create_simple_element(
                                     name   = 'DT_DEMANDTEC'
                                     parent = l_element_MT_DEMANDTEC_COST ).
    *      Build and Fill  Child node1 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-WHSE.
        l_element_DT_WHSE    = O_document->create_simple_element(
                                         name   = 'DT_WHSE'
                                         VALUE  = ivalue
                                         parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node2 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-DC.
        l_element_DT_DC   = O_document->create_simple_element(
                                             name   = 'DT_DC'
                                              VALUE  = ivalue
                                    parent = l_element_DT_DEMANDTEC ).
    *      Build and Fill  Child node3 DT_WHSE for parent DT_DEMANDTEC
        ivalue              = wa_source-PLANT.
        l_element_DT_PLANT   = O_document->create_simple_element(
                                                 name   = 'DT_PLANT'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
    *      Build and Fill  Child node4 DT_QTY for parent DT_DEMANDTEC
        ivalue              = wa_source-QTY.
        l_element_DT_QTY     = O_document->create_simple_element(
                                                 name   = 'DT_QTY'
                                                  VALUE  = ivalue
                                   parent = l_element_DT_DEMANDTEC  ).
      endloop.
    * render document ======================================================
    * create output stream
      o_istream  = l_streamfactory->create_ostream_xstring( result ).
    *   Connect internal XML table to stream factory
      o_istream  = l_streamfactory->create_ostream_itable( table =
    l_xml_table ).
      renderer = o_ixml->create_renderer( ostream = o_istream
                                              document = o_document ).
      irc = renderer->render( ).
    "   The Statement CATCH define a block that catches the exceptions of the
    "   exception class cx_sy_ref_is_initial
        CATCH cx_sy_ref_is_initial INTO o_exception.
    " If you need to get the error message text do as follow
    DATA errorMsg type string.
    " Get the message text
      errorMsg = o_exception->GET_TEXT( ).
    " Display the error information
      MESSAGE errorMsg TYPE 'I'.
      ENDTRY.
    The TRY block defines a guarded area whose class-based exceptions can be caught in the subsequent CATCH blocks. If no exception occurs in the TRY block and it reaches its end, the system continues the processing after ENDTRY. If a class-based exception occurs in the TRY block, the system searches for an exception handler in the same or an external TRY control structure.
    Font: SAP Help
    You can see a how to create and use an exception in this example [ ABAP Objects - Defining a Class-based exceptions|https://wiki.sdn.sap.com/wiki/x/19w] .
    Best Regards.
    Marcelo Ramos

  • How to handle null values in RTF templates

    Hi - I have two groups in a report for different SQL and two formulas for each group, CF_ELE_CNT and CF_ELE_CNT1. In the template I use the below code to print or not print a section.
    <?if:number(CF_ELE_CNT +CF_ELE_CNT1) >0?>    
    The problem is when there is no data in the second group its not creating the XML tag for CF_ELE_CNT1, though CF_ELE_CNT has 13, it still does not print that partucular section. If I remove CF_ELE_CNT1 from the condition it works fine. I was wondering how to handle this.
    Any help would be appreciated!!
    Thanks,
    Rav

    Hey Rav,
    You can add a check to identify it the element/tag is present or not
    <?if:(CF_ELE_CNT1)?> will give true, if the element is present otherwise falsesince you are adding the two elements, you have to add a or condition.
    <?if:(CF_ELE_CNT and number(CF_ELE_CNT) >0 ) or ( CF_ELE_CNT1 and CF_ELE_CNT1 >0)?>

  • How to handle file on application server without coading?

    HI all,
    can anybody tell me How to handle file on application server without coading? Is there any solution?
    Thanks in advance.

    > can anybody tell me How to handle file on application server without coading? Is there any solution?
    what is that you want to handle. what you do if you don't code ...

Maybe you are looking for