Date Range Calculations for gaps and overlaps

Oracle version: 11.2.0.3
Platform : Linux
Empno       position    start_dt       end_dt
     1                X            01/01/2008  01/02/2010
     1                Y           01/02/2009  12/31/2012
     1                X           02/01/2012   04/01/2013    
     1                Z           5/01/2012    12/31/2012
     1                Y           05/01/2013  present         
I need to find the exact time period the employee worked for the company in a particular position. The query should be able to calculate the overlap/gaps accordingly
For example in this case the result should be
Empno  position   days    Total_Days
1             x              1156        2943
1             y              1543        2943
1             z               244        2943
Thanks
Kevin

Hi, Kevin,
Assuming you do have overlaps (and depending on what you mean by "overlaps") here's one way to handle them:
WITH got_new_grp AS
   SELECT  empno, position, start_dt
   ,       NVL (end_dt, TRUNC (SYSDATE)) AS end_dt
   ,       CASE
               WHEN  MAX (end_dt)
                         OVER ( PARTITION BY  empno, position
                                ORDER BY      start_dt
                                ROWS BETWEEN  UNBOUNDED PRECEDING
                                     AND      1         PRECEDING
                              ) < start_dt
               THEN  1
               ELSE  0
           END  AS new_grp
    FROM   table_x
--  WHERE  ... -- If you need any filtering, put it here
, got_grp  AS
    SELECT  empno, position, start_dt, end_dt
    ,       SUM (new_grp) OVER ( PARTITION BY  empno, position
                                 ORDER BY      start_dt
                               )  AS grp
    FROM    got_new_grp
SELECT DISTINCT
          empno, position
,         SUM (MAX (end_dt) - MIN (start_dt))
              OVER (PARTITION BY empno, position)   AS days
,         SUM (MAX (end_dt) - MIN (start_dt))
              OVER (PARTITION BY empno)             AS total_days
FROM      got_grp
GROUP BY  empno, position, grp
ORDER BY  position
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out where the statement above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
See the forum FAQ: https://forums.oracle.com/message/9362002

