Error while adding member to the dag in exchange 2013 sp1

I have Windows Server 2012 Std Edition with Exchange 2013 SP1 and get the following error while adding member to the dag either i do it using EAC or the powershell
Senior Technical Consultant, MDS Computers

When running set-databaseavailabilitygroup Exchange-dag without parameters, it crashes again:
[PS] C:\Windows\system32>Set-DatabaseAvailabilityGroup exchange-dag
WARNING: An unexpected error has occurred and a Watson dump is being generated: Some or all identity references could not be translated. Some or all identity references could not be translated.
    + CategoryInfo          : NotSpecified: (:) [Set-DatabaseAvailabilityGroup], IdentityNotMappedException
    + FullyQualifiedErrorId : System.Security.Principal.IdentityNotMappedException,Microsoft.Exchange.Management.Syste
   mConfigurationTasks.SetDatabaseAvailabilityGroup
    + PSComputerName        : <server>
Also, this is logged in the eventlog:
Watson report about to be sent for process id: 7424, with parameters: E12, c-RTL-AMD64, 15.00.0847.032, w3wp#MSExchangePowerShellAppPool, M.Exchange.Management, M.E.M.C.FileShareWitness.Create, S.S.Principal.IdentityNotMappedException, 3e5c, 15.00.0847.031.
ErrorReportingEnabled: True 
Definitely looks like a problem creating the filewitness share.
Frank.

