Table-driven combination categorization

I have a working report that has a gt_vbap internal table with only two columns; VBELN and MVGR3.  A given order (VBELN) can have multiple rows in gt_vbap for a combination of kits (a MVGR3 code is used to represent each kit) that might be bought on each order.
(ex:)
VBELN         MVGR3
187037934     BKS
187037934     
187037936     JBU
187037936     
187037937     JBU
187037937     
187037937     SLC
187037937     DGC
187037937     TOC
187037938     JBU
187037938     
187037938     SLC
187037938     SPC
187037938     DGC
187037938     DTC
187037938     ORC
187037938     TOC
The report currently turns "on" a global variable flag for each MVGR3 that it finds per order and initializes the flags before the next VBELN set.
It then goes into a complex hard-coded IF THEN ELSE perform that has an IF clause for each possible combination of kits, using the flags to see which combination was ordered.  That perform also assigns a NUMBER to that "group" or combination.  That number is then used in another perform with hard-coded IF logic to give a unique NAME to the combination.  To write the report, the number/name rows (or different combinations) then become aggregated for sales of different types.
The psuedo-code for all this is:
Clear each MVGR3 flag.
Loop at gt_vbap using field symbols to assign 'X' to flag for each found MVGR3.
At end of vbeln:
    perform get_group
    perform assign_description (takes the number from the group and gives a description)
    clear each MVGR3 flag.
