CRITERIA Table in BAPI_ACC_DOCUMENT_POST

Hi gurus,
Can you teach me how to fill up the CRITERIA table in BAPI_ACC_DOCUMENT_POST. I really need your help. Thanks!
Andre

In my testcase I filled this for CO-PA chararcteristic for CO internal order:
ITEMNO_ACC                     0000000002 (depending on which document row in BAPI)
FIELDNAME                      RKAUFNR (CO-PA chrarcteristic)
CHARACTER                      001000007102 (this would be the internal order from AUFK)
If you need to populate more characteristics, this should be possible

Similar Messages

  • Add record through pop to search view criteria table?

    Hi,
    I am trying to add data from pop to search view criteria table but i am strukked at inserting data through popup...
    i got nullpointer exception like this
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    <RowGatherCallback> <processComponent> Illegal child component ("javax.faces.component.html.HtmlOutputText@17cc21b" id="j_id256") detected inside parent component ("panelGridLayout" with clientId="pt1:r1:1:pgc1:pt_pgl3"). The child component must instead be of type "gridRow" instead.
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: java.lang.NullPointerException
    java.lang.NullPointerException
        at oracle.jbo.server.QueryCollection.getRowSetRefs(QueryCollection.java:2675)
        at oracle.jbo.server.ViewObjectImpl.notifyRowUpdated(ViewObjectImpl.java:12174)
        at oracle.jbo.server.ViewObjectImpl.afterRowUpdate(ViewObjectImpl.java:13921)
        at oracle.jbo.server.ViewObjectImpl.sourceChanged(ViewObjectImpl.java:14224)
        at oracle.jbo.server.EntityCache.sendEvent(EntityCache.java:1566)
        at oracle.jbo.server.EntityCache.deliverEntityEvent(EntityCache.java:1582)
        at oracle.jbo.server.EntityCache.notifyColumnAndBlgChange(EntityCache.java:1640)
        at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:7426)
        at oracle.jbo.server.EntityImpl.notifyAttributesChanged(EntityImpl.java:7407)
        at oracle.jbo.server.ViewRowImpl.setAttributeValues(ViewRowImpl.java:1827)
        at oracle.adf.model.binding.DCDataControl.setAttributesInRow(DCDataControl.java:2447)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setAttributeValuesInRow(JUCtrlValueBinding.java:997)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setTargetAttrsFromLovRow(JUCtrlListBinding.java:2813)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.updateTargetFromSelectedValue(JUCtrlListBinding.java:2941)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setAttributeFromValueList(JUCtrlListBinding.java:2886)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setSelectedIndex(JUCtrlListBinding.java:1752)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.setInputValueInRow(JUCtrlListBinding.java:3541)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setInputValue(JUCtrlValueBinding.java:2926)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.setInputValue(JUCtrlValueBinding.java:2889)
        at oracle.adfinternal.view.faces.model.binding.FacesCtrlListBinding.setInputValue(FacesCtrlListBinding.java:458)
        at oracle.jbo.uicli.binding.JUCtrlValueBinding.put(JUCtrlValueBinding.java:2546)
        at oracle.jbo.uicli.binding.JUCtrlListBinding.put(JUCtrlListBinding.java:3437)
        at javax.el.MapELResolver.setValue(MapELResolver.java:229)
        at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
        at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
        at com.sun.el.parser.AstValue.setValue(Unknown Source)
        at com.sun.el.ValueExpressionImpl.setValue(Unknown Source)
        at org.apache.myfaces.trinidad.component.UIXEditableValue.updateModel(UIXEditableValue.java:361)
        at org.apache.myfaces.trinidad.component.UIXEditableValue.processUpdates(UIXEditableValue.java:311)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildrenImpl(UIXComponentBase.java:1269)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildren(UIXComponentBase.java:1259)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.processUpdates(UIXComponentBase.java:1012)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildrenImpl(UIXComponentBase.java:1269)
        at oracle.adf.view.rich.component.fragment.UIXRegion.updateChildrenImpl(UIXRegion.java:669)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.updateChildren(UIXComponentBase.java:1259)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.processUpdates(UIXComponentBase.java:1012)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$UpdateModelValuesCallback.invokeContextCallback(LifecycleImpl.java:1561)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:1670)
        at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:625)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnNamingContainerComponent(UIXComponentBase.java:1693)
        at oracle.adf.view.rich.component.fragment.UIXRegion.invokeOnComponent(UIXRegion.java:625)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.invokeOnComponent(ContextSwitchingComponent.java:222)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at oracle.adf.view.rich.component.fragment.UIXInclude.invokeOnComponent(UIXInclude.java:161)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnChildrenComponents(UIXComponentBase.java:1627)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.invokeOnComponent(UIXComponentBase.java:1750)
        at org.apache.myfaces.trinidad.component.UIXDocument.invokeOnComponent(UIXDocument.java:106)
        at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1321)
        at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:678)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:382)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:180)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    can any body help me out this?..
    ThankYou

    HI,
    I think you have created form using two view objects ...recheck one of the value is null before commit ..
    Thanks
    Nitesh

  • Problem in Coding Block during the Acc Doc posting BAPI_ACC_DOCUMENT_POST

    Hi,
    I have a problem in the Coding Block of a FI invoice Document posting. In our project, we have implemented substitutions to derive SBL;SEGMENT field in the line item of a GL Account.
    I have created a program and in that i'm using BAPI_ACC_DOCUMENT_POST for posting the Accounting Document. During this BAPI call, it is not deriving the values of SBL and SEGMENT.
    But, when i'm posting through transaction FB01; the substitutions are getting triggered and finally values are being derived.
    Can anyone help on this as to why these values were not derived when it is being called through BAPI_ACC_DOCUMENT_POST. For COBL; is it really possible to post through this BAPI or something more has to be done.
    Very urjunt !!! Please
    Awaiting your valuable answers.
    Thanks
    Rohith

    Hi Rohith,
    to populate correctly the profit. Segment you should fill in the information used in derivation inside the BAPI CRITERIA table structure.
    In the below example the profit. Segment is derived from Sales Org. (VKORG) and Distribution Channel (VTWEG).
      Fill CRITERIA for CO-PA (Profitability Segment)
        REFRESH lt_criteria.
        wa_criteria-itemno_acc = lv_itemno_acc.
        wa_criteria-fieldname  = 'VKORG'.
        wa_criteria-character  = '1080'.
        APPEND wa_criteria TO lt_criteria.
        wa_criteria-itemno_acc = lv_itemno_acc.
        wa_criteria-fieldname  = 'VTWEG'.
        wa_criteria-character  = '01'.
        APPEND wa_criteria TO lt_criteria.
    If you need further information, please post your doubts here.
    Regards,
    Antonio
    Edited by: indetony on Sep 9, 2011 12:46 AM

  • BPL - Define Selection Criteria (Selection Exit)

    We are using TDMS 3.0 with following patch level:
    DMIS             2006_1_700     0010
    DMIS_CNT     2006_1_700     0010
    DMIS_EXT     2007_1_700     0000
    We have a scenario where we want to transfer all sales transactions of particular plant in target system. We have selected package BPL scenario in TDMS with business context sales document.
    Under 'Define selection criteria' activity, we are getting only sales Document number as a filter criteria. We can extend the filter criteria to any column of table VBAK, but not any of the dependent tables (Like VBAP - containing plant)
    The operation guide shows an example of selection criteria for materials, filtering by the start table (MARA-MATNR) and at the same time by a dependent table (MARC-WERKS).  I want to apply the same logic to tables VBAK & VBAP. There are two problems in my way:
    1. As per operation guide, when you execute 'Define Selection Criteria', we should see three tab pages. 'Selections', 'Selection criteria' & 'Tables'. But I can see only two in my system i.e 'Selection criteria' & 'Tables'. There is no 'Selection' tab page in my system.
    2. Referring to forum Re: BPL: Filtering depending tables , we can use 'Selection Exit'. But can anybody guide me how that can be implemented and attached to the filter / process?
    Thanks & Regards,
    Audy.

    Hi again.
    Forum rules do not allow more than one question in the same thread, but anyway...
    TDMS BPL works by direct inserts in the database, so functional dependencies are not checked. This means that in VA01 you cannot create a sales order for a customer that does not exist but with BPL you can, though later of course you'll have problems when checking the sales order in VA03 (this is just an example: in practice the sales order context by default also includes the relevant customers). Unlike archiving, where you cannot delete a customer if sales orders for that customer still exist, in TDMS there are no such checks. This means there is really no sequence: in the end everything will be there.
    The direct inserts also mean that document numbers are kept the same, so existing objects with the same number are overwritten; check if that is a problem for you.
    About the last part of your question: first, don't forget that BPL does not include customizing, so make sure it is already there; second, BPL contexts are designed to include most tables related to a business process, but as you know R/3's data model is quite complex. After the copy you might realize that for your specific process maybe some tables were not considered. In that case I suggest you complain via OSS so that the context can be improved and we all profit.. ;). You must also be careful if you have Z tables that must be added to the context.
    Regards,
    Rui Dantas

  • How to change VO's dynamically for a item for each row in advanced table?

    Hi All,
    We had a requirement to filter the employees based on the search criteria table. I am using advanced table for developing search criteria.
    In that table I am having three columns. Operator (messagechoice), Criteria Type (messagechoice), and Criteria value (messageLovInput). Also 'Add Another Row' functionality is available.
    My requirement is:
    First Row:(Initial Row)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    Second Row: (when the user selects Add Another Row button)
    When the user selects a value in Criteria Type, only the values that are relevant to that type should be displayed in the Criteria Value.
    The problem I am facing here is, the Criteria Value column is pointing to only one VO at design time. But wee need to change that VO dynamically without disturbing other rows depending on the Criteria Type value.
    Is it possible to do so?
    Note: User can add n number of conditions as he want.
    Can anyone help how to acheive this.
    Regards,
    Sundeep.

    Check Dynamic Poplist section under Standard Web Widgets in Chapter 4 of OA Framework Developers guide.

  • BAPI_ACC_DOCUMENT_POST Max No of Items reached

    Hello,
    I am trying to post G/L accounts using BAPI_ACC_DOCUMENT_POST. There are about 1150 line items.
    I don't think this should be the reason to get error as the G/L account table that BAPI_ACC_DOCUMENT_POST uses allows 10 digits of line number. I am getting the following error:
    <b>Maximum Number if item in FI reached.</b> Error number 727 ID F5
    Please advise if you have seen this before.
    Thanks.
    Pranav

    SAP also provides the use of table TTYPV which can be used to designate standard SAP fields to consolidate account postings to one accounting line item.  Therefore if you choose to consolidate based on BSEG fields (BSEG MATNR, BSEG ZUONR, etc.), it limits the occurrence of surpassing the 950/999 limitation.   It does not eliminate the problem entirely, but in my organization it has enabled us to handle G/L account postings that had over 2,000 line items before this change.
    There are other things to consider when this is done, depending on the level of BSEG detail your business process requires.

  • Oracle Data Compression on SID tables and Dimension Tables

    Hello Community,
    We have had great success with Oracle compression on ODS tables that are no longer loaded.
    We'd now like to move on to other types of BW tables that are very large.
    OSS Note 701235 provides answers to questions concerning the possible use of Oracle compression together with SAP BW.
    But the Note does not give suggestions for (or against) Oracle compression on SID tables or Dimension tables.
    I believe both table types would exhibit the same behaviour : mostly inserts of new SID IDs and new DIM IDs, but few updates to existing SID or Dimension records.  If this is true, then both are good candidates for oracle compression. 
    Do you also agree that this is the typical behaviour for SID tables and dimension tables ?  And that these types of tables are good candidates for Oracle compression in a large BW system ?
    Thanks kindly!
    Keith Helfrich

    Hi all,
    Although this is an old thread I stumbled on during my own investigations I can provide some answers to your questions.
    Table candidates for compression are found by these criteria
           - Table size big enough?
           - Long lifetime of object planned ?
          - No or only rare structural changes for the table   ?
          - u201EUpdateu201C rate low : is your data mostly kind of u201Cread onlyu201D ?
    --               for the wideley used rolling window partition techniques of
                      tables in BW this is not a problem: mostly INSERTu2019s in the
                     current partition not affecting other partitions
    BW tables that can benefit from compression (see SAP notes 105047,701235)
           - PSA tables with data that must be saved for a longer time
           - ODS change log (no Updates of old data, only Inserts of new data)
           - u201Ehistoricalu201C cubes wich get no changes in table structure anymore
    Limitations
             - normal Insert or Update statements are stored ALWAYS in uncompressed
                    format and must be compressed separately ( <= Oracle10g )
             - Slight CPU overhead of compression, butu2026
             --      CPU consumption is more than compensated by doing less I/O as
                   for Bulk loads or parallel processing
             --      SAP BW transformations took a significant amount of CPU for
                       overall load-time into cubes caused by the application server not
                       the database
              - Table must have not more than 255 fields
              - Adding columns with an initial value or dropping columns require
                   uncompression of the complete table (strongest limitation)
    Consider all this above and you can decide that tables that going through UPDATE's are
    not good candidates for compression or tables that can change it's structure (like
    Fact- or DIM tables) .
    Now, my questions to you:
    Wich Oracle version do you use?
    Wich tool do you use for  Oracle compression?
    BRspace (can you give an example ?)
    ALTER ... MOVE COMPRESS
    bye
    yk

  • Need Query - join in same table

    I need query for following criteria,
    Table : test
    No     Order
    1     a
    1     b
    1     c
    2     a
    2     b
    2     d
    3     e
    3     f
    3     g
    3     h
    1     f
    2     f
    Consider the above table,
    1)     I will give input order as a,b: It should return No 1,2
    No     Order
    1     a
    1     b
    1     c
    2     a
    2     b
    2     d
    3     e
    3     f
    3     g
    3     h
    1     f
    2     f
    2)     I will give input order as f,g,h: It should return No 3
    No     Order
    1     a
    1     b
    1     c
    2     a
    2     b
    2     d
    3     e
    3     f
    3     g
    3     h
    1     f
    2     f
    Please give me the query which will give above result.
    Thanks

    I am not sure I understand you, but it may be this
    with test as (
    select 1 N, 'a' Ord from dual union all
    select 1,'b' from dual union all
    select 1,'c' from dual union all
    select 2,'a' from dual union all
    select 2,'b' from dual union all
    select 2,'d' from dual union all
    select 3,'e' from dual union all
    select 3,'f' from dual union all
    select 3,'g' from dual union all
    select 3,'h' from dual union all
    select 1,'f' from dual union all
    select 2,'f' from dual )
    select N from test tp where Ord = 'a'
    intersect
    select N from test tp where Ord = 'b';
    with test as (
    select 1 N, 'a' Ord from dual union all
    select 1,'b' from dual union all
    select 1,'c' from dual union all
    select 2,'a' from dual union all
    select 2,'b' from dual union all
    select 2,'d' from dual union all
    select 3,'e' from dual union all
    select 3,'f' from dual union all
    select 3,'g' from dual union all
    select 3,'h' from dual union all
    select 1,'f' from dual union all
    select 2,'f' from dual )
    select N from test tp where Ord = 'f'
    intersect
    select N from test tp where Ord = 'g'
    intersect
    select N from test tp where Ord = 'h';

  • Possible for POJO to have a set of children with only one table?

    I have a situation that I'd like to model with Hibernate, but I'm not sure how to proceed.
    I've got two objects: Filter and Criterion. Filter has a java.util.Set of Criterion children.
    I currently have a schema with two tables: FILTERS and CRITERIA. The FILTERS table has nothing more than a primary key. CRITERIA has a foreign key relationship with FILTERS. I have a FilterDAO that will query the FILTERS table and bring back a Filter object that will use the one-to-many, parent-child relationship between the two tables to populate the Set.
    A DBA here has pointed out that the FILTERS table is anemic - it has nothing more than a primary key. She suggested that I eliminate it and go directly against the CRITERIA table to populate that Set.
    I'm so used to thinking about these things in terms of primary/foreign key relationships that I'm not seeing how to accomplish this with Hibernate. Is it a mere <set> declaration that populates the child java.util.Set<Criterion>? The WHERE clause would have to include a filter type. Is that where the JOIN has to come? Is the two table schema absolutely necessary, or can I get away without it?
    Hibernate allows the object model to be more fine-grained than the schema. The classic example is a PERSON table that has address information it in. I can model this on the object side using Person and Address classes and ask Hibernate to fetch the Address state as a component. Is this the same situation as my Filter and Criterion?
    Sorry if I sound confused, or if the question rambles. I guess I don't understand Hibernate well, because any time I get off the beaten path I fall into a hole.
    %

    Well, you're more advanced than me with Hibernate. I'd be very surprised if that were true, DrClap. 8)
    I can't even get one-to-many relationships working the
    way I'd like, every time I think I have it right
    (i.e. just the same as the examples) it gives me some
    guff about backreferences not existing.I'm finding Hibernate to be a bit difficult, especially when I don't have control over the schema. Our DBAs don't seem to follow all the "best practices" that Hibernate recommends.
    So my advice might not be the best. But if you don't
    have the Filters table, but you still need to get all
    the Criterions with "filter key" = x, then isn't that
    just a Query? Sure, you get the data back as a List,
    but you can wrap that in a Set pretty easily.I've gone back to the DBA and concluded that we have to have a FILTERS table (there's a FILTER_TYPE descriptor field that I've added). It's back in, so the 1:m with CRITERIA should work fine.
    But it begs the question: Does Hibernate and O/R mapping demand at least one table per object?
    If I look in "Hibernate In Action" on page 92, it says "A major objective of the Hibernate project is support for fine grained object models" - more classes than tables. There should be an adjective "persistent" applied to classes in that phrase, because I can have many more classes that are not persisted.
    So I take this to mean that the limit is one persistent class per table, but never less. True?
    %

  • Report performance is very slow

    Hi all,
    I have a table with 25 million rows. I create a report on this table in which i need to use the following expression
    ifnull(abc_accr_int_val,0)+ifnull(xyz_mar_val_lcy,0)
    and this experession is group by asset description but the report output time is very high.Further there is no index on these columns in the database.
    Please guide me that did my approach is right ??? if no what is the right approach
    Regards

    Hi,
    Thanks for such a beautiful and informative answers I really appriciated it.
    I catch the problem and now want to share with U. As u know my prompt is on Date Column but I dont want to show this coloumn in my report.I only want that a user give a date and two columns are shown in report 1) asset_desc 2) total sum (which is sum of 2 columns as i discussed in this thread).
    Now before...after creating the prompt on Date field I edit the report view and delete this coloumn (Date) because I only want above 2 colomns and not Date column in my report. But all sorting is performed on date bec it is in prompt (where clause). When I add Date column in my report (to show date col) the speed of the report is like sql and data fetching speed same like sql. Now tell me is there any way that I delete this col from my report but it exist in answer criteria table ??????
    I have 19 Asset Desc which return by sql and answers request.
    Regards

  • Checking null values

    hi,
    can anyone please tell me the solution to solve my problem?
    i have two tables.
    1.HR->it contains all the Employee Details
    2.criteria->it contains some fields as in the HR
    hr table
    emp_id|Country_code|lob_level10|lob_level_11|salary|cpu_name
    |-----|------------|------------|-----------|------|--------
    |1111 | AE | IASG | CRM |10000 |Global
    |2222 | BZ | TTL | ILL |20000 |MD
    |3333 | CH | LLD | CRM |30000 |Global
    criteria table
    |emp_id|country_code|lob_level10|lob_level_11|cpu_name
    |------|------------|-----------|------------|--------
    | 2222 | null | null | null | MD
    | null | null | null | CRM | Global
    i want to update cpu_name in HR depend upon the condition entered in the criteria table.
    --->here the first row condition is i have to update the cpu_name as MD in HR table
    those who having the emp_id as 1111 in HR
    ---->second row condition is update the Cpu_name as Global in HR those who are having
    Lob_Level11 As CRM
    like this i want to check each row in criteria table with HR.
    after the completion of the process th HR table should look like this...
    emp_id|Country_code|lob_level10|lob_level_11|salary|cpu_name
    |-----|------------|------------|-----------|------|--------
    |1111 | AE | IASG | CRM |10000 |Global
    |2222 | BZ | TTL | ILL |20000 |MD
    |3333 | CH | LLD | CRM |30000 |Global
    thanks in advance
    vally.s
    Message was edited by:
    LEE_APT
    Message was edited by:
    LEE_APT

    Hi Vally.s,
    You first need to decide how you're going to update your table.
    Are you going to do it:
    1) for ex.:
    UPDATE hr h
    SET h.cpu = (SELECT c.cpu FROM criteria c WHERE c.emp_id = h.emp_id)
    WHERE EXISTS
    (SELECT 1
    FROM criteria c
    WHERE c.emp_id = h.emp_id);
    ... and same for other columns of criteria
    2) with PLSQL, write a procedure that loops through criteria and then through the hr table to do the update (LOOP ... (criteria) IF ... THEN LOOP ... (hr) END LOOP; END IF; IF ... THEN ... END LOOP)
    3) If you need interaction with your APEX application, you can add a condition to your different PLSQL processes.
    Hope that it's more clear now,
    Dimitri

  • Confuse on PR & PO data migration approach new to MM module

    Hi All,
    I'm pretty confuse with the PO data migration approach when it comes to PO is GR or partial GR or GR&IR. I'm hoping that someone can enlighten me. i understand that we typically don't migrate PO when it is GR & IR, FI team usually will bring over to the new system as an vendor open item in AP. How about the PR or PO which have gone through or half release strategy? What is the follow up process?  I have created a criteria table below. How Could someone point me in the right direction? Thanks in advance.
    PR
    Criteria
    Data migration required
    Notes
    Open and Released
    Y
    Open and not Released
    Y
    Flag for Deletion
    N
    Flag for Block
    Y
    PO
    Criteria
    Data migration required
    Notes
    Open and Released
    Y
    Open and not Released
    Y
    GR but no IR
    GR & IR
    N
    AP will bring over as open item
    Flag for Deletion
    N
    Flag for Block
    Y
    Partial
    Y
    For partial GR to recreate PO only with missing GR quantity
    Regards,
    John

    Hi John,
    The approach that i have followed recently is that we have considered PO as the base document and converted other documents based on the PO condition. This means you first need to see if the PO is to be converted or not. Then you can proceed to convert the related documents like PR, Agreement, Info record, Source list, etc.
    Also open qty for PO should be considered for Material and Service line items both.
    Once a GR/SES is created, it gets updated in the PO history table EKBE with its related transaction/event type.i.e. EKBE-VGABE = 1 for GR and 9 for SES. Quantity and value also gets updated in case of material and services. You can compare this consumed quantities with PO quantity.
    Please see below from SCN and let me know if you need more info on PR or PO conversion.
    Purchase Requisition Conversion Strategy
    Thanks,
    Akash

  • Report saving is very slow

    hi all
    its discoverer report when i want to save the report in html format it hangs and takes lot of time to save
    can anybody help
    kanchan

    Hi,
    Thanks for such a beautiful and informative answers I really appriciated it.
    I catch the problem and now want to share with U. As u know my prompt is on Date Column but I dont want to show this coloumn in my report.I only want that a user give a date and two columns are shown in report 1) asset_desc 2) total sum (which is sum of 2 columns as i discussed in this thread).
    Now before...after creating the prompt on Date field I edit the report view and delete this coloumn (Date) because I only want above 2 colomns and not Date column in my report. But all sorting is performed on date bec it is in prompt (where clause). When I add Date column in my report (to show date col) the speed of the report is like sql and data fetching speed same like sql. Now tell me is there any way that I delete this col from my report but it exist in answer criteria table ??????
    I have 19 Asset Desc which return by sql and answers request.
    Regards

  • How to create a variant used in SM30,View variant in Parameter transaction?

    Dear Team,
    I have a view V_TCURR. For which I would be creating a parameter transaction for transaction SM30 by filling the default Values section (VIMDYNFLDS-LTD_DTA_VR, VIEWNAME,TVIMV-VARIANT). The values for first two fields are obvious.
    The question is on TVIMV-VARIANT How can we create a variant which can be used in tcode SM30.
    Delving a  little deeper show that these variants Obsolete since R/3 Release 3.1I: Selection variant for a table or maintenance view.
    Since R/3 Release 4.0, there are view variants instead of selection variants.
    The field only exists for reasons of backwards compatibility.
    If thats is so, How do I use the same in parameter transaction..?
    I have tried creating a view variant and use it parameter transaction but in vain..
    Please help resolve my problem. I hope I am very clear. If still need any clarification, please get back to me.
    Thanks a lot in advance,
    Reagards,
    Sai.
    P.S. Though there are multiple quuestions on simlar subjects none of them has been either answered or is completely relevant to mine.

    Dear Suman,
    Thanks a lot for the answer. Actually the Tcode is getting created if I do what you have said me.
    But when I run the tcode which was created by view variant created, I am not getting the desired details .
    To be more clear..
    Previously there was a variant (TMIMV-VARIANT) created with follwing criteria..
    Table TMIMV.
    TABNAME    VARIANT AS4POS            VIEWFIELD NEGATION OPERATOR     VALUE         AND_OR      TABIX
    V_TCURR     ZTHB     1     KURST     NOT     EQ     M     AND     2          
    V_TCURR     ZTHB     2     KURST     NOT     EQ     DWBP     AND     2          
    V_TCURR     ZTHB     3     TCURR          EQ     THB     OR     4          
    V_TCURR     ZTHB     4     TCURR          EQ     USD     OR     4          
    V_TCURR     ZTHB     5     TCURR          EQ     US$          4     
    When we run tcode created by paramaeter transaction.. viewname as  V_TCURR, TMIMV-VARIANT. I am getting the desired records for updation.
    But if I do the same using View variant with the same selection criteria
    Table            Field name     Operator      Comaparison  AND/OR
                                                                   Value
    TCURR     KURST     NE     'M'     AND
    TCURR     KURST     NE     'DWBP'     AND
    TCURR     TCURR     EQ     THB     OR
    TCURR     TCURR     EQ     USD     OR
    TCURR     TCURR     EQ     US$
    And the run the tcode created by using the view variant .. I am getting No entries found that match selection criteria...
    Could you please help and let me know if I am missing any step.. Kindly also check from your side how this can be achieved.
    Thanks a lot in advance,
    Sai.

  • Code for hr-abap report in alv display

    Hi Gurus,
    I am new to hr-abap and I want some sample code to display a hr report in an alv.
    Thanks,
    Raj.

    This is one such...
    REPORT yh_rep_hr_certified_instructor MESSAGE-ID yh_messages NO STANDARD
    PAGE
    HEADING .
    Program      : YH_REP_HR_CERTIFIED_INSTRUCTOR                        *
    Description  : Certified Instructor Eligibility Criteria             *
                       TABLES                                       *
    TABLES :hrp1000 ,hrp1001, pa0000.
                          TYPE-POOLS                                 *
    *Type Pool for ALV display
    TYPE-POOLS :slis.  " Global types for generic cunning components
                    INTERNAL TABLES                                 *
    *Internal Table to keep Selection Screen field values
    DATA : BEGIN OF t_validation OCCURS 0.
            INCLUDE STRUCTURE dynpread.
    DATA END OF t_validation.
    *Internal Table for Business Event Groups
    DATA : BEGIN OF t_bgrp OCCURS 0,
            objid TYPE hrobjid,
            blank(1),
            stext TYPE stext,
           END OF t_bgrp.
    *Internal Table for Business Event Type IDs with text for selected Event
    *GROUPS
    DATA : BEGIN OF t_btyp OCCURS 0,
            objid TYPE hrobjid,
            blank(1),
            stext TYPE stext,
           END OF t_btyp.
    *Internal Table for Business Event Type IDs for selected Event Groups
    DATA : BEGIN OF t_eventtypelist OCCURS 0,
            objid TYPE hrobjid,
           END OF t_eventtypelist.
    *Internal table to store the business Groups
    DATA : BEGIN OF t_group OCCURS 0,
            objid LIKE hrp1001-objid,
            sobid LIKE hrp1001-sobid,
            sclas LIKE hrp1001-sclas,
           END OF t_group.
    *Internal table to hold the business event group and/or bus. event types
    DATA : BEGIN OF t_eventgroup OCCURS 0,
            objid LIKE hrp1001-objid,
           END OF t_eventgroup.
    *Internal Table for FieldCatalog used for ALV Display
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    *Work Area for Checking Business Event Group Validity
    DATA: BEGIN OF wa_bgrp,
           objid TYPE hrobjid,
           stext TYPE stext,
          END OF wa_bgrp.
    *Internal table to fetch object id for Qualification
    DATA: BEGIN OF t_objid OCCURS 0,
           objid TYPE hrp1000-objid,
           sobid TYPE hrp1001-sobid,
           sobid_copy TYPE hrp1001-objid,
          END OF t_objid.
    *Internal table to fetch Id of related object
    *Fetches Pernr of Certified Instructors
    DATA: BEGIN OF t_sobid OCCURS 0,
           objid TYPE hrp1000-objid,
           sobid TYPE hrp1001-sobid,
           adatanr TYPE hrpad31-adatanr,
           sobid_copy TYPE hrp1001-objid,
         END OF t_sobid.
    *Internal table to fetch skill rating
    *of the Instructor
    DATA: BEGIN OF t_prof OCCURS 0,
            adatanr TYPE hrpad31-adatanr,
            chara TYPE hrpad31-chara,
          END OF t_prof.
    *Internal table to fetch grade
    *of the Insturctor
    DATA: BEGIN OF t_grade OCCURS 0,
           pernr TYPE pa0008-pernr,
           yysalgr TYPE pa0008-yysalgr,
          END OF t_grade.
    *Internal table which contains all information about the Person like
    *Name Project Project Manager Name Account and Vertical Name
    DATA: t_projdetails TYPE zbapi_projdetails OCCURS 0 WITH HEADER LINE.
    *Final Internal table which contains all information
    *about the Instructors
    DATA: BEGIN OF t_final OCCURS 0,
             empid TYPE pa0000-pernr,
             empname(84) TYPE c,
             grade TYPE pa0008-yysalgr,
             atndttt(3) TYPE c,
             sklrate TYPE hrpad31-chara,
             pgmng TYPE pa0001-ename,
             accname TYPE hrp1000-stext,
             vertname TYPE hrp1000-stext,
           END OF t_final.
                         VARIABLES                                  *
    *ALV layout
    DATA: gs_layout TYPE slis_layout_alv, "alvtot test
          gt_events TYPE slis_t_event,
          gt_list_top_of_page TYPE slis_t_listheader,
          gs_variant LIKE disvariant,     "For Layout
          g_save.                         "For Layout Save
    DATA: w_pos TYPE i VALUE 1,            " Position of Fields in ALV
          w_sort TYPE slis_t_sortinfo_alv, "ITab for Sorting Options
          w_flag TYPE i,
          w_repid TYPE sy-repid,
          w_lineno TYPE sy-tabix.
    DATA: l_short TYPE hrp1000-short. "variable to check the heirarchy
                     SELECTION-SCREEN DESIGN                            *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. "NO INTERVALS .
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(20) text-009 MODIF ID xyz.
    PARAMETERS : p_bgrp TYPE hrobjid OBLIGATORY,
                 p_bgrp1 TYPE stext .
    SELECTION-SCREEN END OF LINE.
    SELECT-OPTIONS :s_btyp FOR hrp1000-objid OBLIGATORY NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b1.
                            INITIALIZATION                               *
    INITIALIZATION.
    *Assign Program Name into a variable
      w_repid = sy-repid.
    *Build layout for list display
      gs_layout-detail_popup      = 'X'.
    *To get All Events in TOP-OF-PAGE
    perform eventtab_build using gt_events[].
      gs_variant-report = w_repid.
      g_save           = 'A'.
                         AT SELECTION SELECTION                          *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bgrp.
      PERFORM get_bgrp.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-low.
      IF NOT p_bgrp IS INITIAL .
        PERFORM get_btyp USING 'l'.
      ELSE .
        MESSAGE s999 WITH text-e09.
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_btyp-high.
      IF NOT p_bgrp IS INITIAL .
        PERFORM get_btyp USING 'h'.
      ELSE .
        MESSAGE s999 WITH text-e09.
      ENDIF.
    AT SELECTION-SCREEN ON p_bgrp.
      SELECT SINGLE objid stext
             FROM hrp1000
             INTO wa_bgrp
             WHERE objid = p_bgrp AND
             otype = 'L' AND
             plvar = '01' AND
             ( short = 'ROLE' OR
             short = 'TECH_PROGRAM' ).
      IF sy-subrc EQ 0.
        p_bgrp1 = wa_bgrp-stext.
      ELSE.
        MESSAGE e999 WITH text-e09.
      ENDIF.
    AT SELECTION-SCREEN ON s_btyp.
      CLEAR : t_eventtypelist, t_group, t_eventgroup.
      REFRESH : t_eventtypelist, t_group, t_eventgroup.
      CLEAR : w_flag.
    *Fetch all the subordinates under given Event Group - L/D
      SELECT objid
             sobid
             sclas
                 FROM hrp1001
                 INTO TABLE t_group
                 WHERE objid = p_bgrp
                 AND plvar = '01'
                 AND rsign = 'B'
                 AND relat = '003'
                 AND ( sclas = 'L' OR sclas = 'D' ).
      WHILE w_flag <> 1.
        PERFORM get_objids.
      ENDWHILE.
      IF NOT t_eventtypelist[] IS INITIAL.
    *Get only valid Event Types from input Event Types, for given Event
    *Group - by deleting others..
        LOOP AT t_eventtypelist.
          IF t_eventtypelist-objid IN s_btyp.
            EXIT.
          ELSE.
            DELETE t_eventtypelist.
          ENDIF.
          AT LAST.
    *since we r checking Event Types, All other fields will be locked
    *but we need Event Group field to be unlocked to edit again,
    *if theres no theres no valid Event Types in given input
            LOOP AT SCREEN.
              CHECK screen-name = 'P_bgrp'.
              screen-input = '1'.
              MODIFY SCREEN.
            ENDLOOP.
            MESSAGE e999 WITH text-e04.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
          CHECK screen-name = 'P_bgrp'.
          screen-input = '1'.
          MODIFY SCREEN.
        ENDLOOP.
        MESSAGE e999 WITH text-e03.
      ENDIF.
          FORM get_bgrp                                                 *
    FORM get_bgrp .
      SELECT objid stext
             FROM hrp1000
             INTO CORRESPONDING FIELDS OF TABLE t_bgrp
             WHERE plvar = '01' AND
                   otype = 'L' AND
                   short = 'ROLE' OR
                   short = 'TECH_PROGRAM' .
      CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
        EXPORTING
          endpos_col   = 75
          endpos_row   = 20
          startpos_col = 30
          startpos_row = 05
          titletext    = 'Select Business Event Group'
        IMPORTING
          choise       = w_lineno
        TABLES
          valuetab     = t_bgrp
        EXCEPTIONS
          break_off    = 1
          OTHERS       = 2.
      IF sy-subrc EQ 0 .
        READ TABLE t_bgrp INDEX w_lineno.
        IF sy-subrc EQ 0.
          p_bgrp = t_bgrp-objid.
          p_bgrp1 = t_bgrp-stext.
        ENDIF .
        CLEAR t_bgrp .
        REFRESH  t_bgrp .
      ENDIF .
    ENDFORM .                    "get_bgrp
    ****subroutine for business eventtype input criteria
    FORM get_btyp USING f_range.
      CLEAR :   t_validation,
                t_btyp,
                t_eventtypelist,
                t_group,
                t_eventgroup,
                w_flag.
      REFRESH : t_validation,
                t_btyp,
                t_eventtypelist,
                t_group,
                t_eventgroup.
      t_validation-fieldname = 'P_BGRP'.
      APPEND t_validation.
      CLEAR t_validation.
    *Getting Screen Values
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = w_repid
          dynumb               = '1000'
        TABLES
          dynpfields           = t_validation
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      READ TABLE t_validation WITH KEY fieldname = 'P_BGRP'.
      IF NOT t_validation-fieldname IS INITIAL.
    *Getting Event Group ID that entered
        LOOP AT t_validation.
          IF t_validation-fieldname = 'P_BGRP'.
            p_bgrp = t_validation-fieldvalue.
          ENDIF.
        ENDLOOP.
        CLEAR t_validation.
        REFRESH t_validation.
    *To fetch the business event groups and business event types that belong
    to the input business event group.Since a business group can have a
    *business groups as well as business event types we have pick all of
    *them
    *Getting all subordinates - Event Group/Type under given Event Group
        SELECT objid
               sobid
               sclas
                   FROM hrp1001
                   INTO TABLE t_group
                   WHERE objid = p_bgrp
                   AND plvar = '01'
                   AND rsign = 'B'
                   AND relat = '003'
                   AND endda = '99991231'
                   AND ( sclas = 'L' OR sclas = 'D' ).
    *Getting all Event Types
        WHILE w_flag <> 1.
          PERFORM get_objids.
        ENDWHILE.
        IF NOT t_eventtypelist[] IS INITIAL.
          SORT t_eventtypelist BY objid.
    *Getting Names of Event Types
          SELECT objid
                 stext
                      FROM hrp1000
                      INTO CORRESPONDING FIELDS OF TABLE t_btyp
                      FOR ALL ENTRIES IN t_eventtypelist
                      WHERE objid = t_eventtypelist-objid
                      AND otype = 'D' AND plvar = '01'
                      AND endda = '99991231'.
          IF sy-subrc = 0.
    *PopUp Display for Event Types
            CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
              EXPORTING
                endpos_col   = 75
                endpos_row   = 20
                startpos_col = 30
                startpos_row = 05
                titletext    = 'Select Business Event Type ID'
              IMPORTING
                choise       = w_lineno
              TABLES
                valuetab     = t_btyp
              EXCEPTIONS
                break_off    = 1
                OTHERS       = 2.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ELSE.
    *Since the Table returned by function module will have data in Header,
    *clear the Header
    *Retreive Selected Event Type into Select Option
              READ TABLE t_btyp INDEX w_lineno.
              IF sy-subrc EQ 0.
                IF f_range = 'l'.
                  s_btyp-low = t_btyp-objid.
                ELSE.
                  s_btyp-high = t_btyp-objid.
                ENDIF.
              ENDIF.
            ENDIF.
          ELSE.
            MESSAGE s999 WITH text-e03.
          ENDIF.
        ELSE.
          MESSAGE s999 WITH text-e01.
        ENDIF.
      ENDIF.
    ENDFORM.                    " EVNTTY
          FORM get_objids                                               *
    FORM get_objids.
    *To delete the business event types that are found and push it in
    *another table
      IF NOT t_group[] IS INITIAL.
        LOOP AT t_group.
    *If event type
          IF t_group-sclas = 'D'.
            t_eventtypelist-objid = t_group-sobid.
            APPEND t_eventtypelist.
            CLEAR t_eventtypelist.
            DELETE t_group.
    *If event group
          ELSEIF t_group-sclas = 'L'.
            t_eventgroup-objid = t_group-sobid.
            APPEND t_eventgroup.
            CLEAR t_eventgroup.
            DELETE t_group.
            CLEAR t_group.
          ENDIF.
        ENDLOOP.
      ELSE.
        w_flag = 1.
      ENDIF.
      IF NOT t_eventgroup[] IS INITIAL.
    *To get the second level of business groups and business event type
        SELECT objid sobid sclas
               FROM hrp1001
               INTO TABLE t_group
               FOR ALL ENTRIES IN t_eventgroup
               WHERE objid = t_eventgroup-objid
               AND plvar = '01'
               AND rsign = 'B'
               AND relat = '003'
               AND endda = '99991231'
               AND ( sclas = 'L' OR sclas = 'D' ).
        CLEAR t_eventgroup.
        REFRESH t_eventgroup.
      ENDIF.
    ENDFORM.                    " GET_OBJIDS
                           Start of Selection                            *
    START-OF-SELECTION.
    *Pass the Event Type and fetch the Related Id
    *for the Qualification imparted by the Event
      SELECT objid sobid
             FROM hrp1001
             INTO TABLE t_objid
             WHERE objid IN s_btyp AND
                   otype = 'D' AND
                   plvar = '01' AND
                   relat = '028' AND
                   rsign = 'A' AND
                   sclas = 'Q'.
      IF sy-subrc EQ 0.
    *Pass the Qualification Id and fetch Object Id of the
    *person who fulfills this Qualification
        SELECT objid sobid adatanr
           FROM hrp1001
           INTO TABLE t_sobid FOR ALL ENTRIES IN t_objid
           WHERE sobid = t_objid-sobid AND
                 otype = 'P' AND
                 plvar = '01' AND
                 relat = '032' AND
                 rsign = 'A' AND
                 sclas = 'Q' .
        IF sy-subrc = 0.
    *Fetch only the Person along with the skillrating
    *who has skill rating as '0001' or '0003'
          SELECT adatanr chara
                 FROM hrpad31
                 INTO TABLE t_prof
                 FOR ALL ENTRIES IN t_sobid
                 WHERE adatanr = t_sobid-adatanr AND
                ( chara = '0001' OR chara = '0003' ).
          IF sy-subrc NE 0.
            MESSAGE s999 WITH text-s01.
            EXIT .
          ELSE .
    *Fetch only Employee Id's who meets the required skill rating
    *which inturn has the EMPID who are all are Certified Instructors
            LOOP AT t_sobid.
              READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
              IF sy-subrc NE 0.
                DELETE t_sobid .
              ENDIF.
            ENDLOOP.
            SORT t_sobid BY objid.
            DELETE ADJACENT DUPLICATES FROM t_sobid.
          ENDIF.
        ENDIF.
      ENDIF.
      IF NOT t_sobid[] IS INITIAL.
    data: begin of it_trgpernr occurs 0,
             objid type hrp1000-objid,
             sobid type hrp1001-sobid,
           end of it_trgpernr.
    select objid sobid
            from hrp1001
            into table it_trgpernr for all entries in t_sobid
            where  otype ='P' and
                  objid = t_sobid-objid and
                  sclas = 'D' and
                  sobid = '50008220'.
    *Fetch Grade of the Certified Instructors by passing their EmpId's
        SELECT pernr yysalgr
                     FROM pa0008
                     INTO TABLE t_grade
                     FOR ALL ENTRIES IN t_sobid
                     WHERE pernr = t_sobid-objid AND endda = '99991231'.
      ENDIF.
    For Heading in the Output Display Layout
      PERFORM heading USING gt_list_top_of_page[].
                           End of Selection                              *
    END-OF-SELECTION.
    Populating data into Final Table which contains all information aboutthe Certified Instructors
    *Retrieve Employee Id for the Certified Instructors  only if he is active
      LOOP AT t_sobid.
        SELECT SINGLE *
               FROM pa0000
               WHERE pernr = t_sobid-objid  AND
                     begda <= sy-datum AND
                     endda >= sy-datum AND
                     stat2 ='3'.
        IF sy-subrc = 0.
          t_final-empid = t_sobid-objid.
          SELECT  SINGLE *
                FROM hrp1001
                WHERE otype = 'P' AND
                      objid = t_sobid-objid AND
                      rsign = 'B' AND
                      relat = '25' AND
                      sclas = 'D' AND
                      sobid = '50008220'.
    *DATA:W_SOBID TYPE HRP1001-SOBID.
    *W_SOBID = t_sobid-objid.                 .
         SELECT  SINGLE *
               FROM hrp1001
               WHERE otype = 'D' AND
                     objid = '50008220' AND
                     rsign = 'B' AND
                     relat = '25' AND
                     sclas = 'P' AND
                     sobid = W_SOBID.
          IF sy-subrc EQ 0.
            t_final-atndttt = 'YES'.
          ELSE.
            t_final-atndttt = 'NO'.
          ENDIF.
    *Retrieve Employee SkillRating for the Certified Instructors
    *by passing the adatanr value which inturn is fetched based on the empid
          READ TABLE t_prof WITH KEY adatanr = t_sobid-adatanr.
          IF sy-subrc EQ 0.
            t_final-sklrate = t_prof-chara.
          ENDIF.
    *Retrieve Employee Grade for the given id
          READ TABLE t_grade WITH KEY pernr = t_sobid-objid.
          IF sy-subrc EQ 0.
            t_final-grade = t_grade-yysalgr.
          ENDIF.
          REFRESH t_projdetails.
          CLEAR t_projdetails.
    *function which fetches the name project name account and
    *vertical name of the person for the given empid
          CALL FUNCTION 'ZBAPI_PROJDETAILS'
            EXPORTING
              pernr       = t_sobid-objid
            TABLES
              it_finaltab = t_projdetails.
          IF NOT t_projdetails[] IS INITIAL.
            SHIFT t_sobid-objid LEFT DELETING LEADING '0'.
            READ TABLE t_projdetails WITH KEY pernr = t_sobid-objid.
            IF sy-subrc EQ 0.
              t_final-empname = t_projdetails-ename.
              IF NOT t_projdetails-proj IS INITIAL.
                t_final-pgmng = t_projdetails-pmname.
              ELSE.
                t_final-pgmng = t_projdetails-gmname.
              ENDIF.
              t_final-accname = t_projdetails-accname.
              t_final-vertname = t_projdetails-vertname.
            ENDIF.
          ENDIF.
          APPEND t_final.
        ENDIF.
        CLEAR t_final.
      ENDLOOP.
      SORT t_final BY empid.
      DELETE ADJACENT DUPLICATES FROM t_final.
    *Enabling Sort by PERNR & Global ID in ALV display
      PERFORM sub_sort_info.
    *Form to Populate Field Catalog
      PERFORM populate_fieldcatalog.
    For the ALV ROW Optimize Width
      gs_layout-colwidth_optimize = 'X' .
    *perform alv_display tables final fieldcatalog.
      IF NOT t_final[] IS INITIAL.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = w_repid
            is_layout          = gs_layout
            it_fieldcat        = t_fieldcatalog[]
            it_sort            = w_sort
            i_save             = 'A'
            it_events          = gt_events[]
          TABLES
            t_outtab           = t_final
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ELSE.
        MESSAGE s000(vz) WITH 'No Records found for Given Input Criteria'.
      ENDIF.
                             TOP OF PAGE                                 *
    *Outputs formatted simple header information at TOP-OF-PAGE.
    TOP-OF-PAGE.
      PERFORM top_of_page.
                             Subroutines                                 *
    *&      Form  eventtab_build
          text`
         -->P_GT_EVENTS[]  text
    FORM eventtab_build USING  rt_events  TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      DATA: g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = rt_events.
      READ TABLE rt_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE g_top_of_page TO ls_event-form.
        APPEND ls_event TO rt_events.
      ENDIF.
    ENDFORM.                    " eventtab_build
    *&      Form  HEADING
          text
    FORM heading USING lt_top_of_page TYPE slis_t_listheader.
      DATA: ls_line TYPE slis_listheader.
    *Layout Display Text - "Caritor ( India ) Pvt.Ltd "
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = text-h01.
      APPEND ls_line TO lt_top_of_page.
    *Layout Display Text - "Certified Instructor Eligibility List     "
      CLEAR ls_line.
      ls_line-typ  = 'H'.
      ls_line-info = text-h02.
      APPEND ls_line TO lt_top_of_page.
    ENDFORM.                    " HEADING
    *&      Form  top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_list_top_of_page.
    ENDFORM.                    " top_of_page
    *&      Form  sub_sort_info
          text
    -->  p1        text
    <--  p2        text
    FORM sub_sort_info.
      DATA : l_sort TYPE slis_sortinfo_alv .
      CLEAR l_sort.
    Employee ID
      l_sort-fieldname = 'EMPID'.
      l_sort-up        = 'X'.
      APPEND l_sort TO w_sort.
    ENDFORM.                    " sub_sort_info
    *&      Form  populate_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    FORM populate_fieldcatalog.
      PERFORM fill_fields_of_fieldcatalog
               TABLES t_fieldcatalog
               USING 'T_FINAL' 'EMPID' ' ' text-011 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
               TABLES t_fieldcatalog
               USING 'T_FINAL' 'EMPNAME' ' ' text-002 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'GRADE' ' ' text-003 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'ATNDTTT' ' ' text-004 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'PGMNG' ' ' text-006 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'ACCNAME' ' ' text-007 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'VERTNAME' ' ' text-008 20 w_pos.
      PERFORM fill_fields_of_fieldcatalog
              TABLES t_fieldcatalog
              USING 'T_FINAL' 'SKLRATE' ' ' text-005 20 w_pos.
    ENDFORM.                    " populate_fieldcatalog
    *&      Form  FILL_FIELDS_OF_FIELDCATALOG
          text
         -->P_T_FIELDCATALOG  text
         -->P_0870   text
         -->P_0871   text
         -->P_0872   text
         -->P_TEXT_001  text
         -->P_20     text
         -->P_W_POS  text
    FORM fill_fields_of_fieldcatalog TABLES fp_t_fieldcatalog STRUCTURE
                                                         t_fieldcatalog
                                     USING    fp_table
                                              fp_field
                                              fp_key
                                              fp_text
                                              fp_out_len
                                              fp_pos.
      fp_t_fieldcatalog-tabname    = fp_table.
      fp_t_fieldcatalog-fieldname  = fp_field.
      fp_t_fieldcatalog-seltext_l  = fp_text.
      fp_t_fieldcatalog-key        = fp_key.
      fp_t_fieldcatalog-outputlen  = fp_out_len.
      fp_t_fieldcatalog-col_pos    = fp_pos.
      APPEND fp_t_fieldcatalog.
      CLEAR:  fp_t_fieldcatalog.
      fp_pos = fp_pos + 1.
    ENDFORM.                    " FILL_FIELDS_OF_FIELDCATALOG
    10.249.11.136\SAP-StudyMaterial

Maybe you are looking for

  • VO Extension Error in modifying the query of XML Publisher Report Template

    Hi Friends, I have one requirement related to calling XML Publisher Reports Template from OAF Page. When clicking on the submit button the XML Publisher template is calling and displaying the data. Our requirement is to display some more columns in t

  • Photos and Folders Missing

    I have Mac 13inch 10.6.8. In Iphoto, I can't find my Originals Folders, I only have one folder for 2010. I use to have one for each year. Also so many of my photos have exclamation marks despite me using 'Convert to original' to find them. How can I

  • How to install oracle EM 11.2.0 at the VCS active passive node ?

    Dear all Gurus Anyone can help me for the installation of the Oracle EM 11.2.0 on the Veritas cluster storage with the active & passive node. we have 2 host name pscsdbhost1 & pscsdbhost2. I did try to install using : emca -config dbcontrol db -repos

  • How do I solve this problem I have with Itunes?

    Suddenly a good chunk of my itunes music library can't be found.  The songs are on my ipod but itunes says it can't find them on my computer.  Luckily I had a backup of most on an external drive but I had move these individually back to my itunes lib

  • HT4623 Is there a charge for every update?

    Just wanting to know if there is a charge for every update?