Query to pick up people of retirement age 1 year in advance

Hi,
I wrote the below query to pick up all staff who will be of retirement age in a year's time. This will be used in an alert that must go to payroll 1 year before retirement date, then 6 months before retirement date and then finally 1 month before retirement date.
select distinct papf.employee_number
, papf.full_name
, apps.meds_hr_util_pkg.return_department(papf.person_id) org
, papf.date_of_birth
, (select payroll_name from pay_all_payrolls_f where payroll_id = paaf.payroll_id) payroll_name
, (select first_name||' '||last_name from per_all_people_f where person_id = paaf.supervisor_id and trunc(sysdate) between effective_start_date and effective_end_date) mgr
, (select email_address from per_all_people_f where person_id = paaf.supervisor_id and trunc(sysdate) between effective_start_date and effective_end_date) mgr_email
, add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12) date_12month_advance
, add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-6) date_6month_advance
, add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-1) date_1month_advance
, trunc(months_between(add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12),papf.date_of_birth)/12) age_12mon
--into &emp_no, &emp_name, &org, &date_of_birth, &payroll_name, &mgr, &mgr_email, &retirement_date     
from per_all_people_f papf
,per_all_assignments_f paaf
,per_person_type_usages_f pptuf
,per_person_types ppt
where papf.person_id = paaf.person_id
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
and paaf.primary_flag = 'Y'
and paaf.assignment_type = 'E'
and papf.person_id = pptuf.person_id
and pptuf.person_type_id = ppt.person_type_id
and trunc(sysdate) between pptuf.effective_start_date and pptuf.effective_end_date
and ppt.system_person_type = 'EMP'
and ppt.user_person_type != 'Pensioners'
and trunc(months_between(add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') )
||to_char(sysdate, '-YYYY')),-12),papf.date_of_birth)/12) >= 62
and trunc(sysdate) in (add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-12)
, add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-6)
, add_months(to_date(DECODE(to_char(papf.date_of_birth, 'DD-MON'), '29-FEB', '28-FEB', to_char(papf.date_of_birth, 'DD-MON') ) ||to_char(sysdate, '-YYYY')),-1)
and to_char(papf.date_of_birth, 'DD-MON') != '29-FEB'
order by 1
The query works only when I have this line in
" and to_char(papf.date_of_birth, 'DD-MON') != '29-FEB' "
As soon as I remove it I get an ORA-01847: day of month must be between 1 and last day of month error. I can't seem to figure out why because there is 1 person with a birth date of 29-FEB and I am catering for this in the query. Also, I am using TO_DATE for the values so using add_months and months_between should not be an issue.
Please help....maybe someone else can see something I am missing...
Thanks
Shalantha

Hi,
To find people who are 65 years old (or older) as of today, you can simply say
WHERE     date_of_birth <= ADD_MONTHS ( SYSDATE
                                   , -12 * 65
                            )ADD_MONTHS knows how to adjust for leap years, but it may not adjust for them the way you expect.