ENDAT.
ENDLOOP.
FORM GET_GROUP
    (contains a separate IF clause for each possible combination of MVGR3 values
ENDFORM.
Edited by: Rob Burbank on Jun 16, 2010 3:45 PM

am trying to design a way to replace all that hard-coded IF logic in the performs with a new custom table containing the numbers (there are just over a hundred combinations, but this will grow), the names of the kit combinations, and the MVGR3 (material group 3) codes that make up each valid combination.
Something like this is what I was thinking of.  Using a custom table will require less programming when valid kits are added or changed from our sales lineup.
z_kit_group_desc
Group     Desc              Col1     Col2     Col3     Col4     Col5     Col6     Col7
17           Only BKE     BKE                              
18             BKE plus     BKE     SLC                         
u2026                                        
79             Large Group BKE        SLC     ORC     DGC     DTC     SPC     
80           Big Group     BKE     SLC     ORC     DGC     DTC     SPC     TOC
Sorry for all that background, but here is the problem:  How can I match up the internal table gt_vbap values for each VBLEN with the new custom table "z_kit_group_desc" (not yet defined) to give a number/description group to each ordered combination?  I'm not sure how to find the proper row from my new custom table using the combination of rows from the internal table that make up the combinations on each order.  Table gt_vbap MVGR3 values do not occur in any particular order, but are part of a finite combination.
Thank you!
Jeremy

Similar Messages

  • Hash tables in combination with data references to the line type.

    I'm having an issue with hash tables - in combination with reference variables.
    Consider the following:  (Which is part of a class)  -  it attempts to see if a particular id exists in a table; if not add it; if yes change it.   
      types: BEGIN OF TY_MEASUREMENT,
               perfid      TYPE zgz_perf_metric_id,
               rtime       TYPE zgz_perf_runtime,
               execount    TYPE zgz_perf_execount,
               last_start  TYPE timestampl,
             END OF TY_MEASUREMENT.
    METHOD START.
      DATA:  ls_measurement TYPE REF TO ty_measurement.
      READ TABLE gt_measurements WITH TABLE KEY perfid = i_perfid reference into ls_measurement.
      if sy-subrc <> 0.
        "Didn't find it.
        create data ls_measurement.
        ls_measurement->perfid = i_perfid.
        insert ls_measurement->* into gt_measurements.
      endif.
      GET TIME STAMP FIELD ls_measurements-last_start.
      ls_measurement->execount = ls_measurement->execount + 1.
    ENDMETHOD.
    I get compile errors on the insert statement - either "You cannot use explicit index operations on tables with types HASHED TABLE" or "ANY TABLE".      It is possible that.
    If I don't dereference the type then I get the error  LS_MEASUREMENT cannot be converted to the line type of GT_MEASUREMENTS.
    I'm not looking to solve this with a combination of references and work ares - want a reference solution.   
    Thanks!
    _Ryan
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Apr 22, 2010 4:43 PM

    I think it might work when you change it for
    insert ls_measurement->* into TABLE gt_measurements.
    For hashed table a new line here will be inserted according to given table key.
    Regards
    Marcin

  • Table driven parllel processing in workflow

    Hi,
        Please tell me what is table driven parllel processing technique in workflow?
    Thanks in advance.
    Thanks& Regards,
    Rao N

    Hi, that's a difficult requirement.
    First advice post this on the workflow forum (=BPM) it's better suited there.
    Next advice:
    Try to make it easier for yourself, I don't think the business will ever be able to ha a 12 step approval case, most of the times it's 1, a lot of times 2 and in some cases 3 (is this correct with the business you're working in ?)
    In that case, you can simply dynamically fill the workflow containers holding the number of levels plus the approvers, based on the number of levels (multiple condition) you either execute subflow 1, 2 or 3.
    OR, you can somehow put all the logic in a loop.
    Kind regards, Rob Dielemans

  • PE51 Rules - table/field combinations

    Hi all,
    I need to add some employee subgroups to Rules section in our payslip (hr form editor).
    However, the table field combination currently being used here isn't available in F4 dropdown, P0001/PERSK, although this field does exist in the structure. Therefore I can not save new entries with this combination..
    Does anyone know how I can add new field selections for a given table, e.g. P0001.
    Any insights much appreciated.
    thanks
    ps. I have tried maintaining the search helps in SE11 for the table field aswell (PPE51_7000), but it does not allow to maintain.
    Edited by: minttea on Nov 26, 2010 12:52 PM

    Go to T code PE51_CHECKTAB and enter country grouping and form class CEDT ...give the reference country and form class as 99 and CEDT.Goto Change here you can add in the table in table tab and field in Field tab..
    Use that fields in your rules.
    Mohan

  • Redirect on page load (table-driven rules)

    ADF 11gR1 PS1
    Hi all,
    On some pages, I need to redirect the user based on a table driven rules (eg page is active only between dates x and y, etc). Because there will be numerous pages with this functionality, as well as table driven configuration with regards to the rules (eg which page is affected, what dates are valid, what url should the user be redirected to), and since this can happen for both unbound and bound tasks, I'm not sure if using a router is the best way to do this.
    Per this thread
    Redirect in adfc
    I'd like to attempt to do this via a bean method called during page load. Here's what I can't figure out:
    1) Is there a way the bean method can figure out the calling page name?
    2) How to call the bean method on page load that would allow a redirect.
    Regarding #2, on the previously mentioned thread, someone mentioned a PhaseListener on RESTORE_VIEW, but I don't quite understand how do to that.
    Thanks.

    Hi,
    the after RESTORE_VIEW phase can be listened for in a PhaeListener you configure in the faces-config.xml file. This RESTORE_VIEW phase has accec to the FacesContext and thus to the ViewRoot, which provides information about the requested viewId. You can then change the ViewId of this ViewRoot based on your redirection needs.
    A router activity is the best practices here because the use case you describe is conditional navigation. So if you need to have the logic in a managed bean, then why don't you point the router case to this ?
    Frank

  • Table for combination of Purchase requestition doc type and Purchase order doc type

    Hi,
    scenario:
    Purchase requestion has document type of Direct purchase which has allowable item category "Standard, consignment, subcontracting, third party and stock transfer".
    Purchase order has document type of indirect purchase which has allowable item category "standard and services".
    Now i saw in Define Document type OMEC, 'Doc type-Direct purchase' of purchase requestion is being linked to 'Doc type-Indirect purchase' of purchase order.
    Question:
    Can you please let me know how to pull of data for combination of  'Doc type-Direct purchase' of purchase requestion and 'Doc type-Indirect purchase'  of purchase order from SE16N? (assuming that we dont know what PR is converted to PO for the above combination)
    Note: Please don't delete this thread

    You did the hardest part: finding the custo in SPRO.
    Once you there, just click "table view" :
    and then on "print"
    Once you click, you see the table name you are looking for:
    Hope it helps,
    Génia.

  • Populating table with combination of values

    Hi,
    I have table A with columns col1, col2, col3.
    I have 4 distinct values for col1 (d1, d2, d3, d4).
    I have 2 distinct values for col2 (e1, e2).
    I have 3 distinct values for col2 (r1, r2, r3).
    I need to write a SQL to populate table A with combination of of all the values, so I would have 24 records (4 * 2 * 3). How can I do that?
    Thanks.

    with a as ( select 'd1' col1 from dual union all
    select 'd2' from dual union all
    select 'd3' from dual union all
    select 'd4' from dual )
    , b as ( select 'e1' col2 from dual union all
    select 'e2' from dual )
    , c as ( select 'r1' col2 from dual union all
    select 'r2' from dual union all
    select 'r3' from dual
    select * from
    a, b, c
    CO CO CO
    d1 e1 r1
    d2 e1 r1
    d3 e1 r1
    d4 e1 r1
    d1 e1 r2
    d2 e1 r2
    d3 e1 r2
    d4 e1 r2
    d1 e1 r3
    d2 e1 r3
    d3 e1 r3
    d4 e1 r3
    d1 e2 r1
    d2 e2 r1
    d3 e2 r1
    d4 e2 r1
    d1 e2 r2
    d2 e2 r2
    d3 e2 r2
    d4 e2 r2
    d1 e2 r3
    d2 e2 r3
    d3 e2 r3
    d4 e2 r3
    24 rows selected.SS

  • Tables for Multilevel Categorization selected in the Transactions

    Hello guys,
    We are using CRM 2007 IC Web Client. I have set up Multilevel Categorization with 2 levels for Service Orders
    Level 1: Motivo
    Level 2: Central
    When creating a Service Order, I choose both Level 1 and Level 2. And I want to know in which table I can find the both Levels I selected for each Service Order. I mean, I do not need the table with the categories (which I customized in the Rule Modeler)....I need the transactional table where I can find the Service Order ID and the Levels which were selected.
    I performed a trace and I found a  the table CRMD_SRV_SUBJECT. However it only shows me the Level 2 for each Service Order and this has some logic because if I check in the GUI (by using transaction CRMD_ORDER) the service order I created in the IC Web, it only shows me One Level and it corresponds to the Level 2.
    I hope you can help me!
    Many thanks in advance!
    Pablo

    Hello Rupesh and Saumya, many thanks for your quick replies.
    However they do not solve my question.
    Rupesh, those tables that you mentioned are useful to see what I customize in the Rule Modeler with the IC_MANAGER Business Role. I need the transactional table where I can find all the two Levels values that I selected for each Service Order.
    Saumya, as I mentioned in the question posted, we have already been able to reach table CRMD_SRV_SUBJECT. The problem is that the table only shows me the LAST Level I chose in the IC Web when creating the Service Order. In our case Level 2 (as we only need 2 Levels).
    I have just read in the CR410 manual and it says the following which is the cause why I only see the Level 2 in the CRMD_SRV_SUBJECT table:
    "In the IC WebClient the categories can be selected to categorize a transaction. However the categories are only visible in the service ticket in the IC WebClient UI. They are not directly sotred in the service ticket. When the ticket is saved the Catalog/Code Group/ Code of the lowest selected category is stored on the database. The categories are linked via the hierarchy of the category modeler to the codes and thus to the ticket"
    Any suggestions?
    Many thanks for your help!
    Pablo

  • Tables/Joins for logical tables being combined

    I have 2 logical tables set up that have multiple physical table sources (using map to these tables). Some of the physical sources are the same in each logical table. It seems that when I make selections from Answers and look at the SQL, it is picking tables from both logical tables (instead of just the one I used). It is also grabbing the content (additional 'where condition') from the other logical table as well. Why is it doing that?

    Yes it is kind of limitation in obiee. But there are some solutions which might deviate from best practices.
    Sol 1. Snowflake the dimensions in Business Model. Rather than merging both of them into single logical table, separate them into two different logical tables.
    Sol 2. For the logical table , have two LTSs. First LTS will have both tables and all columns mapped to both tables. Second LTS will have only main table, Columns belong to that table only mapped. In this way when you selected columns related to first source system will use second LTS which has only only one table.
    - Madan Thota

  • Hide Tabs based on a table driven customer access

    Hi,
    I want some of the tabs to be hidden based on user profile that I've saved in a table... in the table I've identified user name (that I am comparing against the login user name) and in one of the columns I've identified if they should have access to the tab or not (by entering "Y" against the user names that should have access to the table)... Table looks something like this:
    Table Name: Table_A
    User_Name Tab_Access
    ABC
    BCD Y
    XYZ Y
    EFG
    (note: based on the above table only users BCD and XYZ should see the tab for the rest it should be hidden)
    To accomplish the above, I've put following PL/SQL code under "Conditional Tab Display"
    APEX_UTIL.Get_First_Name(:APP_USER)||' '||APEX_UTIL.Get_Last_Name(:APP_USER) in (select User_Name from Table_A where Tab_Access = 'Y)
    and set Tab Display Condition to PL/SQL expression
    and got the following error message:
    Invalid PL/SQL expression condition: ORA-06550: line 1, column 114: PLS-00405: sub query not allowed in this context ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    when I changed the above PL/SQL statement to something like this (it worked):
    APEX_UTIL.Get_First_Name(:APP_USER)||' '||APEX_UTIL.Get_Last_Name(:APP_USER) in ('BCD', 'XYZ')
    Please advice

    Hi,
    Try this for Conditional Tab Display:
    Condition Type: Exists(SQL Query returns at least one row)
    Expression 1:
    select 1 from Table_A
    where Tab_Access = 'Y' and
    User_Name = APEX_UTIL.Get_First_Name(:APP_USER)||' '||APEX_UTIL.Get_Last_Name(:APP_USER)Update your forum profile with a real handle instead of "qwe12654".
    Use [url http://wikis.sun.com/display/Forums/Forums+FAQ]formatting tags for code to indicate the code you are using.
    Hope it helps!
    Regards,
    Kiran

  • Best way to load data in table from combination of Table and flat file?

    Hi All,
    Could you please share your thoughts on best way of achieving this objective -
    Flat File - 15 Million records (Field A,B,C)
    Table A - 15 Million records ( Field A,D)
    Objective -
    Load Field A,B,C,D in Table B from Flat file and Table A.
    Data can be loaded from flat file in Table B then updated from Table A but this update operation is taking lot of time. (Intermediate Commit, Bulk operations already tried)
    Regards,
    Dark Knight

    Environment -
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Tables are analyzed.
    Indexes are their.
    Update statement using the index.
    Data is close to 200 MB.
    I am interested in knowing if there are alternate ways of doing this, other than conventional way of loading data then updating it.

  • Dynamic Table driven menu

    I am trying to to create a menu whose menu item has to be dynamically pulled out from a database table. Right now I am saving all the menu item in a xml file. My code looks like this
    <tr><td class="head" colspan="2" align="center"><br/>Country of Origin</td></tr>
       <tr class="input">
          <td colspan="2"  align="center" class="input">
               <SELECT id="country" name="country">
                 <xsl:for-each select="//country/CodeList/Entry">
    <OPTION class="input">  
    <xsl:attribute name="value">
    <xsl:value-of select="code" />
    </xsl:attribute>
    <xsl:value-of select="name"/>
    </OPTION></xsl:for-each>
                </SELECT>
         </td>
      </tr>Thanks in advance

    Hi,
    an example is shown here:
    http://www.javaworld.com/jw-03-2000/jw-03-xmlsax-p4.html
    Menu is in AWT in this article, not in swing but it can't be so different.
    L.P.

  • Dynamic table driven menus

    Using jsf/adf bc I've been studying the 'dynamic' menu setup in the srdemo and have a decent understanding of how that works in a declarative way. However, that example assumes the menu items and their properties will be 'hard coded' into the faces-config. I have menu items and their properties (label, outcome, etc) stored in a table and I want to get rows from this table and essentially create an object of the MenuItem class for each row in the Menu table. I understand how to do this step programmatically. I'm left wondering then how to create the instance of MenuTreeModelAdapter and add each of these MenuItem instances to it and further how to create the instance of MenuModelAdapter and add the instance of MenuTreeModelAdapter to it?? Will this need to be a totally programmatic thing, or am i going to still be using some of the entries in the faces-config.xml? Thanks for any help on this.

    John, thanks for the reply. I did search first and didn't come up with anything. I took a look at the example from the link you gave me. It didn't provide a lot of help, but I think I've got something I can use for my purposes. My application menu will have two levels, a menu and submenu. Therefore, there exists two db tables to hold info for each menu level. The submenu table rows are children of the menu rows and so are related by fk. In my application, I just created master/detail view objects and link to retrieve all menu items along with their submenu items. I then iterate thru the rows programmatically and populate the menu model that way. Initially, it seems to be working. I'll post that code in case it might help someone else:
    public void buildMenuItems(){
    ViewObjectImpl menuVO = getTopLevelMenu();
    //iterate thru menu records
    menuVO.executeQuery();
    Row menuItemRow = null;
    List menuItemsList = new ArrayList();
    List submenuItemsList = new ArrayList();;
    while(menuVO.hasNext()){
    menuItemRow = menuVO.next();
    //convert the menu row into an instance of a MenuItem object.
    MenuItem menuItem = new MenuItem();
    menuItem.setLabel((String)menuItemRow.getAttribute("MenuLabel"));
    menuItem.setOutcome((String)menuItemRow.getAttribute("NavigationOutcome"));
    menuItem.setViewId((String)menuItemRow.getAttribute("ViewId"));
    RowSet sublevelMenuRows = (RowSet)menuItemRow.getAttribute("SublevelMenus");
    while(sublevelMenuRows.hasNext()){
    Row sublevelMenurow = sublevelMenuRows.next();
    MenuItem sublevelMenuItem = new MenuItem();
    sublevelMenuItem.setLabel((String)sublevelMenurow.getAttribute("SubmenuLabel"));
    sublevelMenuItem.setOutcome((String)sublevelMenurow.getAttribute("NavigationOutcome"));
    sublevelMenuItem.setViewId((String)sublevelMenurow.getAttribute("ViewId"));
    submenuItemsList.add(sublevelMenuItem);
    //if there were any sublevel menu items (children), add them to that menu item instance.
    if(submenuItemsList.size() > 0){
    //i'm basically making a copy of the submenu item list here so i can pass that to the setChildren method
    //of the MenuItem object. Then i'm safe to clear() the original list so it can be used again. Without using
    //a copy of the list to pass in, a subsequent call to clear() on that same list actually removes the children
    //that were just placed into MenuItem from that object.
    List submenuItemsListCopy = new ArrayList(submenuItemsList);
    menuItem.setChildren(submenuItemsListCopy);
    submenuItemsList.clear();
    //add the MenuItem instance to a list.
    menuItemsList.add(menuItem);
    MenuTreeModelAdapter treeModelAdapter = new MenuTreeModelAdapter();
    treeModelAdapter.setListInstance(menuItemsList);
    treeModelAdapter.setChildProperty("children");
    MenuModelAdapter modelAdapter = new MenuModelAdapter();
    modelAdapter.setViewIdProperty("viewId");
    try{
    modelAdapter.setInstance(treeModelAdapter.getModel());
    }catch(IntrospectionException ex){
    //do nothing here...
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("menuModel", modelAdapter);
    }

  • Maintain the users by table-driven

    hi, is it a must to create users under the security managers?
    are there any tricks to load the users list from the database ?
    thanks

    1. Always try to search forum first, I'm sure that everything is already written there:
    can we use two different authenication in the same repository
    2. There is obiee doc., Chapter 15 - Security in Oracle BI (security manager, authentication, etc)
    http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31770.pdf
    3. If you need example to load users from database using external method:
    External table authentication and row-wise initialization in OBIEE
    http://108obiee.blogspot.com/2009/03/external-table-authentication-and-row.html
    Regards
    Goran
    http://108obiee.blogspot.com

  • Which table or combinations of table that stored net book value for asset?

    I need help in finding the above. I need to customize an asset report and need the net book value amount.

    hi Mohamed,
    basically you have to calculate like this:
    + ANLC-KANSW
    + ANLC-KAUFW
    + ANLC-KINVZ
    - ANLC-KNAFA
    - ANLC-KSAFA
    - ANLC-KAAFA
    hope this helps
    ec

Maybe you are looking for

  • All I need is some one-on-one time!

    Hi All No doubt you have all seen my posts lately. I have been teaching myself Captivate for about 30 days (using the free trial) and I love it and can see how it can help my business. My husband and I own a 2-person newsletter service and are wantin

  • After I updated to iOS 5.1, my iPad2 won't rotate anymore.

    I updated to iOS 5.1. the other day, and my iPad2 won't rotate anymore even if the screen is not locked. I went to service center, and after testing the iPad's accelerometer playing some game, the guy at the service center thought that it is not a ha

  • Error occured when connect to MySql Databse in Dreamweaver

    Hello! I met a problem when connect to Mysql Databse in Dreamweaver Details: My Php Environment: Php 5.2.2+ MySql 5.0.4 + IIS 6.0 + DW IDE + WinXP SP2, All necessary sevice started(Actually I have never stopped any Windows service). Php installed (II

  • How can i close a container?

    I am trying to close a container but I can't use dispose() method. When i tried setVisible(boolean), it was messing up the display.

  • Error 16828 when update from native Windows installer

    Dears, I have noticed error 16828 when I tried to update AIR application. Steps to reproduce (AIR 2.5.1): 1. Prepare AIR 2. Prepare Native windows installer (*.exe) 3. Install application from native windows installer 4. Run application updater 5. Do