<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Contraction and the PROVIDE command help needed! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270280#M150177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Logical database&lt;/P&gt;&lt;P&gt;A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HR Logical Database is PNP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main Functions of the logical database PNP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Selection screen &lt;/P&gt;&lt;P&gt;Data Retrieval &lt;/P&gt;&lt;P&gt;Authorization check  &lt;/P&gt;&lt;P&gt;To use logical database PNP in your program, specify in your program attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Selection Screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date selection&lt;/P&gt;&lt;P&gt;Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database.  When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period. &lt;/P&gt;&lt;P&gt;Person selection&lt;/P&gt;&lt;P&gt;Person selection is the 'true' selection of choosing a group of employees for whom the report is to run. &lt;/P&gt;&lt;P&gt;Sorting Data&lt;/P&gt;&lt;P&gt;· The standard sort sequence lists personnel numbers in ascending order.&lt;/P&gt;&lt;P&gt;· SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001. &lt;/P&gt;&lt;P&gt;Report Class &lt;/P&gt;&lt;P&gt;· You can suppress input fields which are not used on the selection screen by assigning a report class to your program.&lt;/P&gt;&lt;P&gt;· If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG. &lt;/P&gt;&lt;P&gt;Data Retrieval from LDB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create data structures for infotypes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    INFOTYPES: 0001, "ORG ASSIGNMENT&lt;/P&gt;&lt;P&gt;                        0002, "PERSONAL DATA&lt;/P&gt;&lt;P&gt;                        0008. "BASIC PAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Fill data structures with the infotype records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Start-of-selection. &lt;/P&gt;&lt;P&gt;         GET PERNR. &lt;/P&gt;&lt;P&gt;    End-0f-selection.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Read Master Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infotype structures (after GET PERNR) are internal tables loaded with data. &lt;/P&gt;&lt;P&gt;The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop. &lt;/P&gt;&lt;P&gt;          GET PERNR.&lt;/P&gt;&lt;P&gt;             PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA&lt;/P&gt;&lt;P&gt;                    If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif. &lt;/P&gt;&lt;P&gt;             ENDPROVIDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Period-Related Data&lt;/P&gt;&lt;P&gt;All infotype records are time stamped. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT0006 (Address infotype)&lt;/P&gt;&lt;P&gt;01/01/1990   12/31/9999  present &lt;/P&gt;&lt;P&gt;          Which record to be read depends on the date selection period specified on the&lt;/P&gt;&lt;P&gt;          selection screen. PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Data &lt;/P&gt;&lt;P&gt;IT0006 Address  -  01/01/1990 12/31/9999   present &lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, pn/begda = '19990931'    pn/endda = '99991231' &lt;/P&gt;&lt;P&gt;IT0006 subtype 1 is resident address&lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process Infotypes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change. &lt;/P&gt;&lt;P&gt;Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE &lt;/P&gt;&lt;P&gt;          REPORT ZHR00001.&lt;/P&gt;&lt;P&gt;          INFOTYPE: 0002.&lt;/P&gt;&lt;P&gt;          PARAMETERS: PERNR LIKE P0002-PERNR.&lt;/P&gt;&lt;P&gt;          RP-READ-INFOTYPE PERNR 0002 P0002 . &lt;/P&gt;&lt;P&gt;          PROVIDE * FROM P0002&lt;/P&gt;&lt;P&gt;              if ... then ...endif.&lt;/P&gt;&lt;P&gt;          ENDPROVIDE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.  &lt;/P&gt;&lt;P&gt;· Three steps are involved in changing infotypes:&lt;/P&gt;&lt;P&gt;1. Select the infotype records to be changed; &lt;/P&gt;&lt;P&gt;2. Make the required changes and store the records in an alternative table;&lt;/P&gt;&lt;P&gt;3. Save this table to the database; &lt;/P&gt;&lt;P&gt;The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible. &lt;/P&gt;&lt;P&gt;INFOTYPES: Pnnnn NAME OLD,&lt;/P&gt;&lt;P&gt;Pnnnn NAME NEW.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;    PROVIDE * FROM OLD&lt;/P&gt;&lt;P&gt;           WHERE .... = ... "Change old record&lt;/P&gt;&lt;P&gt;           *Save old record in alternate table&lt;/P&gt;&lt;P&gt;           NEW = OLD.&lt;/P&gt;&lt;P&gt;    ENDPROVIDE.&lt;/P&gt;&lt;P&gt;    RP-UPDATE OLD NEW. "Update changed record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infotype with repeat structures&lt;/P&gt;&lt;P&gt;· How to identify repeat structures.&lt;/P&gt;&lt;P&gt;a. On infotype entry screen, data is entered in table form.&lt;/P&gt;&lt;P&gt;    IT0005, IT0008, IT0041, etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b. In the infotype structure, fields are grouped by the same name followed by sequence number.&lt;/P&gt;&lt;P&gt;    P0005-UARnn P0005-UANnn P0005-UBEnn &lt;/P&gt;&lt;P&gt;    P0005-UENnn P0005-UABnn &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures &lt;/P&gt;&lt;P&gt;· Data is entered on the infotype screen in table format but stored on the database in a linear   &lt;/P&gt;&lt;P&gt;  structure.&lt;/P&gt;&lt;P&gt;· Each row of the table is stored in the same record on the database.&lt;/P&gt;&lt;P&gt;· When evaluating a repeat structure, you must define the starting point, the increment and the &lt;/P&gt;&lt;P&gt;  work area which contains the complete field group definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures Evaluation (I)&lt;/P&gt;&lt;P&gt;· To evaluate the repeat structures&lt;/P&gt;&lt;P&gt;   a. Define work area. &lt;/P&gt;&lt;P&gt;       The work area is a field string. Its structure is identical to that of the field group. &lt;/P&gt;&lt;P&gt;   b. Use a DO LOOP to divide the repeat structure into segments and make it available for   &lt;/P&gt;&lt;P&gt;       processing in the work area, one field group (block) at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures Evaluation(II)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Define work area &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF VACATION,&lt;/P&gt;&lt;P&gt;              UAR LIKE P0005-UAR01, "Leave type&lt;/P&gt;&lt;P&gt;              UAN LIKE P0005-UAN01, "Leave entitlement&lt;/P&gt;&lt;P&gt;              UBE LIKE P0005-UBE01, "Start date&lt;/P&gt;&lt;P&gt;              UEN LIKE P0005-UEN01, "End date &lt;/P&gt;&lt;P&gt;              UAB LIKE P0005-UAB01, "Leave accounted&lt;/P&gt;&lt;P&gt;           END OF VACATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;     RP-PROVIDE-FROM-LAST P0005 SPACE PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;     DO 6 TIMES VARYING VACATION&lt;/P&gt;&lt;P&gt;             FROM P0005-UAR01 "Starting point &lt;/P&gt;&lt;P&gt;                 NEXT P0005-UAR02. "Increment&lt;/P&gt;&lt;P&gt;             If p0005-xyz then ... endif. &lt;/P&gt;&lt;P&gt;      ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing 'Time Data'.&lt;/P&gt;&lt;P&gt;· Dependence of time data on validity period&lt;/P&gt;&lt;P&gt;· Importing time data&lt;/P&gt;&lt;P&gt;· Processing time data using internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time Data and Validity Period&lt;/P&gt;&lt;P&gt;· Time data always applies to a specific validity period.&lt;/P&gt;&lt;P&gt;· The validity periods of different types of time data are not always the same as the date selection period specified in the selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date selection period |----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;| &lt;/P&gt;&lt;P&gt;Leave |----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· PROVIDE in this case is therefore not used for time infotypes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Importing Time Data&lt;/P&gt;&lt;P&gt;· GET PERNR reads all time infotypes from the lowest to highest system data, not only those within the date selection period. &lt;/P&gt;&lt;P&gt;· To prevent memory overload, add MODE N to the infotype declaration. This prevents the logical database from importing all data into infotype tables at GET PERNR.&lt;/P&gt;&lt;P&gt;· Use macro RP-READ-ALL-TIME-ITY to fill infotype table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFOTYPES: 2001 MODE N.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;    LOOP AT P0021.&lt;/P&gt;&lt;P&gt;         If P0021-XYZ = ' '. A=B. Endif. &lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing Time Data&lt;/P&gt;&lt;P&gt;· Once data is imported into infotype tables, you can use an internal table to process the interested data. &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;              BUKRS LIKE P0001-BUKRS, "COMPANY&lt;/P&gt;&lt;P&gt;              WERKS LIKE P0001-WERKS, "PERSONNEL AREA&lt;/P&gt;&lt;P&gt;              AWART LIKE P2001-AWART, "ABS./ATTEND. TYPE&lt;/P&gt;&lt;P&gt;              ASWTG LIKE P2001-ASWTG, "ABS./ATTEND. DAYS &lt;/P&gt;&lt;P&gt;           END OF ITAB.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST P0001 SAPCE PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt;ITAB-BUKRS = P0001-BURKS. ITAB-WERKS = P0001-WERKS.&lt;/P&gt;&lt;P&gt;RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;LOOP AT P2001. &lt;/P&gt;&lt;P&gt;      ITAB-AWART = P2001-AWART. ITAB-ASWTG = P2001-ASWTG.&lt;/P&gt;&lt;P&gt;      COLLECT ITAB. (OR: APPEND ITAB.)&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vinod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Mar 2006 14:31:10 GMT</pubDate>
    <dc:creator>vinod_gunaware2</dc:creator>
    <dc:date>2006-03-06T14:31:10Z</dc:date>
    <item>
      <title>Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270279#M150176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm a new ABAP programmer that's been doing some HR-specific work (I've been through the HR350 Programming training course).  I've got a pretty good understanding of using the PNPCE LDB as an easy way of obtaining the data I need for a report or interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my issue:  On this particular request, the users don't want to see people "duplicated" on a report simply because a field they don't consider "major" changes, yielding an additional record in my system-provided Infotype table.  They have identified 3 fields (let's just call 'em FIELD1, FIELD2, and FIELD3) as the fields they wish to contract upon.  So only if any of these 3 fields change do they wish to see another row on the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROVIDE FIELD1 FIELD2 FIELD3 from P0001&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;from P0008&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  BETWEEN pn-begda AND pn-endda&lt;/P&gt;&lt;P&gt;    WHERE p0008-subty = '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that ONLY fields FIELD1, FIELD2, and FIELD3 get returned from P0001.  I do understand that that's what I'm asking for, so that's what I'm getting.  But there are OTHER fields from P0001 that I need to get to display on the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do I do?  I'm guessing this has to be a pretty common issue when working with contraction, I just don't know the best method on how to deal with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.  One colleague suggested I put in a SELECT to get the rest of the data.  I'd really not have to do a database read for every record I process, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.  Another suggested that prior to the PROVIDE, I copy the P0001 table to an internal table.  Then I go read it for the record that encompasses the begin/end dates of the contracted record.  That makes a little more sense to me, because at least I'm going back to a table in memory vs. back out to the physical database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.  Other options?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see this occurring on some future items coming my way, so I'd like to see what some of you HR gurus out there would do in this situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!  Points will be awarded, as always! &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 14:21:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270279#M150176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-06T14:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270280#M150177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Logical database&lt;/P&gt;&lt;P&gt;A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HR Logical Database is PNP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Main Functions of the logical database PNP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Selection screen &lt;/P&gt;&lt;P&gt;Data Retrieval &lt;/P&gt;&lt;P&gt;Authorization check  &lt;/P&gt;&lt;P&gt;To use logical database PNP in your program, specify in your program attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Selection Screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date selection&lt;/P&gt;&lt;P&gt;Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database.  When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period. &lt;/P&gt;&lt;P&gt;Person selection&lt;/P&gt;&lt;P&gt;Person selection is the 'true' selection of choosing a group of employees for whom the report is to run. &lt;/P&gt;&lt;P&gt;Sorting Data&lt;/P&gt;&lt;P&gt;· The standard sort sequence lists personnel numbers in ascending order.&lt;/P&gt;&lt;P&gt;· SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001. &lt;/P&gt;&lt;P&gt;Report Class &lt;/P&gt;&lt;P&gt;· You can suppress input fields which are not used on the selection screen by assigning a report class to your program.&lt;/P&gt;&lt;P&gt;· If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG. &lt;/P&gt;&lt;P&gt;Data Retrieval from LDB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create data structures for infotypes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    INFOTYPES: 0001, "ORG ASSIGNMENT&lt;/P&gt;&lt;P&gt;                        0002, "PERSONAL DATA&lt;/P&gt;&lt;P&gt;                        0008. "BASIC PAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Fill data structures with the infotype records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Start-of-selection. &lt;/P&gt;&lt;P&gt;         GET PERNR. &lt;/P&gt;&lt;P&gt;    End-0f-selection.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Read Master Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infotype structures (after GET PERNR) are internal tables loaded with data. &lt;/P&gt;&lt;P&gt;The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop. &lt;/P&gt;&lt;P&gt;          GET PERNR.&lt;/P&gt;&lt;P&gt;             PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA&lt;/P&gt;&lt;P&gt;                    If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif. &lt;/P&gt;&lt;P&gt;             ENDPROVIDE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Period-Related Data&lt;/P&gt;&lt;P&gt;All infotype records are time stamped. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IT0006 (Address infotype)&lt;/P&gt;&lt;P&gt;01/01/1990   12/31/9999  present &lt;/P&gt;&lt;P&gt;          Which record to be read depends on the date selection period specified on the&lt;/P&gt;&lt;P&gt;          selection screen. PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current Data &lt;/P&gt;&lt;P&gt;IT0006 Address  -  01/01/1990 12/31/9999   present &lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, pn/begda = '19990931'    pn/endda = '99991231' &lt;/P&gt;&lt;P&gt;IT0006 subtype 1 is resident address&lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process Infotypes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change. &lt;/P&gt;&lt;P&gt;Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE &lt;/P&gt;&lt;P&gt;          REPORT ZHR00001.&lt;/P&gt;&lt;P&gt;          INFOTYPE: 0002.&lt;/P&gt;&lt;P&gt;          PARAMETERS: PERNR LIKE P0002-PERNR.&lt;/P&gt;&lt;P&gt;          RP-READ-INFOTYPE PERNR 0002 P0002 . &lt;/P&gt;&lt;P&gt;          PROVIDE * FROM P0002&lt;/P&gt;&lt;P&gt;              if ... then ...endif.&lt;/P&gt;&lt;P&gt;          ENDPROVIDE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.  &lt;/P&gt;&lt;P&gt;· Three steps are involved in changing infotypes:&lt;/P&gt;&lt;P&gt;1. Select the infotype records to be changed; &lt;/P&gt;&lt;P&gt;2. Make the required changes and store the records in an alternative table;&lt;/P&gt;&lt;P&gt;3. Save this table to the database; &lt;/P&gt;&lt;P&gt;The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible. &lt;/P&gt;&lt;P&gt;INFOTYPES: Pnnnn NAME OLD,&lt;/P&gt;&lt;P&gt;Pnnnn NAME NEW.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;    PROVIDE * FROM OLD&lt;/P&gt;&lt;P&gt;           WHERE .... = ... "Change old record&lt;/P&gt;&lt;P&gt;           *Save old record in alternate table&lt;/P&gt;&lt;P&gt;           NEW = OLD.&lt;/P&gt;&lt;P&gt;    ENDPROVIDE.&lt;/P&gt;&lt;P&gt;    RP-UPDATE OLD NEW. "Update changed record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Infotype with repeat structures&lt;/P&gt;&lt;P&gt;· How to identify repeat structures.&lt;/P&gt;&lt;P&gt;a. On infotype entry screen, data is entered in table form.&lt;/P&gt;&lt;P&gt;    IT0005, IT0008, IT0041, etc. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b. In the infotype structure, fields are grouped by the same name followed by sequence number.&lt;/P&gt;&lt;P&gt;    P0005-UARnn P0005-UANnn P0005-UBEnn &lt;/P&gt;&lt;P&gt;    P0005-UENnn P0005-UABnn &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures &lt;/P&gt;&lt;P&gt;· Data is entered on the infotype screen in table format but stored on the database in a linear   &lt;/P&gt;&lt;P&gt;  structure.&lt;/P&gt;&lt;P&gt;· Each row of the table is stored in the same record on the database.&lt;/P&gt;&lt;P&gt;· When evaluating a repeat structure, you must define the starting point, the increment and the &lt;/P&gt;&lt;P&gt;  work area which contains the complete field group definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures Evaluation (I)&lt;/P&gt;&lt;P&gt;· To evaluate the repeat structures&lt;/P&gt;&lt;P&gt;   a. Define work area. &lt;/P&gt;&lt;P&gt;       The work area is a field string. Its structure is identical to that of the field group. &lt;/P&gt;&lt;P&gt;   b. Use a DO LOOP to divide the repeat structure into segments and make it available for   &lt;/P&gt;&lt;P&gt;       processing in the work area, one field group (block) at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Repeat Structures Evaluation(II)&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Define work area &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF VACATION,&lt;/P&gt;&lt;P&gt;              UAR LIKE P0005-UAR01, "Leave type&lt;/P&gt;&lt;P&gt;              UAN LIKE P0005-UAN01, "Leave entitlement&lt;/P&gt;&lt;P&gt;              UBE LIKE P0005-UBE01, "Start date&lt;/P&gt;&lt;P&gt;              UEN LIKE P0005-UEN01, "End date &lt;/P&gt;&lt;P&gt;              UAB LIKE P0005-UAB01, "Leave accounted&lt;/P&gt;&lt;P&gt;           END OF VACATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;     RP-PROVIDE-FROM-LAST P0005 SPACE PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;     DO 6 TIMES VARYING VACATION&lt;/P&gt;&lt;P&gt;             FROM P0005-UAR01 "Starting point &lt;/P&gt;&lt;P&gt;                 NEXT P0005-UAR02. "Increment&lt;/P&gt;&lt;P&gt;             If p0005-xyz then ... endif. &lt;/P&gt;&lt;P&gt;      ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing 'Time Data'.&lt;/P&gt;&lt;P&gt;· Dependence of time data on validity period&lt;/P&gt;&lt;P&gt;· Importing time data&lt;/P&gt;&lt;P&gt;· Processing time data using internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time Data and Validity Period&lt;/P&gt;&lt;P&gt;· Time data always applies to a specific validity period.&lt;/P&gt;&lt;P&gt;· The validity periods of different types of time data are not always the same as the date selection period specified in the selection screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date selection period |----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;| &lt;/P&gt;&lt;P&gt;Leave |----&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;|&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;· PROVIDE in this case is therefore not used for time infotypes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Importing Time Data&lt;/P&gt;&lt;P&gt;· GET PERNR reads all time infotypes from the lowest to highest system data, not only those within the date selection period. &lt;/P&gt;&lt;P&gt;· To prevent memory overload, add MODE N to the infotype declaration. This prevents the logical database from importing all data into infotype tables at GET PERNR.&lt;/P&gt;&lt;P&gt;· Use macro RP-READ-ALL-TIME-ITY to fill infotype table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INFOTYPES: 2001 MODE N.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;    LOOP AT P0021.&lt;/P&gt;&lt;P&gt;         If P0021-XYZ = ' '. A=B. Endif. &lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing Time Data&lt;/P&gt;&lt;P&gt;· Once data is imported into infotype tables, you can use an internal table to process the interested data. &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;              BUKRS LIKE P0001-BUKRS, "COMPANY&lt;/P&gt;&lt;P&gt;              WERKS LIKE P0001-WERKS, "PERSONNEL AREA&lt;/P&gt;&lt;P&gt;              AWART LIKE P2001-AWART, "ABS./ATTEND. TYPE&lt;/P&gt;&lt;P&gt;              ASWTG LIKE P2001-ASWTG, "ABS./ATTEND. DAYS &lt;/P&gt;&lt;P&gt;           END OF ITAB.&lt;/P&gt;&lt;P&gt;GET PERNR.&lt;/P&gt;&lt;P&gt;RP-PROVIDE-FROM-LAST P0001 SAPCE PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;CLEAR ITAB.&lt;/P&gt;&lt;P&gt;ITAB-BUKRS = P0001-BURKS. ITAB-WERKS = P0001-WERKS.&lt;/P&gt;&lt;P&gt;RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.&lt;/P&gt;&lt;P&gt;LOOP AT P2001. &lt;/P&gt;&lt;P&gt;      ITAB-AWART = P2001-AWART. ITAB-ASWTG = P2001-ASWTG.&lt;/P&gt;&lt;P&gt;      COLLECT ITAB. (OR: APPEND ITAB.)&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vinod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 14:31:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270280#M150177</guid>
      <dc:creator>vinod_gunaware2</dc:creator>
      <dc:date>2006-03-06T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270281#M150178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of the SELECT, I would suggest the use of the function module HR_READ_INFOTYPE. This way, you need not worry about Authorization checks &amp;amp; Coding standards ( at some places they do not let you put a SELECT inside a GET event) etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 14:34:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270281#M150178</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-03-06T14:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270282#M150179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Just use P0001 as any other Internal table U would use &lt;/P&gt;&lt;P&gt; inside your program.&lt;/P&gt;&lt;P&gt; P0001 will be filled when U call the GET PERNR for the&lt;/P&gt;&lt;P&gt; PERNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;GSR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 14:41:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270282#M150179</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-06T14:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270283#M150180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking I couldn't do that because P0001 would be "overwritten" with the results of my PROVIDE statement.  However, looking at this more closely thru debugging, I see that it's the Header Row (and this Header Row business has always kinda thrown me since I started learning ABAP) that has the "joined" record, with the PNBEGDA and PNENDDA dates delimited to match the results of the join.  The other two "original" records are still in P0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you're saying to just go ahead and search or read P0001 for the "original" record that has all of the fields before the join/contraction took place, since only the Header Row has the joined/contracted record -- correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 16:03:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270283#M150180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-06T16:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270284#M150181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes , U have all the records in P0001.&lt;/P&gt;&lt;P&gt;We need to loop at P0001 or use a macro (if U want the&lt;/P&gt;&lt;P&gt;last or first record in the dates given) to get the &lt;/P&gt;&lt;P&gt;record.&lt;/P&gt;&lt;P&gt;P0001 always has the latest record in the header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srinivas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 16:10:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270284#M150181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-06T16:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Contraction and the PROVIDE command help needed!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270285#M150182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Srinivas.  I think that approach makes sense.  Can't tell you how much I've learned about contraction as well as Header Records in internal tables today!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to the others as well -- I assigned helpful advice points to you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2006 19:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/contraction-and-the-provide-command-help-needed/m-p/1270285#M150182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-06T19:24:19Z</dc:date>
    </item>
  </channel>
</rss>