If today is February 28, 2013, the condition above will include people born on Februry 29, 1948. That's actually 1 day before they reach 65. If that's a problem, the solution is slightly more complicated.
If today is March 1, 2013, it will include people born on Februry 29, 1948.
If today is February 29, 2012 (or February 28, 2012) it will include people born on February 28, 1947, but not people born on March 1, 1947.
To find people who will be 65 years old (or over) 3 months from today:
WHERE     date_of_birth <= ADD_MONTHS ( SYSDATE
                                   , (-12 * 65) + 3
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data. Simplify the problem as much as possible.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.
Edited by: Frank Kulash on May 26, 2011 11:48 AM

Similar Messages

  • Need query help regarding employee retirement age.

    Need query to find employee retirement age 2years in advance.

    You can use per_all_people_f table.
    something like this :-
    SELECT PAPF.employee_number,
    PAPF.date_of_birth,
    (MONTHS_BETWEEN(SYSDATE,PAPF.date_of_birth) / 12)+2 RETIREMENT_AGE_FIGURE
    FROM per_all_people_f PAPF
    WHERE TRUNC (SYSDATE) BETWEEN PAPF.effective_Start_date AND PAPF.effective_end_date
    AND (MONTHS_BETWEEN(SYSDATE,date_of_birth) / 12)+2 >=65 /* ASSUMING 65 IS RETIREMENT AGE HERE*/
    In case if you only want to pick Employee data then use below sample query and modify according to your requirement :-
    SELECT PAPF.employee_number,
    PAPF.date_of_birth,
    ((MONTHS_BETWEEN(SYSDATE,PAPF.date_of_birth) / 12)+2) RETIREMENT_AGE_FIGURE,
    PPT.system_person_type,
    PPT.user_person_type
    FROM per_all_people_f PAPF,
    per_person_types PPT,
    per_person_type_usages_f PPTUF
    WHERE TRUNC (SYSDATE) BETWEEN PAPF.effective_Start_date AND PAPF.effective_end_date
    AND ((MONTHS_BETWEEN(SYSDATE,date_of_birth) / 12)+2) >=65
    AND PPTUF.person_id = PAPF.person_id
    AND PPT.person_type_id = PPTUF.person_type_id
    AND PPT.system_person_type = 'EMP'
    AND TRUNC (SYSDATE) BETWEEN PPTUF.effective_Start_date AND PPTUF.effective_end_date
    Edited by: VISHAL DANGI on Jul 8, 2012 10:30 PM

  • I see people from different ages at my work and every month I need to count how many people from each age I've seen that month. How can I do to give the entries to numbers in a single cell and make numbers count them for me?

    I see people from different ages at my work and every month I need to count how many people from each age I've seen that month. How can I do to give the entries to numbers in a single cell and make numbers count them for me? The final result would be a spreadsheet telling there were 8 people from 20 to 39 years old, 14 peolple from 40 to 59 and so on...

    jpqcampos wrote:
    This appears to be an 'input form' using 'Radio Buttons' to select the category. Neither of these features are supported in Numbers '09.
    You can input the data on one table and summarize it on a second table, but the input table will continue to hold data for each event.
    And by using the Reorganize button, you can hide all but two rows of that table to approximate the appearance and performance of an input form.
    Here are the two tables, Data on the left and Summary on the right. Notes below.
    The grey-filled columns in both tables are 'working' columns, and may be hidden (as shown in the image below).
    Data table:
    D1 contains the word "TRUE" (in capital letters). (This row is always shown.)
    D2 is empty, or may contain any value except "TRUE" (This row is always hidden under the Reorganize rule.)The rest of Row 2 of this table requires the data shown: a number outside the range to be counted (999), and two checkboxes, both checked.
    D3 (and filled down the rest of column D):   =AND(OR(B2,C2),NOT(OR(B3,C3)))
    The formula returns TRUE only for the first unused row in the table (ie. the first row for which neither checkbox has been checked)
    Summary table:
    Column A contains labels for the age ranges to be counted.
    Column B contains the same information in the form necessary for the formulas in columns C and D. They need a numeric value, and that value must be the largest acceptable value in the range to be counted.
    C2 (and filled right to column D, then both filled down to row 5):
        =COUNTIFS(Data :: $A,"<="&$B,Data :: B,TRUE)-SUM(C$1:C1)
    Two changes from the previous example:
    COUNTIFS is used to separate the Native and Foreign counts as well as the age range to be counted.
    The amount subtracted from each result is the SUM of the earlier results, and includes the text value in the first cell of the column (which is interpreted by SUM as a zero).
    See note below regarding my earlier formula.
    When the greyed columns are hidden and the checkbox in the Reorganize pane is checked, the two tables will appear as shown below:
    Close the reorganize pane, and the 'data entry form' is ready to use.
    To use, enter the age first, then check one of the boxes.
    As soon as one box is checked, the row will be hidden, and the next (unused) row will be shown.
    Regards,
    Barry
    Note regarding formula in my earlier post:
    The earlier formula will give erroneous results as it subtracts only the count directly above it from its count of persons in the age range 0-n.
    In E2 of that table, replace "-E1" with "-SUM(E1:E$1)
    Fill down to E8.
    Ignore the instructions (in that post) following "Fill down to E8."
    B

  • Automatic reminder of the retirement age,brithday, pass probation on SAP-HR

    Hi all,
    My client want automatic reminder of the retirement age,brithday, pass probation, contract end, . . . on the sreen and automatic send the email to HR officer.
    But I don't know how to do this, please help me solve my problem by step by step or show me the document about this.
    Thanks for all your answers,
    Huyen Nguyen

    Hi,
      For Retire ment date:
    Monitoring of task Z1 Retirement date should be configured:
    V_T531
    Feature to be configured:M0001
        Infotype(0002)
                IDTXT MAIL_FOR_I0002_A
                RECV1 X
                RECV2 X
                RECV3 X
                SUBTY Z1
                OUTBX X
                DISTR
                NAME1 RCIEV
                NAME2 RCNEW
                NAME3 RCOLD
                TCODE
                PAINF
                PASUB
                PABEG
                PAEND
                PAFCD
    Code for Dynamic actions:
    0002              GBDAT     06     1     I     INS,0019,Z1,,
    0002              GBDAT     06     2     W     P0019-TERMN=P0002-GBDAT
    0002              GBDAT     06     10     M     M0001
    Note:
    if you mark X in RECV 1 then it will trigger mail to HR once you change the date of birth in It2.
    RECV is for Payroll Adin.
    SAP or email should be mapped in T526 Table.
    Do change the Std to your custom letter for change in It0002 tcode:SO10 id type:PAMA
    and map in the feature m0001 field IDTXT
    Regards,
    Nachy
    Edited by: Nachy on Feb 18, 2009 5:56 AM

  • It won't let me into I message. I type in my ID then I pick what people can text me by then I press next and it goes back to the sign in page so I tried it again and it just kept doing that so it won't let me into iMessage? Please help!

    It won't let me into I message. I type in my ID then I pick what people can text me by then I press next and it goes back to the sign in page so I tried it again and it just kept doing that so it won't let me into iMessage? Please help!

    Try:
    iOS: Troubleshooting FaceTime and iMessage activation

  • Query to pick only first value/day

    I have a table with Account, Complaint and Date columns. Each Account can log multiple complaints each day.
    Now i need a query to pick only the first complaint in a day from each account. If the same account logged in a complaint next day or any day after i want to show that as well.
    Help me with your ideas. Thanks in advance for your help.

    Maybe
    with
    first_complaints as
    (select account,
            date
       from (select account,
                    date,
                    row_number() over (partition by account order by date) rn
               from a_table
      where rn = 1
    select account,
           complaint,
           date
      from a_table t
    where account in (select account
                         from first_complaints
       and date >= (select date
                      from first_complaints
                     where account = t.account
    Regards
    Etbin
    Message was edited by: Etbin
    rereading: If the same account logged in a complaint next day or any day after i want to show that as well.
    The query above is just select * from a_table
    Now:
    if you want to show just the first complaints in a day for any following date, John answered that already (it's just the first_complaints of mine)
    if you want to show all the complaints in any following date, you have to exclude all the complaints logged the first day except the first one
    select account,
           complaint,
           date
      from (select account,
                   complaint,
                   date,
                   row_number() over (partition by account order by date) rn
              from a_table
           ) t
    where date != (select min(date)
                      from a_table
                     where account = t.account
       or rn = 1

  • Ageing analysis for advances received from customer

    Hello All,
    Please can anyone provide inputs on whether there are any standard reports in SAP that can provide ageing analysis of advances received from customer (posted using special GL indicators).
    Thnx in advance.
    Regards,
    Sudeep

    Hi,
    In Report S_ALR_87012168 you get which are due and which are not due (you can see per Special GL Indicator wise also)
    If you think this will not suffice your requirement (like you would like to see 1-30 days, 31-60 days and so on)
    I would suggest
    You create a form in FDI4 - refer FDI5 and FDI6 for standard forms (you can even write own formulas)
    Assign the form to report in FDI1 - refer FDI2 and FDI3 for standard reports.
    Hope this will help you.
    Regards,
    Ravi

  • ABAP-HR MODULE(HOW TO CALCULATE AGE & YEARS OF SERVICE)

    HI,
    HOW TO CALCULATE AGE & YEARS OF SERVICE means for example
    I AM USING PNPCE LDB.
    (1) whose age is greater than 52.833 years with 7.833 years of service, with annual rate of pay $170,000 or more, or
    (2) age plus employment service is 65 or more, with annual rate of pay of $ 170,000 or more.
    Note that the $ 170,000 parameter would be a variable that could change annually when this report would be generated. In the past, age and service value were determined as of the run date. The determination date would also be a variable that would change when the report would be generated.
    Thanks&Regards
    Rahul.

    Hi Rahul,
    This is the 2nd warning !!! Please... use the correct or most appropriate forum.
    The ABAP Objects Forum should be used for: ABAP Object definition and implementation including encapsulation, interfaces and inheritance in ABAP Objects.
    This thread will be moved from to .
    You're asking this question in two thread, so the duplicated thread will be deleted.
    Please have a look at [Forum Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting.
    Also read this thread Welcome and Rules of Engagement.
    Greetings,
    Marcelo Ramos

  • Commission Query not picking up payment on Account linked later

    Hi Experts,
    I created a query for a Client who need to pay Sales Commission to Sales Employees. This report must show only the Invoices that was Paid.
    The Query works fine, exept that it will not pick up the following Payments: When they makie a Incoming Payment on Account and then later link it to an Invoice via the Internal Reconciliation screen.
    SELECT T0.[DocNum] AS 'Incoming Payment', T0.[DocDate] AS ' Incoming Payment Date', T0.[CardCode], T0.[CardName],  T3.[SlpName], T3.[Commission], T1.[DocNum] AS 'Invoice Number', T2.[OpenSum] AS 'Invoice Line Amounts', T2.[OpenSum] * T3.[Commission] / 100 AS 'Commission Amount'
    FROM ORCT T0  INNER JOIN OINV T1 ON T0.DocEntry = T1.ReceiptNum INNER JOIN INV1 T2 ON T1.DocEntry = T2.DocEntry INNER JOIN OSLP T3 ON T1.SlpCode = T3.SlpCode
    WHERE T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    How can I get these Invoices that was linked to a Payment to also show in this query?
    Thanks,
    Marli

    I know that this is an old post, but in case someone else wants to use this code I wanted to point out that this code assumes that only invoices are included in payments.  If other types such as deposits or credits are included in the payment, then you will get the wrong results.
    Need to change the link to OINV slightly to check the document type for Invoices
    JOIN
    OINV T1 ON T1.DocEntry = T4.DocEntry AND T4.InvType = 13 -- AR Invoice Hdr
    Then need to do this same for the other possible document types.

  • Need a query to pick an attachment and mail

    can any one please send me a query or guide me to build one which will pick the file( with the file name it need to find the email_address) and then it need to shoot the email to corresponding customer.
    need it as its a immediate problem
    Thanking you,
    With regards,
    Rahul.

    want to make all note..
    i already used UTL_SMTP PACKAGE BUT IT DEOSNT ALLOW ME TO MAIL ME ATTACHMENT.
    Thanking you,
    With regards,
    Vinod.

  • Own query in Pick and Pack Manager ?

    Hi,
    is it possible to manipulate the pick and pack manager?
    I need 2 more criterias in the selection criteria of the pick and pack manager. In due to that i want to display my own query in the open order table.
    What about pick list objects ? How does it works ? Is there an example of it ?
    thanks
    Markus

    Markus,
    The PickLists Object is available in the SAP Business One 2005 SDK release of the DI API.  You can download the 2005A release of the product and SDK (which is an option during the product install) from the service.sap.com/smb website under Installations & Updates.  You need to be licensed for the development version of the Business One SDK to use the 2005A version of the SDK.
    Hope this helps,
    Eddy

  • Query not picking up Cache

    Guys
    I am probably misunderstanding but would appreciate some explaination.
    I have run an OLAP Cache pre-populate Bex Broadcast, which sets up (as I can see in RSRCACHE) a cache setting of:
    Fixed Forecast EQ 01.07.2014
    Calendar Week EQ 01.2014
    Calendar Week EQ 02.2014
    Material Group EQ 182
    Material Group EQ 183
    Material Group EQ 184
    So as you can see the OLAP Cache populate variant sets up 2 weeks in  alist, and 3 Material Groups in a list.
    I then manually run the same query with the following selection:
    Fixed Forecast = 01.07.2014
    Calendar Week = 01.2014
    Material Group = 182
    I expected this to use the cache I had populated, but it appears it didn't because I now have a new setting showing in RSRCACHE:
    Fixed Forecast EQ 01.07.2014
    Calendar Week EQ 01.2014
    Material Group EQ 182
    Effectively this new cache is a full subset of the pre-populate cache I initially setup.
    I want to pre-populate cache for a range of selection that the customer typically does, but there are far too may Week/Material combinations to set each one up individually. Am I setting something wrong?
    I also tried the initial cache pre-populate as a range rather than a list, and saw the same behaviour (the only difference being the initial cache used a BT rather than 2 EQ lines.
    By the way, globally and for InfoProvider we are set as Cache Mode=1, but this specific uery is using cache mode 4 (this is a test as we are multiple application server environment)
    Regards
    Simon

    I know that this is an old post, but in case someone else wants to use this code I wanted to point out that this code assumes that only invoices are included in payments.  If other types such as deposits or credits are included in the payment, then you will get the wrong results.
    Need to change the link to OINV slightly to check the document type for Invoices
    JOIN
    OINV T1 ON T1.DocEntry = T4.DocEntry AND T4.InvType = 13 -- AR Invoice Hdr
    Then need to do this same for the other possible document types.

  • OBIEE Issue - Physical Query not picking cascaded Conditions

    In one the OBIEE Reports, I have given a set of NOT LIKE conditions as below:
    Session Name is not LIKE (pattern match) '%AUDIT%'
    AND Session Name is not LIKE (pattern match) '%audit%'
    AND Session Name is not LIKE (pattern match) '%Audit%'
    But when we refresh the report, it filters only records which uses AUDIT keyword as part of Session Names. When I checked the session log (attached for reference), I found that though logical table query takes those three conditions, while firing against database Physical Query contains condition only for AUDIT wild card as filter. Whether there is any limitation applied on using NOT LIKE conditions or is it a bug or the way the conditions are sequenced is wrong (in OBIEE sense).

    Thanks buddy. Though this workaround will solve the issue, I am curious to know why OBIEE behaves such a way. Its peculier to see OBIEE admits all 3 conditions in logical query where the Physical query skips few of the conditions in session log itself.

  • Query to pick rows of matching columns of table B else table A

    Hi All,
    I have a urgent requirement which can be explained from below example.
    Suppose I have two tables : A and B with same table schema as mentioned below:
    A (Trading ID, Name, Phone Number, Mobile no, City)
    B (Trading ID, Name, Phone Number, Mobile no, City)
    Now I have to write a select query with the following conditions:
    If the value of column "TradingID" in Table A exists in columns "TradingID" in table B then select the columns - (Name, Phone Number, Mobile no, City) from table B. Otherwise select the columns - (Name, Phone Number, Mobile no, City)
    from table A.
    I need a single select query with optimized solution.
    Thanks in Advance.!!!
    Please mark it as an answer/helpful if you find it as useful. Thanks, Satya Prakash Jugran

    Please try this:
    create table A (TradingID int, Name nvarchar(128), PhoneNumber int, Mobileno int, City nvarchar(128))
    go
    create table B (TradingID int, Name nvarchar(128), PhoneNumber int, Mobileno int, City nvarchar(128))
    go
    insert dbo.A (TradingID)
    values ( 1 ), (2 )
    insert dbo.B (TradingID, Name)
    values ( 1, 'test01' ), ( 3, 'test02' )
    go
    with cte as
    ( select x.TradingID
    from dbo.B as x
    join dbo.A as y
    on x.TradingID = y.TradingID )
    select *
    from B
    where exists ( select *
    from cte
    where TradingID = B.TradingID )
    union all
    select *
    from A
    where exists ( select *
    from cte
    where TradingID <> A.TradingID )

  • Select query for picking data in a dynamic internal table

    Dear All,
    Please help.
    <u>The code is :</u>
    p_table1 = itab_final-tabname1.
            p_field1 = itab_final-fieldname1.         
            SELECT (p_field1) FROM (p_table1) INTO CORRESPONDING FIELDS OF TABLE <dyntable1>.      
    It is working fine when the domain is of CHAR
    The piece of code is not working where domain is DATS, CURR, DEC, etc.
    What shall I do so that it works for other domains also. Please its urgent......
    <u>ERROR that came:</u>
    An exception occurred. This exception will be dealt with in more detail
    below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not
    caught, which                                                         
    led to a runtime error. The reason for this exception is:             
    The data read during a SELECT access could not be inserted into the    
    target field.                                                          
    Either conversion is not supported for the target field's type or the  
    target field is too short to accept the value or the data are not in a 
    form that the target field can accept

    Check below code
    REPORT zpwtest .
    *** Tables
    DATA: lt_data TYPE REF TO data.
    DATA: lt_fieldcatalog TYPE lvc_t_fcat.
    data : p_field type string ,
           p_table type string .
    *** Structure
    DATA: ls_fieldcatalog TYPE lvc_s_fcat.
    *** Data References
    DATA: new_line TYPE REF TO data.
    *** Field Symbols
    FIELD-SYMBOLS: <fs_data> TYPE REF TO data,
                   <fs_1> TYPE ANY TABLE,
                   <fs_2>,
                   <fs_3>.
    ls_fieldcatalog-fieldname = 'MANDT'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CARRID'. "Fieldname
    ls_fieldcatalog-inttype = 'C'. "Internal Type C-> Character
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CONNID'.
    ls_fieldcatalog-inttype = 'N'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'FLDATE'.
    ls_fieldcatalog-inttype = 'D'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'PRICE'.
    ls_fieldcatalog-inttype = 'P'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CURRENCY'.
    ls_fieldcatalog-inttype = 'C'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ASSIGN lt_data TO <fs_data>.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
         EXPORTING
           it_fieldcatalog = lt_fieldcatalog
         IMPORTING
           ep_table = <fs_data>
         EXCEPTIONS
           generate_subpool_dir_full = 1
           OTHERS = 2
    IF sy-subrc <> 0.
    ENDIF.
    *** So <FS_1> now points to our dynamic internal table.
    ASSIGN <fs_data>->* TO <fs_1>.
    *** Next step is to create a work area for our dynamic internal table.
    CREATE DATA new_line LIKE LINE OF <fs_1>.
    *** A field-symbol to access that work area
    ASSIGN new_line->*  TO <fs_2>.
    <b>
    p_field = 'mandt carrid connid fldate price currency' .
    p_table = 'sflight' .
    *** And to put the data in the internal table
    SELECT (p_field)
      FROM (p_table)
      INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
    </b>
    *** Access contents of internal table
    LOOP AT <fs_1> ASSIGNING <fs_2>.
      ASSIGN COMPONENT 5 OF STRUCTURE <fs_2> TO <fs_3>.
      WRITE: / <fs_3>.
    ENDLOOP.

Maybe you are looking for

  • Populating our log message along with standard sap log in ck11n.

    Hi all, I have developed a user exit which is used in costing of material using ck11n. Here i have to show our custom log message along with the standard log shown by standard sap system after costing run is complete. I got one FM-- CM_F_MESSAGE  whi

  • I have hp officejet pro 8100

    Can you print in B & W when a color cartridge is out of ink? I have a HP Officejet Pro 8100. I had a large B&Q project and turned the printer on and Magenta was dead.  I could not find a way to print in B&W so I had to go out and buy a new cartridge.

  • Share online fails to launch: "system error" 5800

    hi, i've added ovi and flikr accounts to my share online application on my nokia 5800 i've managed to upload several photos but after restarting the phone the share online application fails to launch. It thows "system error" message upon loading and

  • Career prospects in SAP SD

    Hi, after a long and tiring career of around 12 years in teaching as associate professor, I'm thinking of taking up more challenging careers in industry. I'm considering doing SAP SD and I'm worried about career prospects. Would anyone advise me if I

  • Update from 4.3.3 to 5.1 and apps can't open anymore

    i updated my iphone 4 from 4.3.3 to iso 5.1 today and found that can't open any of apps which i download before. what is going on??????? how to make it back?