Similar Messages

  • Basic / Scheduling dates are calculated for both main orders and Collective

    How the Basic / Scheduling dates are calculated for both main orders and Collective orders?
    when in master data we have given different value of in house production time for both the orders.

    Hi,
    The basic dates are calculated from the data mentioned in the Material Master - In-house production time days, either lot size dependent or lot size independent.
    The scheduled dates are calculated from the timings maintained in the routing.
    In the configuration for Scheduling parameters for the order type - Adjust scheduling - the dates can be adjusted.
    Kindly revert back if you need any further clarifications.
    Warm regards,
    Umesh Poojari

  • Explain How delivery date is calculated using backward and forward schedul

    How can anyone please explain how delivery date is calculated using forward and backward scheduling
    I want to have it broken down into the following steps
    for eg for delivery date calculation following dates are used
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Can some one please give me an example and explain wht these dates are
    for eg customer needs delivery date on  11/20/2008
    how would the system cacluate whether it can meet the delivery date using backward scheduling
    and if it doesnt meet how does the system do the forward scheduling
    also i am not clear with the following dates
    material avaialibilty date
    material staging date
    transportation date
    can some one please explain me all this in detail
    Thanks

    Hi,
    Basically this is the CRSD(Customer requested ship date logic)logic in which system calculates the ship date depends upon the material availability. If material is available system calculates ship date on the basis of master data maintained in customisation.Master data is maintained in the  following link.
    If material is not available then system takes into consideration vendor delivery date & then calculate customer ship date.
    Please go through the link in SPRO
    LE-Shipping -Basic shipping functions-Scheduling -Delivery scheduling & Transportation scheduling-Maintain duration.
    In customisation following data is maintained
    Material Availabilty Date
    Material Staging Date
    Pick/pack time
    Transportation PLanning date
    Loading date
    Goods issue date
    Transit Date
    Delivery Date
    Hope you got the idea of CRSD calculation
    Regards,
    Prashant.

  • IW31/32- Change Date Restriction choices for "StartPoint" and "End"

    Hello,
    In IW31/32> Operation tab> then "Dates" screen.
    Is there a way to change Date Restriction choices for "StartPoint" and "End."
    Start Point: there are 4 choices: Must Start on, Cannot start before, cannot start after, start from resource planning
    End: Must finish on, Cannot finish before, finish not later, finish from confirmation.
    We want to limit the choice to 2 optiions on Start and End/ in addtion change the text.
    Is this possible.
    Thanks,

    Hi,
      No its not possible  to accomplish this in standard using configuration functionality.
    You may able to accomplish restricting the values on the drop down through the implicit enhancement functionality available in ECC 6.0.
    You will have to make  a screen modification to make the associated start point/ end point key text editable.
    Regards
    Narasimhan

  • Neen help with date range searches for Table Sources

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 24-MAR-07, 22-SEP-), 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Need help with date range searches for Table Sources in SES

    Hi all,
    I need help, please. I am trying to satisfy a Level 1 client requirement for the ability to search for records in crawled table sources by a date and/or date range. I have performed the following steps, and did not get accurate results from Advanced searching for date. Please help me understand what I am doing wrong, and/or if there is a way to define a date search attribute without creating a LOV for a date column. (My tables have 500,00 rows.)
    I am using SES 10.1.8.3 on Windows 32.
    My Oracle 10g Spatial Table is called REPORTS and this table has the following columns:
    TRACKNUM Varchar2
    TITLE Varchar2
    SUMMARY CLOB
    SYMBOLCODE Varchar2
    Timestamp Date
    OBSDATE Date
    GEOM SDO_GEOMETRY
    I set up the REPORTS table source in SES, using TRACKNUM as the Primary Key (unique and not null), and SUMMARY as the CONTENT Column. In the Table Column Mappings I defined TITLE as String and TITLE.
    Under Global Settings > Search Attributes I defined a new Search Attribute (type Date) called DATE OCCURRED (DD-MON-YY).
    Went back to REPORTS source previously defined and added a new Table Column Mapping - mapping OBSDATE to the newly defined DATE OCCURRED (DD-MON-YY) search attribute.
    I then modified the Schedule for the REPORTS source Crawler Policy to “Process All Documents”.
    Schedule crawls and indexes entire REPORTS table.
    In SES Advanced Search page, I enter my search keyword, select Specific Source Group as REPORTS, select All Match, and used the pick list to select the DATE OCCURRED (DD-MON-YY) Attribute Name, operator of Greater than equal, and entered the Value 01-JAN-07. Then the second attribute name of DATE_OCCURRED (DD-MON-YY), less than equals, 10-JAN-07.
    Search results gave me 38,000 documents, and the first 25 I looked at had dates NOT within the 01-JAN-07 / 10-JAN-07 range. (e.g. OBSDATE= 10-MAR-07, 22-SEP-07, 02-FEB-08, etc.)
    And, none of the results I opened had ANY dates within the SUMMARY CLOB…in case that’s what was being found in the search.
    Can someone help me figure out how to allow my client to search for specific dated records in a db table using a single column for the date? This is a major requirement and they are anxiously awaiting my solution.
    Thanks very much, in advance….

    raford,
    Thanks very much for your reply. However, from what I've read in the SES Admin Document is that (I think) the date format DD/MM/YYYY pertains only to searches on "file system" sources (e.g. Word, Excel, Powerpoint, PDF, etc.). We have 3 file system sources among our 25 total sources. The remaining 22 sources are all TABLE or DATABASE sources. The DBA here has done a great job getting the data standardized using the typical/default Oracle DATE type format in our TABLE sources (DD-MON-YY). Our tables have anywhere from 1500 rows to 2 million rows.
    I tested your theory that the dates we are entering are being changed to Strings behind the scenes and on the Advanced Page, searched for results using OBSDATE equals 01/02/2007 in an attempt to find data that I know for certain to be in the mapped OBSDATE table column as 01-FEB-07. My result set contained data that had an OBSDATE of 03-MAR-07 and none containing 01-FEB-07.
    Here is the big issue...in order for my client to fulfill his primary mission, one of the top 5 requirements is that he/she be able to find specific table rows that are contain a specific date or range of dates.
    thanks very much!

  • Date Span - Validation for start and end date parameters in Crystal reports

    Hi,
    I am new here and am unsure if this is the right place to post this issue. If so, I apologize for that.
    I am working on Crystal Reports 12 and don't know if it is possible; to validate the parameters - Start Date and End Date are within a specific span of time. For Eg. Start Date and End Date should be within 6 months or Start Date should be a future date.
    Can we prompt that parameters entered are invalid and have users re-enter it?
    I will really appreciate any help into this issue.
    Thanks Much,
    RP

    Hi,
    Well, it is not possible to validate the date/datetime values in the prompt window, however there are other alternatives.
    One of them is to create an Alert with the condition:
    datediff("m",Minimum({?DateParameter}),Maximum({?DateParameter})) > 6
    //This is to check if the start date and the end date are within 6 months
    Another way of doing this is by displaying a message on the Report Header and suppressing all other sections if the date range values do not meet the condition.
    Hope this helps!
    -Abhilash

  • Date range mapping for dimension

      
    Hi Guys,
    I am looking for a way where I can provide DATE as a range for dimension , Any such possibilities anyone is aware of ?? Please suggest
    For string or number I have used something like 
    Country
    A - B
    C - D
    etc
    Salary
    10000$ - 50000$
    51000$ - 99000$
    etc
    What I want now is something similar for dates
    Date
    This Week
    This Month
    etc
    Please suggest
    Thanks In Advance
      

    The pattern here is to convert the dates to numerics.
    For example, your record could have as properties in YYYYMMDD format and be configured for filtering:
    p_start_date = 20140325
    At run time, you take the date as entered from the UX and convert it to YYYYMMDD format and create your filter for dates between Jan 1, 2014 and March 31, 2014:
    Nf=p_start_date|BTWN+20140101+20140331

  • Dynamic date range creation for WebI query

    Hi
    I have a webi query where I need to provide a date range as selection.  But the from date will be based on number of days that user will provide during query execution. For e.g. user will give no of days as 10 so the date range need to be created as  (system date -10) to (system date).
    I am not sure how to provide the option for user to input no of days and then calculate the date range.
    Could you please help me here.
    Regards,
    Amit

    Amit.
    it can be done but by creating multiple objects.
    create Obj1: @prompt("Enter Number Of days",N,Mono,etc..) and capture the number of days in it.
    Create your second object infact a filter object: Obj2: Sysdate
    Third Object(filter) Obj3:  (Sysdate-(@select(class\Obj1)))
    give the between condition in webi using these two objects
    between Obj2 and Obj3

  • Function module find date Range input for scheduling a job

    hi i have created a program for scheduling a back ground job for  purchase order extract in that i have to get the last 7 days records when i schedule it on every sunday can any one tell me the function module which satisfies the requirment
    Date Range input in my program to be calculated for past 7 days from current date (ie from Sunday to Saturday of the week.)

    Hi,
    You can do it simply by
           v_cdate TYPE sy-datum,    " current system date
           v_cdate = sy-datum - 7.         " take date 7 days before current date
    Pass this  v_cdate in your logic
    Hope it will help you.
    Thanks
    Arun Kayal

  • Oracle data guard configuration for primary and standby db_name

    I am working on configuring an active data guard for one primary DB and one standby DB. I have a few questions:
    1. Can I use different db_name, db_unique_name and instance_name for primary and standby. For example: primary(db_name, db_unique_name and instance_name)=chicago. When I create standby DB with Rman backup and copy of pfile and control file from primary DB or use Grid control to create standby database. Oracle document or Grid control all keep standby db_name=chicago. Only make standby db_unique_name and instance_name=boston. Due to my application system condition, I want to make db_name=boston, not keep it as the same as primary=chicago. Is this valid configuration?
    2. In primary datafiles, application system generate datafile name like this: hr_chicago_01.dbf, fn_chicago_01.dbf. When I move datafiles to standby server, if I plan to use db_name=boston for standby DB, can I rename datafiles as
    hr_boston_01.dbf, fn_boston_01.dbf? In this way, datafile name match up with db_name. but I will create standby log group and members on primary and standby identically. If in future switching over, DB will not have problems.
    3. If I don't use primary DB backup. Instead, I copy all datafiles, redo_log files (no control files) to standby. Then "alter database backup controlfile to trace" from promary and also " create pfile='/xxx/initSTANDBY.ora' from primary. Then modify init.ora and controlfile. Then run control.sql to bring standby DB up. After that, configure redo log shipping and apply with data guard or SQL. Is this a acceptable way to create physical standby DB?
    Please advise your comments. Thanks in advance.

    I want to make db_name=boston, not keep it as the same as primary=chicago. Is this valid configuration?NO. DB_NAME must be the same ("chicago") at both sites. The Standby will be using a different DB_UNIQUE_NAME (e.g. "boston") and can be using a different Instance name / SID (e.g. "boston").
    can I rename datafiles Yes. The database file names can be changed.
    If I don't use primary DB backup. Instead, I copy all datafiles, redo_log files (no control files) to standbyWhat is the difference between the first sentence (a backup of the primary) and the second sentence (a copy of the primary) ? A Copy is a backup.
    Are you intending to differentiate between an RMAN Backup and a User-Managed (aka "scripted") backup ?
    Normally, for DataGuard, tou can use non-RMAN methods to copy the database but there's no value add in this.
    You'd still have to setup DataGuard ! (and I wonder if you'd have complications setting up Active DataGuard).
    But remember that you MUST create the Standby controlfile from the Primary and copy it over to your Standby -- particularly as you are planning to use DataGuard. This is not created by 'alter database backup controlfile to trace' , but by 'ALTER DATABASE CREATE STANDBY CONTROLFILE AS 'filename''
    Hemant K Chitale

  • How to calculate a week & Month in given date range (not for sele-options)

    Hi ,
      I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS).  Now i want ot display week nos & monts in output.
          Ex: date1: 20080101 & date2: 20080229. then
                    weeks : 1, 2, 3,---9.
                    months: jan-08, feb-08.
    Plz help me with block of code or any FM.
    Regards,

    Hi Srikanth,
            The FM HR_99S_INTERVAL_BETWEEN_DATES   is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
           But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
    Plz help me on this.
    -Regards.

  • ACI  - Date Range issue for Sales Details report

    I am working on ACI setup for one of my client. I set everything us as per documentation.
    This is regarding ‘Sales Details’ (Public Folders > ATG > Commerce > Sales > All Sales) report.
    Report is being generated if I select ‘Date Range’ under ‘Time Period’; but if I select ‘Predefined’ I get below errors:
    RQP-DEF-0177
    An error occurred while performing operation 'sqlPrepareWithOptions' status='-9'.
    UDA-SQL-0107 A general exception has occurred during the operation "prepare".ORA-32035: unreferenced query name defined in WITH clause RSV-SRV-0042 Trace back:RSReportService.cpp(758): QFException: CCL_CAUGHT: RSReportService::process()RSReportServiceMethod.cpp(239): QFException: CCL_RETHROW: RSReportServiceMethod::process(): promptPagingForward_RequestRSASyncExecutionThread.cpp(774): QFException: RSASyncExecutionThread::checkExceptionRSASyncExecutionThread.cpp(211): QFException: CCL_CAUGHT: RSASyncExecutionThread::run(): promptPagingForward_RequestRSASyncExecutionThread.cpp(824): QFException: CCL_RETHROW: RSASyncExecutionThread::processCommand(): promptPagingForward_RequestExecution/RSRenderExecution.cpp(593):
    Has anybody come across this issue?
    Any help in this regard will be highly appreciated.
    Thanks,
    Mukesh

    Contact Oracle support. I think we've seen this one before if using a particular version of Oracle(11.1?). There's a particular version of Oracle that doesn't support queries in a WITH clause that aren't referenced in the main query. Cognos seems to generate these types of queries not knowing that the version of Oracle doesn't support it. According or Support Article ID 1063400.1 you can patch this particular problem with Oracle or you can upgrade to Oracle 11.2. I also think that was a to get Cognos to generate an alternative query that doesn't use the WITH clause at all. Something about disabling the use of WITH in all queries by making a change to the report definition or alternatively a global change to the metadata model.
    Good luck...
    Andrew

  • Read data from MDM For Lookup and Flat table using MDM ABAP API

    Hi,
    I have requriment to read data from MDM from FLAT and Lookup table using MDM ABAP API. My design  is like this ,
    I have one ITEMS (Main table in MDM) and inside that i have one Lookup flat table ITEM_TYPE , my requriment is to read Item number and its related Item type.
    From ABAP.
    Please help if any body has any idea.
    Regards,
    Shyam

    HI Guys,
    I found my solution by myself. Below is the solution , hope this will help others:-
    Retrieve data from MDM  using MDM ABAP API.
    Step- 1. Create structure in SAP with the same name as that of MDM field code for MDM Main table.
    Step-2. Create another structure in SAP having all  lookup fields of MDM , fieldname in ECC must be same as that of MDM field
    code.
    Step-3.Create structure in SAP for  individual lookup field(Single Field only)   with the same name as MDM Field code.
    Step-4.
    DATA: IT_QUERY            TYPE STANDARD TABLE OF MDM_QUERY,  "MDM_QUERY_TABLE,
          WA_QUERY            TYPE  MDM_QUERY,
          WA_CDT_TEXT         TYPE  MDM_CDT_TEXT,
          IT_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT_TABLE,
          WA_RESULT_SET_KEY   TYPE  MDM_SEARCH_RESULT,
          WA_STRING           TYPE  STRING.
    DATA:<Internal table> TYPE STANDARD TABLE OF <SAP Str Having all LOOKup Fields>    
    DATA: :<Internal table>TYPE STANDARD TABLE OF <SAP Str one LOOKup field>,
         <Workarea> LIKE LINE OF :<Internal table>.
    *PASS LOGICAL OBJECT NAME.
    V_LOG_OBJECT_NAME = 'Logical object name defined in Customization'.
    Define logon language, country & region for server
    WA_LANGUAGE-LANGUAGE = 'eng'.
    WA_LANGUAGE-COUNTRY = 'US'.
    WA_LANGUAGE-REGION = 'USA'.
    TRY.
        CREATE OBJECT LR_API
          EXPORTING
            IV_LOG_OBJECT_NAME = V_LOG_OBJECT_NAME.
    ENDTRY.
    CONNECT to repository. Apply particular logon language info
    CALL METHOD LR_API->MO_ACCESSOR->CONNECT
      EXPORTING
        IS_REPOSITORY_LANGUAGE = WA_LANGUAGE.
    *NOW PASS ITEM NO AND GET KEY FROM MDM.
    CLEAR WA_QUERY.
    WA_QUERY-PARAMETER_CODE  = <MDM FIELD CODE>. "Field code
    WA_QUERY-OPERATOR        = 'EQ'. "Contains
    WA_QUERY-DIMENSION_TYPE  = 1. "Field search
    WA_QUERY-CONSTRAINT_TYPE = 8. "Text search
    WA_STRING                = <Field Value>.
    GET REFERENCE OF WA_STRING INTO WA_QUERY-VALUE_LOW.
    APPEND WA_QUERY TO IT_QUERY.
    CLEAR WA_QUERY.
    *PASS ITEM NUMBER AND GET RELATED KEY FROM MDM.
    TRY.
        CALL METHOD LR_API->MO_CORE_SERVICE->QUERY
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Main Table>
            IT_QUERY            = IT_QUERY
          IMPORTING
            ET_RESULT_SET       = IT_RESULT_SET_KEY.
      CATCH CX_MDM_COMMUNICATION_FAILURE .
      CATCH CX_MDM_KERNEL .
      CATCH CX_MDM_NOT_SUPPORTED .
      CATCH CX_MDM_USAGE_ERROR .
      CATCH CX_MDM_PROVIDER .
      CATCH CX_MDM_SERVER_RC_CODE .
    ENDTRY.
    Pass record id into keys.
    LOOP AT IT_RESULT_SET_KEY INTO WA_RESULT_SET_KEY.
      WA_KEYS = WA_RESULT_SET_KEY-RECORD_IDS.
    ENDLOOP.
    WA_RESULT_SET_DEFINITION-FIELD_NAME = <Look field name>.
    APPEND WA_RESULT_SET_DEFINITION TO IT_RESULT_SET_DEFINITION.
    CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE
      EXPORTING
        IV_OBJECT_TYPE_CODE      = <MDM Main Table>
        IT_RESULT_SET_DEFINITION = IT_RESULT_SET_DEFINITION
        IT_KEYS                  = WA_KEYS
      IMPORTING
        ET_RESULT_SET            = IT_RESULT_SET.
    LOOP AT IT_RESULT_SET INTO
            WA_RESULT_SET.
    *PASS KEYS INTO MAIN TABLE TO GET Structure for FALT or Look up Table
      TRY.
          CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
            EXPORTING
              IV_OBJECT_TYPE_CODE = <MDM Main Table>
              IT_KEYS             = WA_KEYS
            IMPORTING
              ET_DDIC_STRUCTURE =<SAP Strct having all Look up fileds of MDM>         
      ENDTRY.
      LOOP AT <SAP Strct having all Look up fileds of MDM> INTO <Work area>.
        CLEAR WA_KEYS.
        APPEND <Work area>-field name TO WA_KEYS.
        CALL METHOD LR_API->MO_CORE_SERVICE->RETRIEVE_SIMPLE
          EXPORTING
            IV_OBJECT_TYPE_CODE = <MDM Lookup table name>
            IT_KEYS             = WA_KEYS
          IMPORTING
            ET_DDIC_STRUCTURE   = <Single Structure in SAP For Lookup field>.
        READ TABLE <Single Structure in SAP For Lookup field>. INTO <Work Area> INDEX 1.
    Here you can get the value of realted lookup fields associated with main table data.
      ENDLOOP.
    ENDLOOP.
    LR_API->MO_ACCESSOR->DISCONNECT( ).
    Edited by: Shyam Babu Sah on Nov 24, 2009 4:52 AM

  • Ranges declaration for integers "and" characters

    Hi All...
    Is there any way in which we can declare a ranges variable for both integers and characters???
    I want the ranges variable to check in between 10 to 13 and 30 to 33 and A to E.
    I tried as ranges BT 'A' and 'E'. That is, it should only accept values in [A B C D E].
    But the problem is, it is accepting the value [BETER] also.
    How can this be solved.

    That is fine. But the declaration occupies more space than actual code. Readability also counts!
    Any other suggestions?
    Thank u Vivek.

Maybe you are looking for

  • Batch master record not created automatically during Goods Receive

    Hi, When Goods Receipt is performed in central ERP, the batch master records will be auto created. However, if we turn on the decentralize warehouse management functionality, we observed that the batch master records are no longer be auto created dur

  • Customisation setting for PR creation with and without commitment both

    Hi We already have certain PR document types which are manually created with a/c assignment 'P' quoting a particular WBS in P.R. Now these P.R do not create any commitment as per the customization done by (I guess) MM/ FI person. Can u please tell me

  • Simulation and Testing my results

    The attached file is supposed to receive 3 signals from the microcontroller via serial communication in the format sig1sig2sig3 Is there a way I could simulate and test the file without connecting it to the hardware??? Attachments: UpdatedDisplay.vi

  • Power Button Problems

    within the past few weeks, the manual on/off button does neither.  i can program it to turn off and them back on at certain times.  but if i need to use it before it is programmed to come on, the button won't work.  i can take out the battery and whe

  • I can't get in my ipod5

    I bought this ipod 5 from a friend who had it given to him from another friend who I will refer to as Sam. Sam thought it would be funny to give the guy I bought it from (Joe) an unusable ipod by assigning it to his apple id and wiping all the info f