Similar Messages

  • HELP --- Error while adding Portlets to the Page. (WWC-44012)

    Hi all,
    I have a pl/sql portlet. It compiles fine and shows up perfectly in portlet repository. But when i add this to the page, I get following error
    Error while adding Portlets to the Page. (WWC-44012)
    An unexpected error occurred: User-Defined Exception (WWC-43000)
    An unexpected error occurred: User-Defined Exception (WWC-43000)
    An unexpected error occurred: User-Defined Exception (WWC-51004)
    (WWC-00000)
    I checked the portlet specification file (.pks) and body file (.pkb) for any mistakes but they seems fine.
    Does anyone know what can cause this error?
    Any pointers in this regards will be highly appreciated.
    Thanks!!!
    Rajesh

    Rajesh,
    Could you provide some more details about your code? I will try to look into possible causes of the error. One thing you may try is subscribing to the Knowledge Exchange on http://portalcenter.oracle.com. Then you could post your code in your community folder and everyone would be able to test it out.
    Of course, this means you must be willing to share your code with everyone.
    James

  • Javascript errors while adding attachment to list on ribbon sp 2013

    Hi All,
    Javascript errors while adding attachment to list sp 2013
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Mon, 20 Oct 2014 09:49:13 UTC
    Message: Object required
    Line: 1
    Char: 122565
    Code: 0
    URI:
    https://server.com/_layouts/15/form.js?rev=PxBF2F2E04Ut1YUooXDAbg%3D%3D
    Screen become blank and nothing is dosplayed  when attach item is clicked for custom list
    Ravi

    Hi Ravi,
    According to your description, my understanding is that you encountered the error "Object required" when you try to add attachment to list in SharePoint 2013.
    For your issue, you can refer to the blog:
    http://kiran-kakanur.blogspot.com/2010/02/how-to-resolve-object-required-error-in.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • New DAG - 2012R2 & Exchange 2013 SP1

    Hi there,
    Setting up a test platform running on 2012R2 with Exchange 2013SP1, and whilst all looks ok I simply cannot add any server to a new DAG, I can create the dag without any issues and tried using DAG with an IP, and a simplified DAG without IP however simply
    cannot add any of my 2 member servers with the following error;
    Exchange 2013 SP1 A server-side administrative operation has failed. 'GetNetworkConfig' failed on the server. Error: The NEtworkManager has not yet initialized.
    LAN - 10.21.129.111 & 112 / 24
    REPLICATION - 192.168.129.111 & 112 / 24
    I've checked everything! All sits on vCloud, removed ALL NICs and replaced, removed Symantec, no loss between REPL NICs, all seems fine.  Not a lot in the logs other than these last results;
    [2014-03-05T12:51:10] Updating 'MDB001'.MasterServerOrAvailabilityGroup to 'DAG001.
    [2014-03-05T12:51:10] database[ 0 ] (MBDB01)'s MsOrDag=DAG001.
    [2014-03-05T12:51:10] database[ 1 ] (MDB001)'s MsOrDag=DAG001.
    [2014-03-05T12:51:10] Updated Progress 'Successfully updated the membership of server 'SRV111' in Active Directory group 'DAG001'.' 18%.
    [2014-03-05T12:51:10] Working
    I'm at the end of the road and cannot find anything to help me ;(

    HI Jared,
    I agree, have a feeling it's that bit but not sure how to check if working or re-install perhaps.
    Copy status is ALL ok;
    CopyQueueLength - 0
    ReplayQueueLEnght - 0
    ContentIndexState - Healthy
    This is without DAG.  For replication Health fails on last 2 points on both VMs, could it be missed failover cluster bit or didn't install correctly?
    DatabaseRedundancy
    DatabaseAvailability
    RunspaceId       : d4597641-ae09-4687-8e66-cfbef67bc31f
    Server           : SRV111
    Check            : DatabaseRedundancy
    CheckDescription : Verifies that databases have sufficient redundancy. If this check fails, it means that some
                       databases are at risk of losing data.
    Result           : *FAILED*
    Error            : Failures:
                           There were database redundancy check failures for database 'MBDB01' that may be lowering its
                       redundancy and putting the database at risk of data loss. Redundancy Count: 1. Expected Redundancy
                       Count: 2. Detailed error(s):
                               SRV111:
                               Database 'MBDB01' does not have enough copies configured to meet the validation criteria.
                           There were database redundancy check failures for database 'MDB001' that may be
                       lowering its redundancy and putting the database at risk of data loss. Redundancy Count: 1.
                       Expected Redundancy Count: 2. Detailed error(s):
                               SRV111:
                               Database 'MDB001' does not have enough copies configured to meet the validation
                       criteria.
    Identity         :
    IsValid          : True
    ObjectState      : New
    RunspaceId       : d4597641-ae09-4687-8e66-cfbef67bc31f
    Server           : SRV111
    Check            : DatabaseAvailability
    CheckDescription : Verifies that databases have sufficient availability. If this check fails, it means that some
                       databases are at risk of losing service.
    Result           : *FAILED*
    Error            : Failures:
                           There were database availability check failures for database 'MBDB01' that may be lowering its
                       availability. Availability Count: 0. Expected Availability Count: 2. Detailed error(s):
                               SRV111:
                               Couldn't read the database availability group for server
                       'SRV111.ad.totalitycloud.com' from Active Directory. Error: Could not find the database
                       availability group object for server SRV111 in Active Directory.
                           There were database availability check failures for database 'MDB001' that may be
                       lowering its availability. Availability Count: 0. Expected Availability Count: 2. Detailed
                       error(s):
                               SRV111:
                               Couldn't read the database availability group for server
                       'SRV111.ad.totalitycloud.com' from Active Directory. Error: Could not find the database
                       availability group object for server SRV111 in Active Directory.
    Identity         :
    IsValid          : True
    ObjectState      : New

  • Error while adding space to the table space

    HI Gurus
    Can you please put some light on the error which i encountered while adding space to a tablespace
    ALTER TABLESPACE "GISR_NDEX" ADD DATAFILE '+DATA2' SIZE 2G;
    ALTER TABLESPACE "GISR_INDEX" ADD DATAFILE '+DATA2' SIZE 2G
    ERROR at line 1:
    ORA-01119: error in creating database file '+DATA2'
    ORA-17502: ksfdcre:4 Failed to create file +DATA2
    ORA-15041: diskgroup space exhausted
    Any suggestion is highly apprciated .
    Thanks

    Hello;
    The "diskgroup space exhausted" is key.
    Try creating smaller files or adding disk space.
    ASM Disk Group Unbalanced :
    http://surachartopun.com/2010/03/ora-15041-asm-disk-group-unbalanced.html
    Best Regards
    mseberg

  • Error while adding member :

    I am using below code snippet its throwing an below error :
    Before making the bind
    After making the bind
    Before making the connection to LDAP
    javax.naming.NameNotFoundException: [LDAP: error code 32 - 00000525: NameErr: DSID-031A11CC, problem 2001 (NO_OBJECT), data 0, best match of:
    ]; remaining name 'CN=PBTest,OU=PBGroups,DC=pbpilot,DC=pb,DC=com'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2756)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2677)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2483)
    at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1285)
    Properties prop = new Properties();
              prop.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");
              prop.put("java.naming.provider.url", "ldap://152.144.85.129:389");
              prop.put("java.naming.security.principal", "cn=pbwebpostageadmin,OU=ServiceAccounts,DC=pbpilot,DC=pb,DC=com");
              prop.put("java.naming.security.credentials", "WP@dm!n");
              try {  
                   System.out.println("Before making the bind");
                   LdapContext ctx = new InitialLdapContext(prop, null);
                   System.out.println("After making the bind");
                   ModificationItem mods[] = new ModificationItem[1];
                   mods[0]= new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("member", userName));
                   System.out.println("Before making the connection to LDAP");
                   ctx.modifyAttributes(groupName,mods);
                   System.out.println("After making the connection to LDAP");

    When running set-databaseavailabilitygroup Exchange-dag without parameters, it crashes again:
    [PS] C:\Windows\system32>Set-DatabaseAvailabilityGroup exchange-dag
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Some or all identity references could not be translated. Some or all identity references could not be translated.
        + CategoryInfo          : NotSpecified: (:) [Set-DatabaseAvailabilityGroup], IdentityNotMappedException
        + FullyQualifiedErrorId : System.Security.Principal.IdentityNotMappedException,Microsoft.Exchange.Management.Syste
       mConfigurationTasks.SetDatabaseAvailabilityGroup
        + PSComputerName        : <server>
    Also, this is logged in the eventlog:
    Watson report about to be sent for process id: 7424, with parameters: E12, c-RTL-AMD64, 15.00.0847.032, w3wp#MSExchangePowerShellAppPool, M.Exchange.Management, M.E.M.C.FileShareWitness.Create, S.S.Principal.IdentityNotMappedException, 3e5c, 15.00.0847.031.
    ErrorReportingEnabled: True 
    Definitely looks like a problem creating the filewitness share.
    Frank.

  • Error while adding Portlets to the Page. (WWC-44012)

    Hi everyone,
    I am installing the DBPersonalization Manager Provider. I followed directions and am able to successfully bring up the provider's test page. I added the provider to the repository and can preview them without problems. However, when I add the portlet to a page, I get the following error:
    An unexpected error occurred: ORA-29532: Java call terminated by uncaught Java exception: java.io.IOException: Start of root element expected.13
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected. (WWC-43000)
    An unexpected error occurred: java.io.IOException: Start of root element expected.13
    <Line 1, Column 1>: XML-0108: (Fatal Error) Start of root element expected.
    at oracle.webdb.provider.web.SoapResponseProcessor.getDocument(SoapResponseProcessor.java:123)
    at oracle.webdb.provider.web.SoapResponseProcessor.processSOAP(SoapResponseProcessor.java:42)
    at oracle.webdb.provider.web.HttpProviderDispatcher.dispatch(HttpProviderDispatcher.java:877)
    at oracle.webdb.provider.web.HttpProviderDispatcher.registerPortlet(HttpProviderDispatcher.java:201)
    (WWC-43000)
    An unexpected error occurred: Start of root element expected.
    at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java)
    at oracle.xml.parser.v2.XMLError.error(XMLError.java)
    at oracle.xml.parser.v2.XMLError.error(XMLError.java)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java)
    at oracle.webdb.provider.web.SoapResponseProcessor.getDocument(SoapResponseProcessor.java:117)
    at oracle.webdb.provider.web.SoapResponseProcessor.processSOAP(SoapResponseProcessor.java:42)
    at oracle.webdb.provider.web.HttpProviderDispatcher.dispatch(HttpProviderDispatcher.java:877)
    at oracle.webdb.provider.web.HttpProviderDispatcher.registerPortlet(HttpProviderDispatcher.java:201)
    (WWC-43000)
    I am not sure what this is from but assume that it is having problems communicating with my provider. Does anyone have any idea what this could be caused by?
    Thanks in advance...
    Esther Poulsen

    Hi Sue,
    Thanks for your response! I ran the XML file through a validator and examined it manually, and it is fine. Moreover, if I add additional portlets to the provider.xml file, they add themselves without any problems. I'd think the entire thing would break if the provider.xml file was not well formed for any reason. But if anyone has any futher suggestions about this it would be greatly appreciated.
    Thanks in advance,
    Esther

  • Error whil adding Header to the ALV grid using OO

    Hi Guys,
                 I want to display the Header for the ALV grid using Splitter .
    when i am doing like that .I am getting  a screen on the top of that screen I am getting a EMPTY screen .I don't know why likat.
    What i need is just to display a Grid with header?Can anybody Please help me reagarding this problem.
    the Code is Below.
    *& Report  Z_TEST_PGM
    REPORT  Z_TEST_PGM NO STANDARD PAGE HEADING
                                      LINE-SIZE 120 MESSAGE-ID zotc.
    Tables : CKMLMV003 , CKMLMV001.
    TYPE-POOLS: slis.
    Types : Begin of t_CKMLMV003_out,
                 WERKS type CKMLMV003-WERKS,
                 MATNR type CKMLMV003-MATNR,
                 MISCH_VERH type CKMLMV003-MISCH_VERH,
                 KALNR_BAL type CKMLMV003-KALNR_BAL,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 MGTYP type CKMLMV003-MGTYP,
            End of t_CKMLMV003_out,
            Begin of t_CKMLMV001_out,
                 MATNR type CKMLMV001-MATNR,
                 KALNR type CKMLMV001-KALNR,
                 LIFNR_ND type CKMLMV001-LIFNR_ND,
                 EKORG_ND type CKMLMV001-EKORG_ND,
            End of t_CKMLMV001_out,
            Begin of t_CKMLMV003_Temp,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
            End of t_CKMLMV003_Temp,
            Begin of t_Final_out,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 WERKS type CKMLMV003-WERKS,
                 LIFNR_ND1 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH1 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND2 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH2 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND3 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH3 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND4 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH4 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND5 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH5 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND6 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH6 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND7 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH7 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND8 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH8 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND9 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH9 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND10 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH10 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND11 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH11 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND12 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH12 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND13 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH13 type CKMLMV003-MISCH_VERH,
             End of t_Final_out,
           Begin of t_Final_out1,
                 MATNR type CKMLMV003-MATNR,
                 GJAHR type CKMLMV003-GJAHR,
                 PERIO type CKMLMV003-PERIO,
                 LIFNR_ND1 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH1 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND2 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH2 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND3 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH3 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND4 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH4 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND5 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH5 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND6 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH6 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND7 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH7 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND8 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH8 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND9 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH9 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND10 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH10 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND11 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH11 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND12 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH12 type CKMLMV003-MISCH_VERH,
                 LIFNR_ND13 type CKMLMV001-LIFNR_ND,
                 MISCH_VERH13 type CKMLMV003-MISCH_VERH,
             End of t_Final_out1.
                          Global Structures                              *
    Data : i_CKMLMV003_str   type   t_CKMLMV003_out,
           i_CKMLMV001_str   type   t_CKMLMV001_out,
           i_Final_str   type  t_Final_out,
           i_Final_str1   type  t_Final_out,
           i_CKMLMV003_Temp type   t_CKMLMV003_Temp.
                              Global Internal Tables                        *
    Data : i_CKMLMV003_out   type standard table of  t_CKMLMV003_out,
           i_CKMLMV001_out  type standard table of  t_CKMLMV001_out,
           i_Final_out   type standard table of  t_Final_out,
           i_Final_out1   type standard table of  t_Final_out.
    ALV Report Internal tables    *
    DATA : t_fieldcatalog TYPE slis_t_fieldcat_alv,
           s_fieldcatalog TYPE slis_fieldcat_alv,
           t_basic_fieldcatalog TYPE slis_t_fieldcat_alv,
           s_basic_fieldcatalog TYPE slis_fieldcat_alv,
           t_sort  TYPE slis_t_sortinfo_alv,
           v_repid TYPE sy-repid.
    *ALV Header declarations
    Data: t_header type slis_t_listheader,
          i_header_str type slis_listheader,
          i_line_event_str TYPE slis_alv_event,
          i_events TYPE slis_t_event,
          wa_layout  type slis_layout_alv.
    Data : grid1 type ref to cl_gui_alv_grid,
           g_custom_container1 type ref to cl_gui_custom_container,
           grid2 type ref to cl_gui_alv_grid,
           g_custom_container2 type ref to cl_gui_custom_container,
           i_FCAT TYPE  LVC_T_FCAT,
           i_FCAT_str type lvc_s_fcat,
    Structure  for layout
          i_layout_s   TYPE  lvc_s_layo,
           gt_final1 type table of  t_Final_out.
    DATA: CCCONTAINER1 TYPE SCRFNAME VALUE 'CCCONTAINER1',
          CCCONTAINER2 TYPE SCRFNAME VALUE 'CCCONTAINER2',
          G_PARENT_TOP TYPE REF TO CL_GUI_CONTAINER ,
          G_SPLITTER   TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
          G_DYNDOC_ID  TYPE REF TO CL_DD_DOCUMENT,
          G_PARENT_GRID TYPE REF TO CL_GUI_CONTAINER.
                          Global Variables                              *
    Data :cnt(4) type n value '0',
          g_plant type CKMLMV003-WERKS ,
          g_QuanTStr type CKMLMV003-MGTYP ,
          g_PurchOrg type CKMLMV001-EKORG_ND,
          flag type n value '0',
          g_cnt6 type n value '0',
          g_cnt7 type n value '0',
          g_cnt8 type n value '0',
          g_cnt9 type n value '0',
          g_cnt10 type n value '0',
          g_cnt11 type n value '0',
          g_cnt12 type n value '0',
          g_cnt13 type n value '0'.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-006 for field s_matnr.
    Select-Options : S_MATNR for CKMLMV003-MATNR .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-007 for field S_WERKS.
    SELECT-OPTIONS:S_WERKS for CKMLMV003-WERKS Default '2003'.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-008 for field S_GJAHR.
    SELECT-OPTIONS:S_GJAHR for CKMLMv003-GJAHR default Sy-DATUM(4) .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) TEXT-009 for field S_PERIO.
    SELECT-OPTIONS:S_PERIO for CKMLMV003-PERIO .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(25) TEXT-010 for field P_MGTYP.
    Parameters : P_MGTYP type CKMLMV003-MGTYP .
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN END OF BLOCK b1 .
    At Selection-Screen on s_matnr .
      Perform Validate_MatNumber.
    At Selection-Screen on s_werks .
      Perform Validate_CostingPlant.
    At Selection-Screen on s_GJAHR .
      Perform Validate_FiscalYear.
    At Selection-Screen on s_PERIO .
      Perform Validate_Period.
    At Selection-Screen on p_MGTYP .
      Perform Validate_QuantityStrType.
    *&      Form  Validate_MatNumber
          text
    Form Validate_MatNumber.
      DATA l_MATNR TYPE CKMLMV003-MATNR.
      IF NOT S_MATNR[] IS INITIAL .
        CLEAR L_MATNR.
        SELECT  single MATNR FROM CKMLMV003
          INTO l_MATNR
          WHERE MATNR = s_MATNR-LOW or MATNR = s_MATNR-HIGH.
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Material Number'(001).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_MatNumber
    *&      Form  Validate_CostingPlant
          text
    Form Validate_CostingPlant.
      DATA l_werks TYPE CKMLMV003-WERKS.
      IF NOT S_WERKS[] IS INITIAL .
        CLEAR L_WERKS.
        SELECT single  WERKS FROM T001W
          INTO l_WERKS
          WHERE WERKS =  s_WERKS-low or  WERKS =  s_WERKS-high.
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Costing Plant'(002).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_CostingPlant
    *&      Form  Validate_FiscalYear
          text
    Form Validate_FiscalYear.
      DATA l_GJAHR TYPE CKMLMV003-GJAHR.
      IF NOT S_GJAHR-low IS INITIAL or S_GJAHR-high IS INITIAL.
        CLEAR L_GJAHR.
       SELECT SINGLE GJAHR FROM CKMLMV003
         INTO l_GJAHR
         WHERE GJAHR LE sy-DATUM(4) .
       IF NOT S_GJAHR-low LE sy-DATUM(4) or S_GJAHR-high LE sy-DATUM(4).
         MESSAGE e999 WITH
                 'Enter a Valid Fiscal year'(003).
       ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_FiscalYear
    *&      Form  Validate_Period
          text
    Form Validate_Period.
      DATA l_PERIO TYPE CKMLMV003-PERIO.
      IF NOT S_PERIO[] IS INITIAL .
        CLEAR L_PERIO.
        SELECT single PERIO FROM CKMLMV003
          INTO l_PERIO
          WHERE PERIO GE 1 and PERIO LE 12 .
       ENDSELECT.
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Period'(004).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_Period
    *&      Form  Validate_QuantityStrType
          text
    Form Validate_QuantityStrType.
      DATA l_MGTYP TYPE CKMLMV003-MGTYP.
      IF NOT p_MGTYP IS INITIAL.
        CLEAR L_MGTYP.
        SELECT SINGLE MGTYP FROM CKMLMV003
          INTO l_MGTYP
          WHERE MGTYP = p_MGTYP .
        IF sy-subrc NE 0.
          MESSAGE e999 WITH
                  'Enter a Valid Quantity Structure Type'(005).
        ENDIF.
      ENDIF.
    ENDFORM.                    "Validate_QuantityStrType
    INITIALIZATION of Fields
    Class LCL_EVENT_HANDLER DEFINITION.
      Public section.
        Methods:
        TOP_OF_PAGE for Event TOP_OF_PAGE OF CL_GUI_ALV_GRID
                                IMPORTING E_DYNDOC_ID.
    ENDCLASS.                    "LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    METHOD TOP_OF_PAGE.
    Top-of-page event <br />
    PERFORM EVENT_TOP_OF_PAGE USING G_DYNDOC_ID.
    ENDMETHOD.                            "top_of_page
    ENDCLASS.       "LCL_EVENT_HANDLER IMPLEMENTATION
    Data : G_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
    Initialization.
      v_repid = sy-repid.
    Start-of-Selection.
      Perform get_CKMLMV003.
      Perform get_CKMLMV001.
      Perform Get_Finaldata.
    Perform Layout_FieldCatalog.
      call screen '101'.
    Perform  ALVGrid_Final_Display.
    *&      Form  Layout_FieldCatalog
          text
    Form Layout_FieldCatalog.
      s_fieldcatalog-col_pos = 1.
      s_fieldcatalog-fieldname = 'MATNR'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-024.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 2.
      s_fieldcatalog-fieldname = 'GJAHR'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-012.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 3.
      s_fieldcatalog-fieldname = 'PERIO'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-013.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 4.
      s_fieldcatalog-fieldname = 'WERKS'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-025.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 5.
      s_fieldcatalog-fieldname = 'LIFNR_ND1'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-014.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 6.
      s_fieldcatalog-fieldname = 'MISCH_VERH1'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-015.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 7.
      s_fieldcatalog-fieldname = 'LIFNR_ND2'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-016.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 8.
      s_fieldcatalog-fieldname = 'MISCH_VERH2'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-017.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 9.
      s_fieldcatalog-fieldname = 'LIFNR_ND3'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-018.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 10.
      s_fieldcatalog-fieldname = 'MISCH_VERH3'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-019.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 11.
      s_fieldcatalog-fieldname = 'LIFNR_ND4'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-020.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 12.
      s_fieldcatalog-fieldname = 'MISCH_VERH4'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-021.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 13.
      s_fieldcatalog-fieldname = 'LIFNR_ND5'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-022.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      s_fieldcatalog-col_pos = 14.
      s_fieldcatalog-fieldname = 'MISCH_VERH5'.
      s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
      s_fieldcatalog-seltext_l = Text-023.
      append s_fieldcatalog to t_fieldcatalog.
      clear s_fieldcatalog.
      if g_cnt6 <> '0'.
        s_fieldcatalog-col_pos = 14.
        s_fieldcatalog-fieldname = 'LIFNR_ND6'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 15.
        s_fieldcatalog-fieldname = 'MISCH_VERH6'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt7 <> '0'.
        s_fieldcatalog-col_pos = 16.
        s_fieldcatalog-fieldname = 'LIFNR_ND7'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 17.
        s_fieldcatalog-fieldname = 'MISCH_VERH7'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt8 <> '0'.
        s_fieldcatalog-col_pos = 18.
        s_fieldcatalog-fieldname = 'LIFNR_ND8'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 19.
        s_fieldcatalog-fieldname = 'MISCH_VERH8'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt9 <> '0'.
        s_fieldcatalog-col_pos = 20.
        s_fieldcatalog-fieldname = 'LIFNR_ND9'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 21.
        s_fieldcatalog-fieldname = 'MISCH_VERH9'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt10 <> '0'.
        s_fieldcatalog-col_pos = 22.
        s_fieldcatalog-fieldname = 'LIFNR_ND10'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 23.
        s_fieldcatalog-fieldname = 'MISCH_VERH10'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt11 <> '0'.
        s_fieldcatalog-col_pos = 24.
        s_fieldcatalog-fieldname = 'LIFNR_ND11'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 25.
        s_fieldcatalog-fieldname = 'MISCH_VERH11'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt12 <> '0'.
        s_fieldcatalog-col_pos = 26.
        s_fieldcatalog-fieldname = 'LIFNR_ND12'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 27.
        s_fieldcatalog-fieldname = 'MISCH_VERH12'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
      if g_cnt13 <> '0'.
        s_fieldcatalog-col_pos = 29.
        s_fieldcatalog-fieldname = 'LIFNR_ND13'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-022.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
        s_fieldcatalog-col_pos = 30.
        s_fieldcatalog-fieldname = 'MISCH_VERH13'.
        s_fieldcatalog-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        s_fieldcatalog-seltext_l = Text-023.
        append s_fieldcatalog to t_fieldcatalog.
        clear s_fieldcatalog.
      ENDIF.
    ENDFORM.                    "Layout_FieldCatalog
    *&      Form  get_CKMLMV003
          text
    Form get_CKMLMV003.
      Select WERKS
             MATNR
             MISCH_VERH
             KALNR_BAL
             GJAHR
             PERIO
             MGTYP
             from CKMLMV003
             into table i_CKMLMV003_out
             Where ( MATNR in s_MATNR and
                     WERKS in s_WERKS and
                     GJAHR in s_GJAHR and
                     PERIO in s_PERIO and
                     MGTYP = p_MGTYP ).
      Sort i_CKMLMV003_out by MATNR  KALNR_BAL.
    ENDFORM.                    "get_CKMLMV003
    *&      Form  get_CKMLMV001
          text
    Form get_CKMLMV001.
      If Not i_CKMLMV003_out is Initial.
        Select MATNR
               KALNR
               LIFNR_ND
               EKORG_ND
               from CKMLMV001
               into Table i_CKMLMV001_out
               for all entries in i_CKMLMV003_out
               Where ( KALNR = i_CKMLMV003_out-KALNR_BAL
                      and WERKS = i_CKMLMV003_out-WERKS
                      and MATNR = i_CKMLMV003_out-MATNR ).
        sort i_CKMLMV001_out by MATNR  KALNR.
      ENDIF.
    ENDFORM.                    "get_CKMLMV001
    *&      Form  Get_Finaldata
          text
    Form Get_Finaldata.
      Loop at  i_CKMLMV001_out into i_CKMLMV001_str.
        Loop at  i_CKMLMV003_out into i_CKMLMV003_str.
          If ( i_CKMLMV001_str-KALNR = i_CKMLMV003_str-KALNR_BAL  and i_CKMLMV003_str-MATNR = i_CKMLMV001_str-MATNR  ) .
            If ( flag = 0 ).
              g_plant = i_CKMLMV003_str-WERKS.
              g_PurchOrg = i_CKMLMV001_str-EKORG_ND.
              g_quantstr = i_CKMLMV003_str-MGTYP.
              flag = 1.
            ENDIF.
            Move i_CKMLMV003_str-MATNR  to  i_Final_str-MATNR.
            Move i_CKMLMV003_str-WERKS  to  i_Final_str-WERKS.
            Move i_CKMLMV003_str-GJAHR  to  i_Final_str-GJAHR.
            Move i_CKMLMV003_str-PERIO  to  i_Final_str-PERIO.
            Move i_CKMLMV003_str-MISCH_VERH  to  i_Final_str-MISCH_VERH1.
            Move i_CKMLMV001_str-LIFNR_ND  to  i_Final_str-LIFNR_ND1.
           Move-Corresponding i_CKMLMV003_str to i_CKMLMV003_temp.
            Append i_Final_str to i_Final_out.
            Clear : i_CKMLMV003_str   .
          ENDIF.
        ENDLOOP.
        Clear : i_CKMLMV001_str ,  i_Final_str , i_CKMLMV003_temp.
      ENDLOOP.
      Sort i_Final_out by WERKS MATNR GJAHR  PERIO .
      Loop at i_Final_out into i_Final_str.
        if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO and i_Final_str-WERKS = i_Final_str1-WERKS.
          cnt = cnt + 1.
          Case cnt.
            When 2.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH2.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND2.
            When 3.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH3.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND3.
            When 4.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH4.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND4.
            When 5.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH5.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND5.
            When 6.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH6.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND6.
              g_cnt6 = 1.
            When 7.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH7.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND7.
              g_cnt7 = 1.
            When 8.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH8.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND8.
              g_cnt8 = 1.
            When 9.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH9.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND9.
              g_cnt9 = 1.
            When 10.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH10.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND10.
              g_cnt10 = 1.
            When 11.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH11.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND11.
              g_cnt11 = 1.
            When 12.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH12.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND12.
              g_cnt12 = 1.
            When 13.
              Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH13.
              Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND13.
              g_cnt13 = 1.
          ENDCASE.
        ELSE.
          if cnt GE 1 .
            append i_Final_str1 to i_Final_out1.
            Clear : i_Final_str1.
          ENDIF.
          Move-Corresponding i_Final_str to i_Final_str1.
          cnt = 0.
          cnt = cnt + 1.
        ENDIF.
        Clear :  i_Final_str.
      Endloop.
      append i_Final_str1 to i_Final_out1.
       if i_Final_str-MATNR = i_Final_str1-MATNR and i_Final_str-GJAHR = i_Final_str1-GJAHR and i_Final_str-PERIO = i_Final_str1-PERIO .
         cnt = cnt + 1.
         Case cnt.
           When 2.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH2.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND2.
           When 3.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH3.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND3.
           When 4.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH4.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND4.
           When 5.
             Move i_Final_str-MISCH_VERH1  to  i_Final_str1-MISCH_VERH5.
             Move i_Final_str-LIFNR_ND1  to  i_Final_str1-LIFNR_ND5.
         ENDCASE.
    **Move-Corresponding i_Final_str to i_Final_str1.
       ELSE.
         if cnt GE 1 .
           append i_Final_str1 to i_Final_out1.
           Clear : i_Final_str1.
         ENDIF.
         Move-Corresponding i_Final_str to i_Final_str1.
         cnt = 0.
         cnt = cnt + 1.
       ENDIF.
       Clear :  i_Final_str.
    Endloop.
    append i_Final_str1 to i_Final_out1.
    ENDFORM.                    "Get_Finaldata
    *&      Form  top_of_page
          text
    Form top_of_page.
      clear t_header.
      refresh t_header.
      i_header_str-typ = 'H'.
      I_header_Str-info = Text-035.
      append I_header_str to t_header.
      clear I_header_str.
    Date
      I_header_str-typ = 'S'.
      I_header_str-key = Text-036.
      CONCATENATE sy-datum+6(2) '.'
      sy-datum+4(2) '.'
      sy-datum(4) INTO I_header_str-info. "todays date
      append I_header_str to t_header.
      clear: I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Quantity Structure Type :'.
      I_header_Str-info = g_QuantStr.
      append I_header_str to t_header.
      clear I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Purchase Org :'.
      I_header_Str-info = g_PurchOrg.
      append I_header_str to t_header.
      clear I_header_str.
      i_header_str-typ = 'S'.
      I_header_Str-Key = 'Plant :'.
      I_header_Str-info = g_Plant.
      append I_header_str to t_header.
      clear I_header_str.
      CLEAR i_line_event_str.
      i_line_event_str-name = 'TOP_OF_PAGE'.
      APPEND i_line_event_str TO i_events.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    i_logo = 'Z_LOGO'.
    ENDFORM.                    "top_of_page
    *&      ALVGrid_Final_Display
    Form ALVGrid_Final_Display.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = v_repid
           i_DEFAULt              = c_valx
          i_callback_top_of_page = 'TOP_OF_PAGE'
           i_Save                 = c_valx
          it_fieldcat            = t_fieldcatalog
           it_sort                = t_sort
          it_events              = I_events
        TABLES
          t_outtab               = i_final_out1.
    ENDFORM.                    "ALVGrid_Final_Display
    *&      Form  ALVGRID_OO_Display
          text
    Form ALVGRID_OO_Display.
      i_FCAT_str-col_pos = 1.
      i_FCAT_str-fieldname = 'MATNR'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
    i_fcat_str-seltext = 'MATERIAL'.
      i_fcat_str-scrtext_m = Text-024.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 2.
      i_FCAT_str-fieldname = 'GJAHR'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-012.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 3.
      i_FCAT_str-fieldname = 'PERIO'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-013.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 4.
      i_FCAT_str-fieldname = 'WERKS'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-025.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 5.
      i_FCAT_str-fieldname = 'LIFNR_ND1'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_fcat_str-scrtext_m = Text-014.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 6.
      i_FCAT_str-fieldname = 'MISCH_VERH1'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-015.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 7.
      i_FCAT_str-fieldname = 'LIFNR_ND2'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-016.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 8.
      i_FCAT_str-fieldname = 'MISCH_VERH2'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-017.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 9.
      i_FCAT_str-fieldname = 'LIFNR_ND3'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-018.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 10.
      i_FCAT_str-fieldname = 'MISCH_VERH3'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-019.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 11.
      i_FCAT_str-fieldname = 'LIFNR_ND4'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-020.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 12.
      i_FCAT_str-fieldname = 'MISCH_VERH4'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-021.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 13.
      i_FCAT_str-fieldname = 'LIFNR_ND5'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-022.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
      i_FCAT_str-col_pos = 14.
      i_FCAT_str-fieldname = 'MISCH_VERH5'.
      i_FCAT_str-tabname = 'I_FINAL_OUT1'.
      i_FCAT_str-scrtext_m = Text-023.
      append i_FCAT_str to i_FCAT.
      clear i_FCAT_str.
       if g_cnt6 <> '0'.
        i_FCAT_str-col_pos = 15.
        i_FCAT_str-fieldname = 'LIFNR_ND6'.
        i_FCAT_str-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        i_FCAT_str-scrtext_m = Text-022.
        append i_FCAT_str to i_FCAT.
        clear i_FCAT_str.
        i_FCAT_str-col_pos = 16.
        i_FCAT_str-fieldname = 'MISCH_VERH6'.
        i_FCAT_str-tabname = 'I_FINAL_OUT1'.
       s_fieldcatalog-NO_OUT = 'X'.
        i_FCAT_str-scrtext_m = Text-023.
        append i_FCAT_str to i_FCAT.
        clear i_FCAT_str.
      ENDIF.
    *if  not grid1 is Initial.
    If sy-SUBRC = 0.
      Call Method grid1->set_table_for_first_display
        CHANGING
          it_outtab                     = i_final_out1[]
          it_fieldcatalog               = I_FCAT
        EXCEPTIONS
          Invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          Others                        = 4.
      If sy-subrc <> 0.
      ENDIF.
    CALL METHOD G_DYNDOC_ID->INITIALIZE_DOCUMENT
        EXPORTING
        BACKGROUND_COLOR = CL_DD_AREA=>COL_TEXTAREA.
    Processing events <br />
      CALL METHOD GRID1->LIST_PROCESSING_EVENTS
        EXPORTING
        I_EVENT_NAME = 'TOP_OF_PAGE'
        I_DYNDOC_ID = G_DYNDOC_ID.
    Call Method grid2->set_table_for_first_display
       CHANGING
         it_outtab                     = i_final_out1[]
         it_fieldcatalog               = I_FCAT
       EXCEPTIONS
         Invalid_parameter_combination = 1
         program_error                 = 2
         too_many_lines                = 3
         Others                        = 4.
    If sy-subrc <> 0.
    ENDIF.
       ENDIF.
      ENDIF.
    Endform.                    "ALVGRID_OO_Display
    Form EVENT_TOP_OF_PAGE using  DG_DYNDOC_ID
                          TYPE REF TO CL_DD_DOCUMENT.
    DATA : DL_TEXT(255) TYPE C.
      CALL METHOD DG_DYNDOC_ID->ADD_TEXT
        EXPORTING
        TEXT = 'Flight Details'
        SAP_STYLE = CL_DD_AREA=>HEADING
        SAP_FONTSIZE = CL_DD_AREA=>LARGE
        SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
    Endform.
    *&      Module  STATUS_0101  OUTPUT
          text
    MODULE STATUS_0101 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'TITLE'.
      Create Object G_DYNDOC_ID
            EXPORTING STYLE = 'ALV_GRID'.
      if g_custom_container1 is initial .
        create object g_custom_container1
            Exporting
                Container_name = CCCONTAINER1
            Exceptions
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                Others = 5.
       Create Object G_SPLITTER
              Exporting PARENT = g_custom_container1.
      CALL METHOD G_SPLITTER->GET_CONTAINER
        EXPORTING
        ROW = 1
        COLUMN = 1
        RECEIVING
        CONTAINER = G_PARENT_TOP.
    *Assigning the Part 2 to GRID
      CALL METHOD G_SPLITTER->GET_CONTAINER
        EXPORTING
        ROW = 2
        COLUMN = 1
        RECEIVING
        CONTAINER = g_parent_grid.

    Hi,
    Check if any event is triggered from the event handler class, upon selection.
    Usually, the events are handled on double click or on hotspot etc.
    Regards,
    Satish Kanteti

  • Error while adding a record

    I am getting the following error while adding record into the table CM_RECIPE_ITEM :
    <h4> Error </h4>
    ORA-20505: Error in DML: p_rowid=626, p_alt_rowid=CRI_ID, p_rowid2=, p_alt_rowid2=. ORA-01410: invalid ROWID ORA-06512: at "COSTMAN.CM_RECIPE_ITEM_T3_AFTER", line 11 ORA-04088: error during execution of trigger 'COSTMAN.CM_RECIPE_ITEM_T3_AFTER'
         Error      Unable to process row of table CM_RECIPE_ITEM.
    Kindly suggest if the problem is because of the Global temporary table or the triggers given below. Also suggest the solution.
    Thanking You,
    Yogesh
    <h4> CM_RECIPE_ITEM Table </h4>
    CRI_ID------CRI_CR_ID--------CRI_BOM_CODE--------CRI_CIFG_CODE---------CRI_CIRM_CODE--------CRI_SEQ--------CRI_QTY--------CRI_RM_COST
    625----------464-----------------PRODUCT3001----------FG003----------------------10---------------------------1-------------------60-----------------10
    626----------464-----------------PRODUCT3001----------FG003----------------------12---------------------------2-------------------40------------------10
    <h4>Global temporary table</h4>
    DROP TABLE COSTMAN.INTERIM CASCADE CONSTRAINTS;
    CREATE GLOBAL TEMPORARY TABLE COSTMAN.INTERIM
    ROW_ID ROWID
    ON COMMIT PRESERVE ROWS
    NOCACHE;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3"
    BEFORE INSERT OR UPDATE ON "CM_RECIPE_ITEM" FOR EACH ROW
    BEGIN
    INSERT INTO interim VALUES (:new.rowid);
    END;
    <h4>Trigger to update data on CM_RECIPE table </h4>
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3_AFTER"
    AFTER INSERT OR UPDATE ON "CM_RECIPE_ITEM"
    BEGIN
    FOR ds IN (SELECT row_id FROM interim) LOOP
    UPDATE CM_RECIPE
    SET CR_RMC = (
    SELECT SUM(CRI_QTY * CRI_RM_COST)/SUM(CR_QUANTITY)
    FROM CM_RECIPE_ITEM
    WHERE CRI_BOM_CODE = CR_BOM_CODE
    AND rowid = ds.row_id
    UPDATE CM_RECIPE
    SET CR_TOTAL_COST = (
    SELECT CIFG_PACKING + CIFG_OVERHEAD +CIFG_OTHERS
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id
    ) + CR_RMC;
    UPDATE CM_RECIPE
    SET CR_GROSS_MARGIN =
    (SELECT CIFG_DP_RATE
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id) - CR_TOTAL_COST) / CR_TOTAL_COST;
    END LOOP;
    END;
    /

    The scripts of the tables CM_ITEM_FG, CM_RECIPE, CM_RECIPE_ITEM are as follows :
    <h4>CM_ITEM_FG</h4>
    ALTER TABLE COSTMAN.CM_ITEM_FG
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_ITEM_FG CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_ITEM_FG
    CIFG_CODE VARCHAR2(13 BYTE) NOT NULL,
    CIFG_CCG_ID NUMBER NOT NULL,
    CIFG_NAME VARCHAR2(50 BYTE) NOT NULL,
    CIFG_PACKING NUMBER NOT NULL,
    CIFG_OVERHEAD NUMBER NOT NULL,
    CIFG_OTHERS NUMBER NOT NULL,
    CIFG_DP_RATE NUMBER NOT NULL,
    CIFG_CR_BY VARCHAR2(32 BYTE),
    CIFG_CR_ON DATE,
    CIFG_UPD_BY VARCHAR2(32 BYTE),
    CIFG_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_ITEM_FG_PK_001 ON COSTMAN.CM_ITEM_FG
    (CIFG_CODE, CIFG_CCG_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_ITEM_FG_UK_001 ON COSTMAN.CM_ITEM_FG
    (CIFG_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_ITEM_FG_T1"
    BEFORE UPDATE ON "CM_ITEM_FG"
    FOR EACH ROW
    BEGIN
    BEGIN
    UPDATE CM_RECIPE
    SET CR_TOTAL_COST = (CR_RMC + :NEW.CIFG_PACKING + :NEW.CIFG_OVERHEAD + :NEW.CIFG_OTHERS);
    END;
    BEGIN
    UPDATE CM_RECIPE
    SET CR_GROSS_MARGIN = (:NEW.CIFG_DP_RATE - CR_TOTAL_COST) / CR_TOTAL_COST;
    END;
    END;
    ALTER TABLE COSTMAN.CM_ITEM_FG ADD (
    CONSTRAINT CM_ITEM_FG_PK_001
    PRIMARY KEY
    (CIFG_CODE, CIFG_CCG_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    CONSTRAINT CM_ITEM_FG_UK_001
    UNIQUE (CIFG_CODE)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    ALTER TABLE COSTMAN.CM_ITEM_FG ADD (
    CONSTRAINT CM_ITEM_FG_FK_001
    FOREIGN KEY (CIFG_CCG_ID)
    REFERENCES COSTMAN.CM_COST_GROUP (CCG_ID));
    <h4>CM_RECIPE</H4>
    ALTER TABLE COSTMAN.CM_RECIPE
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_RECIPE CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_RECIPE
    CR_ID NUMBER NOT NULL,
    CR_CCG_ID NUMBER,
    CR_EFF_FROM DATE,
    CR_CIFG_CODE VARCHAR2(10 BYTE) NOT NULL,
    CR_BOM_CODE VARCHAR2(50 BYTE),
    CR_QUANTITY NUMBER,
    CR_RMC NUMBER,
    CR_TOTAL_COST NUMBER,
    CR_GROSS_MARGIN NUMBER,
    CR_CR_BY VARCHAR2(32 BYTE),
    CR_CR_ON DATE,
    CR_UPD_BY VARCHAR2(32 BYTE),
    CR_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_PK_001 ON COSTMAN.CM_RECIPE
    (CR_CCG_ID, CR_ID, CR_CIFG_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_UK_001 ON COSTMAN.CM_RECIPE
    (CR_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_UK_002 ON COSTMAN.CM_RECIPE
    (CR_BOM_CODE)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_T1"
    BEFORE INSERT ON "CM_RECIPE"
    FOR EACH ROW
    DECLARE
    L_ID NUMBER;
    BEGIN
    IF INSERTING THEN
    IF :NEW.CR_ID IS NULL THEN
    --SELECT CM_RECIPE_SEQ.NEXTVAL INTO L_ID FROM DUAL;
    :NEW.CR_ID := CM_RECIPE_SEQ.NEXTVAL; --L_ID;
    END IF;
    :NEW.CR_CR_ON := SYSDATE;
    :NEW.CR_CR_BY := nvl(v('APP_USER'),USER);
    END IF;
    IF UPDATING THEN
    :NEW.CR_UPD_ON := SYSDATE;
    :NEW.CR_UPD_BY := nvl(v('APP_USER'),USER);
    END IF;
    END;
    ALTER TABLE COSTMAN.CM_RECIPE ADD (
    CHECK ("CR_EFF_FROM" IS NOT NULL) DISABLE,
    CHECK ("CR_CCG_ID" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CHECK ("CR_QUANTITY" IS NOT NULL) DISABLE,
    CONSTRAINT CM_RECIPE_PK_001
    PRIMARY KEY
    (CR_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    CONSTRAINT CM_RECIPE_UK_002
    UNIQUE (CR_BOM_CODE)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    <h4>CM_RECIPE_ITEM</H4>
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM
    DROP PRIMARY KEY CASCADE;
    DROP TABLE COSTMAN.CM_RECIPE_ITEM CASCADE CONSTRAINTS;
    CREATE TABLE COSTMAN.CM_RECIPE_ITEM
    CRI_ID NUMBER NOT NULL,
    CRI_CR_ID NUMBER NOT NULL,
    CRI_BOM_CODE VARCHAR2(50 BYTE) NOT NULL,
    CRI_CIFG_CODE VARCHAR2(10 BYTE) NOT NULL,
    CRI_CIRM_CODE VARCHAR2(10 BYTE) NOT NULL,
    CRI_SEQ NUMBER,
    CRI_QTY NUMBER,
    CRI_RM_COST NUMBER,
    CRI_CR_BY VARCHAR2(32 BYTE),
    CRI_CR_ON DATE,
    CRI_UPD_BY VARCHAR2(32 BYTE),
    CRI_UPD_ON DATE
    TABLESPACE COST_MANAGER
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE UNIQUE INDEX COSTMAN.CM_RECIPE_ITEM_PK_001 ON COSTMAN.CM_RECIPE_ITEM
    (CRI_ID)
    LOGGING
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOPARALLEL;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T2"
    BEFORE INSERT OR UPDATE ON "CM_RECIPE_ITEM"
    FOR EACH ROW
    BEGIN
    IF :NEW.CRI_CR_ID IS NULL THEN
    SELECT CR_ID INTO :NEW.CRI_CR_ID
    FROM CM_RECIPE
    WHERE CR_BOM_CODE = :NEW.CRI_BOM_CODE;
    END IF;
    END;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T1" BEFORE
    INSERT OR UPDATE ON "CM_RECIPE_ITEM" FOR EACH ROW
    DECLARE
    L_ID NUMBER;
    SEQ NUMBER;
    BEGIN
    IF INSERTING THEN
    IF :NEW.CRI_ID IS NULL THEN
    SELECT CM_RECIPE_ITEM_SEQ.NEXTVAL
    INTO :NEW.CRI_ID
    FROM dual;
    END IF;
    :NEW.CRI_CR_ON := SYSDATE;
    :NEW.CRI_CR_BY := NVL(v('APP_USER'),USER);
    SELECT (NVL(MAX(CRI_SEQ),0)+1)
    INTO SEQ
    FROM CM_RECIPE_ITEM
    WHERE CRI_BOM_CODE = :NEW.CRI_BOM_CODE;
    :NEW.CRI_SEQ := SEQ;
    END IF;
    IF UPDATING THEN
    :NEW.CRI_UPD_ON := SYSDATE;
    :NEW.CRI_UPD_BY := NVL(v('APP_USER'),USER);
    END IF;
    END;
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM ADD (
    CHECK ("CRI_RM_COST" IS NOT NULL) DISABLE,
    CHECK ("CRI_QTY" IS NOT NULL) DISABLE,
    CHECK ("CRI_SEQ" IS NOT NULL) DISABLE,
    CONSTRAINT CM_RECIPE_ITEM_PK_001
    PRIMARY KEY
    (CRI_ID)
    USING INDEX
    TABLESPACE COST_MANAGER
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    ALTER TABLE COSTMAN.CM_RECIPE_ITEM ADD (
    CONSTRAINT CM_RECIPE_FK_002
    FOREIGN KEY (CRI_CIRM_CODE)
    REFERENCES COSTMAN.CM_ITEM_RM (CIRM_CODE),
    CONSTRAINT CM_RECIPE_ITEM_FK_001
    FOREIGN KEY (CRI_CR_ID)
    REFERENCES COSTMAN.CM_RECIPE (CR_ID));
    Yogesh

  • Error while adding record

    I am getting the following error while adding record into the table CM_RECIPE_ITEM :
    Error
    ORA-20505: Error in DML: p_rowid=626, p_alt_rowid=CRI_ID, p_rowid2=, p_alt_rowid2=. ORA-01410: invalid ROWID ORA-06512: at "COSTMAN.CM_RECIPE_ITEM_T3_AFTER", line 11 ORA-04088: error during execution of trigger 'COSTMAN.CM_RECIPE_ITEM_T3_AFTER'
    Error Unable to process row of table CM_RECIPE_ITEM.
    Kindly suggest if the problem is because of the Global temporary table or the triggers given below. Also suggest the solution.
    Thanking You,
    Yogesh
    CM_RECIPE_ITEM Table
    CRI_ID------CRI_CR_ID--------CRI_BOM_CODE--------CRI_CIFG_CODE---------CRI_CIRM_CODE--------CRI_SEQ--------CRI_QTY--------CRI_RM_COST
    625----------464-----------------PRODUCT3001----------FG003----------------------10---------------------------1-------------------60-----------------10
    626----------464-----------------PRODUCT3001----------FG003----------------------12---------------------------2-------------------40------------------10
    Global temporary table
    DROP TABLE COSTMAN.INTERIM CASCADE CONSTRAINTS;
    CREATE GLOBAL TEMPORARY TABLE COSTMAN.INTERIM
    ROW_ID ROWID
    ON COMMIT PRESERVE ROWS
    NOCACHE;
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3"
    BEFORE INSERT OR UPDATE ON "CM_RECIPE_ITEM" FOR EACH ROW
    BEGIN
    INSERT INTO interim VALUES (:new.rowid);
    END;
    Trigger to update data on CM_RECIPE table
    CREATE OR REPLACE TRIGGER COSTMAN."CM_RECIPE_ITEM_T3_AFTER"
    AFTER INSERT OR UPDATE ON "CM_RECIPE_ITEM"
    BEGIN
    FOR ds IN (SELECT row_id FROM interim) LOOP
    UPDATE CM_RECIPE
    SET CR_RMC = (
    SELECT SUM(CRI_QTY * CRI_RM_COST)/SUM(CR_QUANTITY)
    FROM CM_RECIPE_ITEM
    WHERE CRI_BOM_CODE = CR_BOM_CODE
    AND rowid = ds.row_id
    UPDATE CM_RECIPE
    SET CR_TOTAL_COST = (
    SELECT CIFG_PACKING + CIFG_OVERHEAD +CIFG_OTHERS
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id
    ) + CR_RMC;
    UPDATE CM_RECIPE
    SET CR_GROSS_MARGIN =
    (SELECT CIFG_DP_RATE
    FROM CM_ITEM_FG
    WHERE CIFG_CODE = CR_CIFG_CODE
    AND rowid = ds.row_id) - CR_TOTAL_COST) / CR_TOTAL_COST;
    END LOOP;
    END;
    /

    yogeshyl wrote:
    Error
    ORA-20505: Error in DML: p_rowid=626, p_alt_rowid=CRI_ID, p_rowid2=, p_alt_rowid2=. ORA-01410: invalid ROWID ORA-06512: at "COSTMAN.CM_RECIPE_ITEM_T3_AFTER", line 11 ORA-04088: error during execution of trigger 'COSTMAN.CM_RECIPE_ITEM_T3_AFTER'
    Error Unable to process row of table CM_RECIPE_ITEM.
    Kindly suggest if the problem is because of the Global temporary table or the triggers given below. Also suggest the solution.The error message points to the trigger...

  • Upgrade of Integation Services (Windows 2012 R2) on Windows 2008 R2 with Exchange 2013 SP1 DAG fails

    Here is the scenario:
    Legacy Host: Windows 2008 R2
    Guest VM: Windows 2008 R2 with Exchange 2013 SP1 DAG cluster.
    After importing the VM (2008 R2 and Exchange 2013 DAG) into a 2012 R2 host (Cluster).  (copy VM files to new 2012 R2host) Everything works fine.
    Then upgrading "Installation Services" (for Windows 2012 R2 host) on the imported VM runs fine with no errors to the "Restart" prompt. VM than shows: "Configuring Windows updates 32% complete. Do not turn
    of your computer." Hangs there for about 20 minutes until is says "shutting down". Hangs there for 20 minutes until power off. Restart to normal start; "Preparing to configure Windows. Do not turnoff your computer." proceeds slowly
    to "Configuring Windows updates 32% complete. Do not turn of your computer." hangs there again indefinite. Sometime hangs at shutdown cycle and "Configuring Windows updates 32% complete. Do not turn of your computer." indefinitely.
    I moved 20 other machines from a 2008 R2 host to new Windows 2012 R2 hosts all of these machines install the 2012 R2 Integration services just fine on the 2008 R2 VM. Just the 2008 R2 VMs clustered (DAG) and Exchange 2013 SP1 do not take the Integration
    Services upgrade.
    Any advise from Microsoft? I know I could decommission the DAG and Exchange machines and install Integration services on the native box before Exchange and DAG and that would sure work, but I'd rather avoid that amount of work for a simple integration layer
    upgrade.
    Thanks
    Gerhard Waterkamp ACSLA Inc.

    Hi,
    Could you try use the following method to fix this issue first?
    1. Run the System Update Readiness Tool, then check if there is any error in the Checksur.log and checksur.persist.log.
     1. Please run the System Update Readiness Tool on this affected server. Please download this tool from the following Microsoft article:
     Description of the System Update Readiness Tool for Windows Vista, for Windows Server 2008, and for Windows 7
     http://support.microsoft.com/kb/947821/en-us
    2. The System Update Readiness Tool creates the log files that captures any issues that the tool found or fixed. The log files are located at the following location:
    %SYSTEMROOT%\Logs\CBS\
    3. Please paste the checksur.log here for analysis.
    If there is no error found, please try the following step.
    ==================================
    2. Use Fix it tool to reset the Windows Update components.
     1. Open the following link.
     http://support.microsoft.com/kb/971058/en-nz
     2. Select Windows 8.1, Windows 8 and Windows 7 in the product selection box.
     3. Click “Run Now” to reset the Windows Update components.
    Note: We can reset the Windows Updates manually by following the steps in the KB above.
    3. Use the System File Checker tool to repair missing or corrupted system files
     1. Open the command promote with Administrators.
     2. At the command prompt, type the following command, and then press ENTER:
         sfc /scannow
    Any errors are found in the steps above, please let me know.
    Hope this helpful.
    Best Regards,
    Jason Zeng
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • The external credentials in the SSO database are more recent --- Receiving this error while adding entries to SSO database.

    We are getting this error while adding entries to SSO database. Its working in other environments and failing in only environment. Please advice.
    error MSB4018: The "BizTalk.BuildGenerator.Tasks.SSO.PopulateApplicationProperty" task fa
    iled unexpectedly.\r
    : error MSB4018: System.Runtime.InteropServices.COMException (0xC0002A40): The external cre
    dentials in the SSO database are more recent.\r
     error MSB4018: \r
     error MSB4018:    at Microsoft.BizTalk.SSOClient.Interop.ISSOConfigStore.SetConfigInfo(St
    ring applicationName, String identifier, IPropertyBag properties)\r
     error MSB4
    018:    at BizTalk.BuildGenerator.Tasks.SSO.SSOConfiguration.Write(String appNa
    me, String propName, String propValue)\r
     error MSB4018:    at BizTalk.BuildGenerator.Tasks.SSO.PopulateApplicationProperty.Execute
    ()\r
     error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.IT
    askExecutionHost.Execute()\r
     error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExe
    cutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost t
    askHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskRe
    sult)
    Thanks, Pavan MCTS-Microsoft Biztalk Windows Server 2010

    Hi,
    This error generally arises when your system datetime is not in sync with the Domain Controller datetime. Try following steps:
    1. Check if the Windows Time Service is running on your machine or not. Try restarting this service and then restart host instances. Then run your script.
    2. If this does not works, have a look at this
    link
    Hope this will help.
    HTH,
    Sumit
    Sumit Verma - MCTS BizTalk 2006/2010 - Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

  • Getting an error while adding the user in Sharepoint foundation 2010 environment.

    Hi,
    I am having full control access to SharePoint site. Then i tried add user for that site.
    But i am getting following error while adding the user to the site.
    An unexpected error has occurred.
    Troubleshoot issues with microsoft SharePoint Foundation.
    Correlation ID:3035B777-1B7C-4463-B35E-06657B72C2E4
    Can you please help me anyone on this.
    Thanks,
    Ashok

    This could be any one of a number of things.  You need to lookup the Correlation ID in the ULS logs on the SharePoint server.  That should provide the additional information necessary to diagnose and solve the problem.  Here's a blog post
    on how to find the error.
    http://habaneroconsulting.com/Blog/Posts/Get_the_Real_SharePoint_Error_using_the_ULS_Logs.aspx#.UvEuffldWik 
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Error while adding a connector for SSL..help!!!

    i'm getting this error when i added a connector for SSL and restarted tomcat
    my connector tag is
    <Connector keystorePass="kalima" scheme="https" port="8443" sslProtocol="TLS" redirectPort="-1" enableLookups="true" keystoreFile="Mykeystore" protocol="TLS" keystore="C:\Documents and Settings\santhoshyma\Mykeystore" clientauth="false" algorithm="SunX509" keypass="changeit" secure="true" keytype="JKS">
          <Factory className="org.apache.coyote.tomcat5.CoyoteServerSocketFactory" keystorePass="kalima" keystoreFile="C:\SSLTest\Mykeystore"/>
        </Connector>
    LifecycleException:  Protocol handler instantiation failed: java.lang.NullPointe
    rException
            at org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.
    java:1368)
            at org.apache.catalina.core.StandardService.initialize(StandardService.j
    ava:609)
            at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
    a:2384)
            at org.apache.catalina.startup.Catalina.load(Catalina.java:507)
            at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:324)
            at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
            at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)

    The question is answered in CRM 7.0 forum:
    Getting error while adding a custom field (with input help) through AET

  • Error while adding a custom field with Input help via AET

    Hi All,
    I need to add two custom field under Service orders at Item level in component BT140I_SRVP.
    One field is required to have the input search help f4 and autopopulates the second field
    I am able to add one field(not requiring help) successfully through AET .
    I have created one Zsearch_help in se11 and its successfully running  and Autopopulating seocnd field while I am testing it
    While adding second field through AET,I need to enter following details as -
    field label,search relevant ,serach help etc.
    When I type the name of my 'Zsearch_help' against field search help it gives me following error
    'Search help is not compatible'.
    Secondly,not getting getter and setter methods for the attrributes in BTAdminI.
    Last,please tell me if i create zhelp and activate it,would it automatically appear in the list on AETwhile assiging it to input field?
    Please help me out.Kindly be detailed as I am new to SAP CRM.
    Thanks,
    Shivani

    The question is answered in CRM 7.0 forum:
    Getting error while adding a custom field (with input help) through AET

Maybe you are looking for

  • Problem installing firmware update...

    My MacBook Pro no longer boots. Here's what happened... I downloaded and installed the new EFI firmware update. I shut down my MacBook and then held down the power button to begin the update process. Nothing happened. Nothing displayed on the screen.

  • J2EE roles vs Portal roles vs ABAP roles

    (I also posted this on portal implementation, but i hope i receive more reactions here ) Dear all, I have a question about the information on the following link: http://help.sap.com/saphelp_nw2004s/helpdata/en/4c/6c0f40763f1e07e10000000a1550b0/conten

  • How to Lock Memory Card.?

    Hi. I'm using Nokia C2-00. I set Password to Memory Card. But now i have doubt that is der any possible to Lock Memory Card while using in Same device..? (with same Password which i already set)

  • How to upload graphic to SAP througth the program?

    Hi everyone,      Please help me. My point as subject. Because the graphics is different by delivery's batch no.. Whether has any method to be upload graphic to SAP, but does not need to each time used SE78 to upload graphic.      Thanks a lot. My ve

  • How to create multiple channels in DAQmx

    Hello , I created an application based from this example program, MultiFunctionSyncAIAO_DigStart (from VCNet). I added another input and output channels, which later on I plan to add trigger features between the two signals ( could be both inputs, bo