HR-ABAP wagetypes

Hi All,
Please help me with my requirement.
I have 3 different wagetypes and I need to calculate the gross base pay i.e BET01 with respect to the particular wagetype form infotype 0008.
Please give an example....
Regards,
srikanth.

U need to use .. do .. enddo ..
do 40 times
     varying w_lgaxx from it_pa0008-lga01 next it_pa0008-lga02
     varying w_betxx from it_pa0008-bet01 next it_pa0008-bet02.
case w_lgaxx.
   when ' ' .<-- pass your wage type1
      v_amount1 = w_betxx. <-- get the corresponding amount
   when ' ' .<-- pass your wage type2
      v_amount2 = w_betxx.
   when ' ' .<-- pass your wage type3
      v_amount3 = w_betxx.
enddo.

Similar Messages

  • Get HR ABAP fields

    Hi all,
    Can anyone sugess me from where i get the basic pay amount
    (It's not available in PA0008) and cost center text and job text(Position) in Hr Abap.
    Points will be sured for valuable answers.
    Thanks
    Sanket sethi

    To Read the Pay try to analyse this code and apply for yourself
        DO 40 TIMES
                       VARYING w_plgart-lgart
                          FROM p0008-lga01 NEXT p0008-lga02
                       VARYING w_plgart-betrg
                          FROM p0008-bet01 NEXT p0008-bet02
                       VARYING w_plgart-anzhl
                          FROM p0008-anz01 NEXT p0008-anz02
                       VARYING w_plgart-ein
                          FROM p0008-ein01 NEXT p0008-ein02
                       VARYING w_plgart-opken
                          FROM p0008-opk01 NEXT p0008-opk02
                       VARYING w_plgart-indbw
                          FROM p0008-ind01 NEXT p0008-ind02.
          CLEAR w_t511.
        SELECT SINGLE * FROM t511 INTO w_t511                   "#EC *
                           WHERE molga = '40'
                           AND   lgart = w_plgart-lgart
                           AND   endda GE sy-datum
                           AND   begda LE sy-datum.
            MOVE-CORRESPONDING w_t511 TO wa_p0008_wage.         "#EC ENHOK
            MOVE-CORRESPONDING w_plgart TO wa_p0008_wage.       "#EC ENHOK
            wa_p0008_wage-waers = 'INR'.
            APPEND wa_p0008_wage TO it_p0008_wage.
          ENDIF.
        ENDDO.
    Evaluate indirect wagetypes
        CALL FUNCTION 'RP_EVALUATE_INDIRECTLY_P0008'
          EXPORTING
            pbegda                       = w_letter_date
            pmolga                       = '40'
            pp0001                       = p0001
            pp0007                       = p0007
            pp0008                       = p0008
            ppernr                       = pernr-pernr
          TABLES
            ptbindbw                     = it_p0008_wage
          EXCEPTIONS
            bad_parameters               = 1
            error_at_indirect_evaluation = 2
            OTHERS                       = 3.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    To Get the Position & Cost Center Text use following FM
      CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
        EXPORTING
          otype                   = 'S'
          objid                   = p0001-plans
          begda                   = sy-datum
          endda                   = sy-datum
          reference_date          = sy-datum
        IMPORTING
          short_text              = w_short
          object_text             = w_stext
        EXCEPTIONS
          nothing_found           = 1
          wrong_objecttype        = 2
          missing_costcenter_data = 3
          missing_object_id       = 4
          OTHERS                  = 5.
      IF sy-subrc <> 0.
      ENDIF.
    For Position OTYPE is S & for cost Center it is K
    Pass the Position No/Cost Center No to OBJID
    Regards,
    Chandrashekhar

  • Reading RT results in ABAP

    I need to read RT results in the payroll simulation run. I understand that in the simulation run RT table doesn't get updated, but still all the calculations and processing is done. I need to read these values in my ABAP program. Any suggestions on how to read these values in the simulation run?

    Thanks Narendra /Vani,
    PYXX_READ_PAYROLL_RESULT helped me in resolving my problem. Now I am reading the payroll simulation results using this function and storing it in a custom table for reporting purposes. I am flushing the table once the report is generated. Sample code for others reference:
    *&  Include           ZINCLUDE
    FORM ZFUZDRT.
    data: result type pay99_result.
    data: my_rt like pc207 occurs 0 WITH HEADER LINE.
    data: amount TYPE i.
    DATA: ZZRTDUMP TYPE ZZRTDUMP OCCURS 0 WITH HEADER LINE.
    DATA: ZZRTDUMP1 TYPE ZZRTDUMP.
       call function 'PYXX_READ_PAYROLL_RESULT'
             exporting
                 clusterid                    = 'RX'
                 employeenumber               = PERNR-PERNR
                 sequencenumber               = '00003'
                  READ_ONLY_BUFFER             = 'X'
                 READ_ONLY_INTERNATIONAL      = 'X'
          IMPORTING
               VERSION_NUMBER_PAYVN         =
                VERSION_NUMBER_PCL2           =
             changing
                 payroll_result               = result
               EXCEPTIONS
               OTHERS = 1.
               IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
               ENDIF.
    my_rt[] = result-inter-rt[].
    LOOP AT my_rt."where lgart = wagetype(selection-screen input).
    ZZRTDUMP1-PERNR = PERNR-pernr.
    ZZRTDUMP1-LGART = my_rt-LGART.
    ZZRTDUMP1-BETRG = my_rt-BETRG.
    ZZRTDUMP1-AMT_CURR = my_rt-AMT_CURR.
    ZZRTDUMP1-ANZHL = my_rt-ANZHL.
    ZZRTDUMP1-BETPE = my_rt-BETPE.
    INSERT INTO ZZRTDUMP VALUES ZZRTDUMP1.
    ENDLOOP.

  • How to read wagetype data

    Hi All,
    I am new in HR ABAP. Plz guide me how to get information/read data from
    Wagetype 2RTH, 7RTH, 2RCU, 7RCU.
    I need to add WT 2RTH + 7RTH, WT 2RCU + 7RCU and display in report.
    Regards

    You should read the payroll result to get the wagetype amount and display in the report.
    First you have to know in which table these wage types are stored in the payroll results. EX RT or CRT or TCRT then typical steps would be to
    1. Read the RGDIR directory - use  CU_READ_RGDIR
    2. Get the sequence number. If you just need some accumulated wage types or last payroll result then use CD_READ_LAST
    3. Read payroll results - PYXX_READ_PAYROLL_RESULT using the sequence number in previous step.
    4. then read appropriate table to get the amount.

  • HR ABAP Expert - PCL2-CLUSTD

    I can easily read PCL2 data by using "IMPORT blah blah.... FROM DATABASE PCL2(RU)".
    Somehow, someway, SAP takes what is strored in PCL2-CLUSTD and converts it into meaningful variables via the "IMPORT ... FROM DATABASE" syntax.
    [[I want to see the code SAP uses to do this]]
    Actually, what I really want is to take normal data say, employee name and say payroll dollars for a given period and then convert it back into PCL2-CLUSTD without updating PCL2.
    IDEAS?

    hi goldstein,
    pls refer the below liks once.u may get clear idea about wat u want.
    sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html - 26k
    www.experts-exchange.com/Database/Software/HR_HCM/SAP/Q_23189513.html - 112k -
    www.sap-img.com/hr021.htm - 8k -
    www.sapbrainsonline.com/REFERENCES/StandardReports/SAP_standard_reports_list.html - 39k
    Best PDF file to learn HR Programming
    http://www.melayu.plus.com/SAP%20HR%20Programming.pdf
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    You can see some Standard Program examples in this one ...
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    HR
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    you can see some Standard Program examples in this one..
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    These are the FAQ's that might helps you
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.erpgenie.com/faq/hr.htm.
    www.sap-img.com
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
    http://www.sapcookbook.com/preview_hr_questions.htm
    http://www.atomhr.com/library_full.htm
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
    http://www.allsaplinks.com/HRmaterial.html
    http://www.allsaplinks.com/timemanagement.html
    http://www.allsaplinks.com/payrollcompletefunctional.html
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRINF/HRINF.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYXXFORM/PYINT_FORMBUILDER.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPA/BCBMTWFMPA.pdfhttp://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_HR.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://www.planetsap.com/hr_abap_main_page.htm
    Regards,
    karthik
    <REMOVED BY MODERATOR>
    Few notes are below:
    InfoSets in the HR Application
    You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
    InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
    If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
    The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
    Logical database PNP/PNPCE* PCH PAP
    Selection of Persons Objects from Personnel Planning Applicants
    Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
    · Customer infotypes
    Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
    Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
    Creating InfoSets
    The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
    1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
    2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
    Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
    This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
    3. Choose .
    This takes you to the Infotype Selection for InfoSet .
    Fill data object
    Export record
    EXPORT TABLE1 TO DATABASE PCLn (xy) ID xy-KEY.
    IF SY-SUBRC EQ 0.
    WRITE: / 'Update successful'.
    ENDIF.
    Export Cluster data using the macro
    . Export data using macro RP-EXP-Cn-xy.
    • When data records are exported using macro, they are not written to the database but to a main memory buffer.
    • To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
    REPORT ZHREXPRT.
    *Buffer definition
    INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    RP-EXP-Cn-xy.
    IF SY-SUBRC EQ 0.
    PERFORM PREPARE_UPDATE USING ‘V’.
    ENDIF.
    Importing Cluster Data using standard include
    • The IMPORT command causes data objects with the specified key values to be read from PCLn.
    • If the import is successful, SY-SUBRC is 0; if not, it is 4.
    REPORT RPIMPORT.
    TABLES: PCLn.
    INCLUDE RPCnxxy0. "Cluster definition
    Fill cluster Key
    Import record
    IMPORT TABLE1 FROM DATABASE PCLn (xy) ID xy-KEY.
    IF SY-SUBRC EQ 0.
    Display data object
    ENDIF.
    Importing Cluster data using Macro
    • Import data using macro RP-IMP-Cn-xy.
    • Check return code SY-SUBRC. If 0, it is successful. If 4, error.
    • Need include buffer management routines RPPPXM00
    Example
    REPORT RPIMPORT.
    *Buffer definition
    INCLUDE RPPPXD00.
    DATA: BEGIN OF COMMON PART 'BUFFER'.
    INCLUDE RPPPXD10.
    DATA: END OF COMMON PART 'BUFFER'.
    *Import data to buffer
    RP-IMP-Cn-xy.
    *Buffer management routines
    INCLUDE RPPPXM00.
    Cluster Authorization
    Simple EXPORT/IMPORT statement does not check for cluster authorization.
    Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
    authorization.
    How to read the Payroll Results
    • Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
    n - Country identifier.
    • Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
    • Report RPCEDTn0 lists the results on a payroll form.
    • The cluster definition of payroll results is stored in two INLCUDE reports:
    include: rpc2rx09. "Definition Cluster Ru (I)
    include: rpc2ruu0.”Definition Cluster Ru (II)
    o This first INCLUDE defines the country-independent part; the second
    INCLUDE defines the country-specific part (US).
    o The cluster key is stored in the field string RX-KEY.
    • All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This allows you to use the same structures in different definitions and nonetheless maintain data consistency.
    • The structures for cluster definition comply with the name convention PCnnn
    Unfortunately 'nnn' can be any set of alphanumeric characters.
    *Key definition
    DATA: BEGIN OF RX-KEY.
    INCLUDE STRUCTURE PC200.
    DATA: END OF RX-KEY.
    *Payroll directory
    DATA: BEGIN OF RGDIR OCCURS 100.
    INCLUDE STRUCTURE PC261.
    DATA: END OF RGDIR.
    • How to retrieve Payroll results
    o To read payroll results, you need two keys: pernr and seqno
    o You can get SEQNO by importing the cluster directory (CD) first.
    Example
    REPORT ZHRIMPRT.
    TABLES: PERNR, PCL1, PCL2.
    INLCUDE: rpc2cd09. "Definition cluster CD
    PARAMETERS: PERSON LIKE PERNR-PERNR.
    RP-INIT-BUFFER.
    *Import cluster Directory
    CD-KEY-PERNR = PERNR-PERNR.
    RP-IMP-C2-CU.
    CHECK SY-SUBRC = 0.
    LOOP AT RGDIR.
    RX-KEY-PERNR = PERSON.
    UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
    *Import data from PCL2
    RP-IMP-C2-RU.
    ENDLOOP.
    o Reading records from the Payroll directory
    after importing the payroll directory, which record to read is up to the programmer
    o Each payroll result has a status.
    'P' - previous result
    'A' - current (actual) result
    'O' - old result
    o Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period when that payroll is initially run. It also will select all the relevant periods to be evaluated.
    Example
    Call function 'CD_EVALUATION_PERIODS'
    exporting
    bonus_date = ref_periods-bondt
    inper_modif = pn-permo
    inper = ref_periods-inper
    pay_type = ref_periods-payty
    pay_ident = ref_periods-payid
    tables
    rgdir = rgdir
    evpdir = evp
    iabkrs = pnpabkrs
    exceptions
    no_record_found = 1.
    Authorization Check
    Authorization for Persons
    • In the authorization check for persons, the system determines whether the user has the authorizations required for the organizational features of the employees selected with GET PERNR.
    • Recruits for which the user has no authorization are skipped and appear in a list at the end of the report.
    • Authorization object: 'HR: Master data'
    Authorization for Data
    • In the authorization check for data, the system determines whether the user is authorized to read the infotypes specified in the report.
    • If the authorization for a particular infotype is missing, the evaluation is terminated and an error message is displayed.
    Deactivating the Authorization Check
    • In certain reports, it may be useful to deactivate the authorization check in order to improve performance. (E.g. when running payroll)
    • You can store this information in the object 'HR: Reporting'.
    2.1.6 Concepts of Macros (Import/Export etc.)
    Macros:
    Introduction
    Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros.
    Macro contains some part of source code, which it will be useful for number of applications. Macro is module, which is stored
    Naming Conventions of Macro:
    RP-aaa-bb-cc
    • aaa is the type of Macro. It takes two values
    o IMP Import Macro
    o EXP Export Macro
    • bb is the Database table where the data is saved:
    o C1 Database object PCL1
    o C2 Database object PCL2
    o C3 Database object PCL3
    o C4 Database object PCL4
    • Cc is the cluster, it may take
    o RX Cluster object RX
    o RD Cluster object RD
    o B2 Cluster object B2 and so on.
    Defining and Calling the Macros
    Defining:
    There are two options for defining the Macros
    • Macros are defined using the ABAP Commands DEFINE…. END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.
    • Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. The coding is grouped under a specific name in the table key.
    According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
    Difference between the two methods is:
    • If a macro is changed, each report using this macro is automatically regenerated when it is executed.
    • When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
    Standard HR Macros
    o The macro RP-PROVIDE-FROM-FRST retrieves the first (start) data record, which is valid in the data selection period.
    o The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record, which is valid in the data selection period.
    o The macro RP-READ-INFOTYPE retrieves the data record(s), which is valid in the data selection period.
    How to check whether the macro operation is successful or not
    For every macro, whether the operation was successful or not will be checked with
    PNP-SW-FOUND.
    If PNP-SW-FOUND = 1, then the operation is successful.
    Where exactly the Macrocode is stored
    The program code pertaining to this macro is stored in the control table RMAC
    Guidelines for how and when to use the Standard Macros
    o RP_PROVIDE_FROM_FRST
    Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity start and end dates are correct (preferably of the type DATE).
    • The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.
    Features
    The first entry for a specified period is placed in the table header entry from an internal infotype table.
    Parameters
    RP_PROVIDE_FROM_FRST inftytab subty beg end
    IN: 1) Name of the internal table
    2) Subtype required or SPACE if no subtype is being specified
    3) Validity start date of the time interval
    4) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
    2) The matching table header entry if PNP-SW-FOUND = 1 or
    the initial table header entry if PNP-SW-FOUND = 0
    Example
    (RP_PROVIDE_FROM_FRST inftytab subty beg end)
    RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '1'.
    ENDIF.
    or
    RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Error: Org. assignment is missing' REJECT.
    ENDIF.
    o RP_PROVIDE_FROM_LAST
    You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity start and end dates are correct (preferably of the type DATE).
    • The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
    Features
    The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
    Parameters
    RP_PROVIDE_FROM_LAST inftytab subty beg end
    IN: 1) Name of the internal table
    2) Subtype required or SPACE if no subtype is being specified
    3) Validity begin date of the time interval
    4) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
    2) The matching table header entry if PNP-SW-FOUND = 1 or
    the cleared table header entry if PNP-SW-FOUND = 0
    Example:
    RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '1'.
    ENDIF.
    OR
    RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Error: Org. assignment is missing'. REJECT.
    ENDIF.
    • RP_READ_INFOTYPE
    You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.
    You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules.
    Prerequisites
    • The validity begin date of the time period must be before or the same as the validity end date.
    • Validity begin and end are correct date specifications (preferably of the type DATE).
    • The infotype table must match the infotype number.
    • The program using the macro must contain the include DBPNPMAC.
    Features
    The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table.
    Parameters
    RP_READ_INFOTYPE pernr infty inftytab beg end
    IN: 1) Personnel number of the person requested
    2) Infotype number of the required infotype
    3) Name of the internal infotype table
    4) Validity start date of the time interval
    5) Validity end date of the time interval
    OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset
    PNP-SW-FOUND = 1, if there is no matching record in the dataset
    2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.
    PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization
    3) Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).
    Example
    (RP_READ_INFOTYPE pernr infty inftytab beg end)
    INFOTYPES: 0001.
    RP-LOWDATE-HIGHDATE.
    DATA: PERNR LIKE P0001-PERNR.
    DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA.
    PERNR = '12345678'.
    BEGDA = LOW-DATE + 15
    ENDDA = HIGH-DATE - 5.
    RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA.
    IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.
    WRITE: / 'Insufficient authorization'. STOP.
    ENDIF.
    IF PNP-SW-FOUND EQ '0'.
    WRITE: / 'Infotype 0001 missing'. STOP.
    ENDIF.
    2.1.7 Retrieval of data using LDBs (PNP/PAP/APP/PCH) without LDBs.
    Logical database
    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.
    HR Logical Database is PNP
    Main Functions of the logical database PNP:
    • Standard Selection screen
    • Data Retrieval
    • Authorization check
    To use logical database PNP in your program, specify in your program attributes.
    Standard Selection Screen
    • Date selection
    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.
    • Person selection
    Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
    • Sorting Data
    • The standard sort sequence lists personnel numbers in ascending order.
    • SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
    • Report Class
    • You can suppress input fields, which are not used on the selection screen by assigning a report class to your program.
    • If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
    Data Retrieval from LDB
    1. Create data structures for infotypes.
    INFOTYPES: 0001, "ORG ASSIGNMENT
    0002, "PERSONAL DATA
    0008. "BASIC PAY
    2. Fill data structures with the infotype records.
    Start-of-selection.
    GET PERNR.
    End-0f-selection.
    Read Master Data
    • Infotype structures (after GET PERNR) are internal tables loaded with data.
    • The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
    GET PERNR.
    PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
    If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. Endif.
    ENDPROVIDE.
    • Period-Related Data
    All infotype records are time stamped.
    IT0006 (Address infotype)
    01/01/1990 12/31/9999 present
    Which record to be read depends on the date selection period specified on the
    selection screen. PN/BEGDA PN/ENDDA.
    • Current Data
    IT0006 Address - 01/01/1990 12/31/9999 present
    RP-PROVIDE-FROM-LAST retrieves the record, which is valid in the data selection period.
    For example, pn/begda = '19990931' pn/endda = '99991231'
    IT0006 subtype 1 is resident address
    RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
    2.2 Personnel Administration (PA)
    PA involves administrating employee data, commonly referred to Master Data. Master Data contains all employee data used in HR processing. Master Data includes Personal (E.g. address), Organizational (Position description), Benefits (Insurance, Pension), Time & Payroll.
    Master Data is stored in Infotypes. Infotypes are tables (for user Data entry screen) that contain logically related employee data. Data can be stored for specific periods, which includes current and historical.
    Components of PA:
    Personnel Area: represents a division of a company code into subunits. It is an organizational entity representing an area within an organization defined by specific aspects of personnel administration, time management and payroll. Personnel areas are subdivided into personnel subareas. Personnel area is specific to HR and is a four character alphanumeric identification. E.g. Personnel area 100 is for employees in Karnataka, 200 is for Chennai.
    Personnel Subarea: is a further subdivision of Personnel area. It may represent geographical locations. Functions include:
    1. Set groupings for Time Management, so that work schedules, substitution and absence and leave types can be setup for individual personnel subareas.
    2. Generate default pay scale type and area for an employee's basic pay.
    3. Define public holiday calendar.
    Employee Groups: divides or groups employees into various categories. E.g. Active employees, Retired employees, Contractors Employee groups are used to generate default values for payroll accounting area and basic pay.
    Employee Subgroups: are further differentiated within the employee group. E.g. Salaried employees, Hourly employees, unionized employees, Executives The employee subgroup grouping for the payroll rule allows you to define different payroll procedures for different employee subgroups. For e.g. you can specify whether an employee's pay should be determined on hourly or monthly basis. The employee subgroup grouping for the work schedule defines the validity of work schedule, and the attendance or absence quota type determines the validity of time quotas.
    Here a Data Model
    2.2.1 Importance of Dates and periods in payroll
    Here is a simple ABAP example of reading DATE types stored in infotype 0041.
    There can be a maximum of 12 dates stored in this infotype. Here is an example of an infotype 0041 record:
    The date types are stored in PA0041-DAR01, PA0041-DAR02, etc.
    In the example above, PA0041-DAR01 is “01”, PA0041-DAR02 is “09”.
    The dates themselves are stored in PA0041-DAT01, PA0041-DAT02, etc
    To read through this in ABAP, the easiest way is to use the DO VARYING statement. Here is a simple demonstration ABAP:
    Note: to print the text of the date type, e.g. “Leave year entry” select from table T548T.
    REPORT ZDATES1.
    TABLES: PERNR.
    DATA: BEGIN OF MYDATES,
    DAR LIKE P0041-DAR01,
    DAT LIKE P0041-DAT01,
    END OF MYDATES.
    INFOTYPES 0041.
    GET PERNR.
    WRITE: PERNR-PERNR, PERNR-ENAME. "Show employee number and name
    RP-PROVIDE-FROM-LAST P0041 SPACE PN-BEGDA PN-ENDDA.
    IF PNP-SW-FOUND = 1.
    DO 12 TIMES VARYING MYDATES
    FROM P0041-DAR01
    NEXT P0041-DAR02.
    If mydates-dar ne space.
    WRITE: /, MYDATES-DAR, MYDATES-DAT.
    Endif.
    ENDDO.
    ENDIF.
    2.2.2 Overview of date fields and period-Ex. for period/in-period/ payroll
    FOR-PERIOD: Payroll period (start and end date of a period) for which a payroll result is created or generated.
    IN-PERIOD: The payroll period (start and end date of a period) in which a payroll result is created or generated.
    Example: For every employee payroll should be run, it may be bi-weekly, monthly, or quarterly. Say it is monthly, then for an employee a payroll should be run for this month and it is run next month then. For-period start date is 01/9/2003 and end date is 30 and in-period end date will be the date it is run 15/10/2003.
    In-Period View
    An in-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRD Payroll Result for Germany,) for a number of in-periods. The payroll results that were generated for the required number of payroll periods in the selected period are selected.
    Payroll Result
    For-Period View
    A for-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRC Payroll Result for Switzerland) for a number of for-periods. The payroll results that were generated in the required number of payroll periods for the selected period are selected.
    Example: For-Period View / In-Period View
    Payroll
    result For-period
    view Start date
    for-per. view End date
    for-per. view In-period
    view End date
    in-per. view
    1 01/1997 01.01.1997. 31.01.1997 02/1997 28.02.1997
    2 02/1997 01.02.1997 28.02.1997 02/1997 28.02.1997
    Explanation
    The payroll result 1 for the payroll period (for-period) 01/1997 has the start date 01.01.1997 and the end date 31.01.1997. This payroll result was generated in the payroll period (in-period) 02/1997.
    2.2.3 Repetitive Structures processing
    In many master data infotypes the data is stored in the form of repetitive structures. For example infotype 0008, the structure wage type line is available for 20 times, that is an employee is eligible for having 20 different wage types based on his benefits. When evaluating repeat structures, you must ensure that all fields are entered. In the case of the Basic Pay infotype, 20 * 5 = 100 fields are queried.
    To use this method of evaluation, define a field string whose structure corresponds to the fields in one line of the repetitive structure.
    Example for understanding the repetitive Structure
    Say, for an employee you want to know that for what all wage types an employee is eligible for the latest period you mentioned on the selection screen.
    Using LDB (PNP)
    Program:
    Report zhk_repstru.
    Tables Pernr.
    Infotypes 0008.
    • You have to declare a structure same as repetitive structure in the 0008 infotype
    Data: begin of s_wagetypes,
    Wagetype type p0008-lga01,
    Amount type p0008-bet01,
    Hours type p0008-anz01,
    Unit type p0008-ein01,
    Ind type p0008-opk01,
    End of s_wagetypes,
    • Selecting data from the Data base Get pernr
    • Getting the latest record based on the selection period.
    RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
    • Now knowing for what all wage types the employee is eligible.
    Do 20 times varying s_wagetypes from p0008-lga01 next p0008-lga02. If s_wagetypes-wagetype is initial.
    o Here the data is stored sequentially, i.e., if the employee is eligible for 5 wage types then all the 5 wage types are stored sequentially in lga01 to lga05 respectively. So, if say the lga05 is initial then it is understood that, employee is eligible for only 4 wage types and from lga05 to lga20 structures will be empty so, we need not process further
    Exit.
    Else.
    Write: / s_wagetypes-wagetype,
    S_wagetypes-amount.
    Endif.
    Enddo.
    2.2.4 Guidelines to retrieve Payroll data (Mainly US/UK/Ireland)
    Before directly going into the Guidelines to retrieve Payroll Data let us look in to the basic concepts of the Payroll.
    Introduction to Payroll
    To calculate the remuneration for work done for each employee
    Payroll does not just involve the calculation of remuneration, but consists of a variety of processes that are becoming increasingly important due to the employer’s increased obligation to supply benefits and medical welfare. These benefits are products of:
    • Labor law
    • Tax law
    • Contribution law
    • Benefits law
    • Civil law
    • Reporting law
    • Information law
    • Statistics law
    Payroll in the SAP System: In the SAP Human Resources Management System, payroll accounting is executed using the Payroll driver.
    Process Flow:
    When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
    Payroll Integration:
    Payroll can be integrated in Personnel Administration, Time Management, Incentive Wages and Accounting:
    Standardized data retention enables you to use master data and other payroll relevant data from Personnel Administration.
    Time data, entered via Time Management, is automatically included in the Payroll and is valuated during the payroll run. Data from the Incentive Wages component is used to calculate piecework wages and premium wages directly in Payroll.
    Information on expenses and payables from Payroll is posted for accounting directly in Financial Accounting, and you assign the costs to the appropriate cost center. You can also control the financial system of third-party providers.
    Payroll Driver
    Payroll driver is a special report for Payroll.
    SAP has developed country-specific payroll drivers, which are based on report RPCALCx0.
    The country-specific net calculation of pay must be developed explicitly for every country.
    Separate country programs, which meet the tax and insurance requirements of the respective country, can be created from the basic report RPCALCx0. Since the payroll driver has a modular structure, you can use the Customizing functions to quickly modify the payroll procedure to meet the particular requirements of your enterprise.
    Integration
    Calculation rules and other reports are stored in an accompanying schema, which also contains the activities carried out by the payroll driver during payroll. All data is stored in internal tables and saved in files with a cluster structure.
    When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
    Payroll Schema:
    It contains calculation rules to be used by the payroll driver during payroll.
    SAP has developed country-specific schemas, which are based on schema X000.
    With country-specific reports, the first character in the name refers to the country indicator.
    For example,
    D for Germany
    F for France
    U for USA
    Schema Structure A schema consists of the following parts:
    1. Initialization
    Where system performs the following steps:
    Updates the databases
    Imports required infotypes
    2. Gross calculation of pay
    Where system performs the following steps:
    Processes basic data and time data
    Reads payroll account of the last period accounted
    Processes time data and calculate the individual gross values
    Performs factoring
    3. Net calculation of pay
    where system performs the following steps:
    Calculates net remuneration
    Performs bank transfers
    Example:
    The classic example is the payroll for salaried employees at the end of the month in contrast to the wage accounting of hourly workers in the middle of the following month.
    Enter the organizational assignment of employees to a payroll accounting area (ABKRS) in Infotype 0001. Payroll accounting area also determines the two functions necessary for payroll accounting:
    • The summarization of personnel numbers to be accounted and
    • The determination of the exact payroll period.
    Select Personnel Numbers:
    Personnel numbers are selected for payroll accounting by specifying a payroll area in the payroll driver. Infotype 0001 Organizational Assignment enables you to assign an employee to the appropriate payroll area.
    These Pernrs are locked during Payroll Run.
    Determine Payroll Period:
    On the Selection screen, you can give Payroll Period Parameter as per the requirement else you can give Payroll Area, by which system calculates the payroll period.
    Finding Payroll Results for a Specific Query:
    Payroll results are stored in cluster Rx of the PCL2. The cluster key is not mnemonic; it contains only the PERNR (personnel number) and SEQNO (sequential number) fields.
    The internal table RGDIR (PC261 - Cluster Directory for Export and Import of Payroll Results) contains a directory entry for each payroll result.
    This entry is a sequential number (RGDIR-SEQNR), which uniquely identifies the payroll result.
    Payroll results can only be imported if the payroll cluster key (PC200) contains the personnel number and sequential number.
    Function Modules for Selecting Payroll Results
    You will probably always have the same queries when importing payroll records. For example, "Which payroll results (original and retroactively accounted records) were written for a specific payroll run (defined by IN payroll category, IN payroll area, IN period)"? To save programmers from having to write their own reports for this functionality, standard modules are available for the most important queries. The employee's payroll directory is always transferred to the function modules using the table RGDIR (PC261). The modules then transfer the payroll records, which satisfy the specified selection criteria using a table whose type corresponds to that of the RGDIR (PC261) but which has a different name.
    Exporting Pernr – Personal Number
    Importing Molga – Country
    Tables Rgdir – Payroll Results Directory
    This Function Module populates payroll results of all employees with PERNR & SEQNR as key.
    Macro Modules:
    We have populated Results Directory & retrieved Sequential Number, we need to call an import macro module for retrieving the required payroll results. For this we need to pass the unique identification of an Employee payroll Result i.e. rx-key-pernr = v_pernr.
    rx-key-seqno = v_seqnr.
    To that import macro.
    Calling Import Module: RP-imp-c2-RU.
    This Macro populates all the cluster tables required for Payroll, by importing from PCL2 Cluster Directory. After that we can loop through these cluster tables for required fields.
    Guideline to write a program, which retrieves the data for, specified country
    • Use Logical Database As per the Requirement.
    • Include Payroll Driver with reference to Country- Specific modules which inturn includes Country-specific Schemas etc.
    • Get the PERNRs for which you want to obtain payroll results.
    • Populate Results Directory RGDIR with PERNR & Molga (Country) calling FM CU_READ_RGDIR.
    • Get the Unique Sequential Number with PERNR, From Date & Last Date calling CD_READ_LAST.
    • Pass these KEY Field (PERNR, SEQNR) to IMPORT MACRO
    RP-IMP-C2- RU to import all the relevant field entries from PCL2
    DIRECTORY to all the cluster tables
    • Get the required fields by looping through cluster tables.
    Integration
    All data is stored in internal tables and saved in files with a cluster structure.
    Internal Tables: Internal tables store data during payroll.
    The system imports data to these tables and used them to calculate new data. This data is then also saved in internal tables.
    At the start of the payroll run, the system reads the values from the results tables to the old results table (ORT). Data from the previous period is, therefore, available in the current payroll period.
    The most important internal tables are:
    • Input table (IT)
    Table IT contains data that can be edited. The table exists only during processing.
    •• Output table (OT)
    Table OT contains the results of an activity. These results are written to the input table for further processing. The table exists only during processing.
    •• Results table (RT)
    Table RT contains the results of the period for which payroll has been run. The system saves this data in the PCL2 file in cluster RX.
    Interaction of IT, OT and RT:
    The necessary data for the respective processing step is loaded into the input table and is thus available for various processing procedures. The results of a processing step are stored either in the output table or the results table. At the end of a processing step, the data from the OT is loaded back into the IT, where it is available for further processing steps. The IT and OT are only temporarily filled, whereas the RT is stored on the database. In one of the first processing steps, the RT of the last payroll accounting period is imported into the old results table (ORT) and can consequently be used for further processing.
    Payroll Relevant Files:
    Payroll files contain data for payroll and payroll results.
    Structure
    The system requires the following files for payroll:
    • Pnnnn (nnnn = number of the infotype)
    The Pnnnn files contain data that has been entered in the respective infotypes for an employee.
    Example
    P0000 - Actions Infotype
    P0008 - Basic Pay Infotype
    • PCL1
    The PCL1 file contains primary information, in other words, data from the master data and time recording systems.
    • PCL2
    The PCL2 file contains secondary information, in other words, derived data and all generated schemas
    Integration
    When you start payroll, the system imports the relevant master data from the Pnnnn files (for example, basic pay and tax class) and imports the time data from the PCL1 file to the IT table.
    The system imports the payroll results from the previous month from table ORT (for example, to form averages).
    The system processes this data and saves the payroll results and generated schemas in the PCL2 file.
    Payroll Control
    Edited by: Alvaro Tejada Galindo on Apr 8, 2008 5:09 PM

  • READ separate WAGETYPES

    Hi All,
    I'm having several wagetypes here, but they're for 2 business plans. My selection screen has 2 radio buttons for 2 business plan.
    Is there any way I can get a sample piece of code telling how to read 2 kinds of wagetypes of 2 different business plan when on selection screen, user will choose the radio button for each business plan to run?
    All replies will be highly appreciated! thanks in advance.

    Hi,
    Pass the value to the select condition according to the radio button selected.An ABAPER will do this.
    Cheers,
    Manoj.

  • Issue in Creation of XML file from ABAP data

    Hi,
    I need to create a XML file, but am not facing some issues in creation of XML file, the in the required format.
    The required format is
    -<Header1 1st field= u201CValueu201D 2nd field= u201CValueu201D>
       - <Header2 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 10 fields>
              <Header3 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
              <Header4  1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 4 fields/.>
               <Header5 1st field= u201CValueu201D 2nd field= u201CValueu201Du2026u2026. Upto 6 fields/>
          </Header2>
       </Header1>
    Iu2019m using the call transformation to convert ABAP data to XML file.
    So please anybody can help how to define XML structure in transaction XSLT_TOOL.
    And one more thing, here I need to put the condition to display the Header 3, Header 4, Header 5 values. If there is no record for a particular line item in header 3, 4 & 5, I donu2019t want to display full line items; this is only for Header 3, 4 & 5.
    Please help me in this to get it resolved.

    Hello,
    you can use CALL TRANSFORMATION id, which will create a exact "print" of the ABAP data into the XML.
    If you need to change the structure of XML, you can alter your ABAP structure to match the requirements.
    Of course you can create your own XSLT but that is not that easy to describe and nobody will do that for you around here. If you would like to start with XSLT, you´d better start the search.
    Regards Otto

  • Logical command in ABAP.....Urgent

    Hi,
      i am pretty new using ABAP program so i neeed help urgently. i am trying to move a file on the application server from one directory to the other and i was using the open dataset function to do that. but the file i am trying to move is pretty big and because i am using internal table to store, it is causing problems with the space.
      i have consulted the basis guys and they have managed to create a logical file for copying from one directory to the other on the application server. to help you furthter. i am enclosing the mail sent to me.
    I have created a logical command which should copy the file from one location to the other but you need to pass it the source dir and file name and the destination dir and file name.
    The logical command is ZCOPY and uses cmd /c copy
    Copies one or more files to another location.
    COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
         [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
      source       Specifies the file or files to be copied.
      /A           Indicates an ASCII text file.
      /B           Indicates a binary file.
      destination  Specifies the directory and/or filename for the new file(s).
      /V           Verifies that new files are written correctly.
      /N           Uses short filename, if available, when copying a file with a
                   non-8dot3 name.
      /Y           Suppresses prompting to confirm you want to overwrite an
                   existing destination file.
      /-Y          Causes prompting to confirm you want to overwrite an
                   existing destination file.
      /Z           Copies networked files in restartable mode.
    The switch /Y may be preset in the COPYCMD environment variable.
    This may be overridden with /-Y on the command line.  Default is
    to prompt on overwrites unless COPY command is being executed from
    within a batch script.
    the problem now is i have no idea about how to use the logical command. can any one help me.
    Thank you,
    Ravi.

    If memory is not an issue, then there should be no reason why this should not work.
    report zrich_0001.
    parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.txt',
                d2 type localfile default '/usr/sap/TST/SYS/Data2.txt'.
    data: itab type table of string with header line.
    start-of-selection.
    * Read old file
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into itab.
          if sy-subrc <> 0.
            exit.
          endif.
          append itab.
        enddo.
      endif.
      close dataset d1.
    * Write to new file
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
    * Delete the old file
      delete dataset d1.
    Regards,
    Rich Heilman

  • Logical Database in Abap Objects

    Hi to All
    I want do it a program report using a Logical Database.
    Is this possible ??? But when I make a GET <node>, occurs the following error:
             "" Statement "ENDMETHOD" missing.  ""
    I'm doing the following:
    CLASS MONFIN IMPLEMENTATION.
           METHOD TRAER_DATOS.
                   GET VBRK.
           ENDMETHOD.
    ENDCLASS.
    Please, somebody tell me how I use the logical database in Abap Objects.
    Thank you very much
    Regards
    Dario R.

    Hi there
    Logical databases whilst of "some use" are not really part of OO.
    If you want to use a logical database in an abap OO program I would create a special class which just does the get data from your DB and pass this either at record or table level.
    Techniques such as GET XXXX LATE aren't really part of any OO type of application since at Object Instantiation time you should be able to access ALL the attributes of that object.
    As far as OO is concerned Logical databases are a throwback to "Dinosaur Technology".
    Since however modules such as SD and FI are still heavily reliant on relational structures (i.e linked tables etc)  then there is still some limited life in this stuff but for OO try and solve it by another method.
    If you really must use this stuff in OO then do it via a FMOD call and save the data in a table which your method will pass back to your application program.
    You can't issue a GET command directly in a method.
    Cheers
    Jimbo

  • LOGICAL DATABASE IN HR ABAP PRPGRAMMING

    Hi Friends,
    what is use of LOGICAL DATABASE IN HR ABAP PROGRAMMING
    AND END-OF-SELECTION EVENT IN HR PROGRAMMING PROGRAMMING???
    regards,
    vijay.

    hi
    HR Logical Databases
    In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets:
    PNP (PNPCE)
    PAP
    PCH
    By selecting a logical database, you determine the HR data that can be reported on using an InfoSet.
    Logical Database PCH
    This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data.
    Logical Database PNP (or PNPCE)
    Use logical database PNP to report on HR master data. It is possible to use logical database PCH to access this data, but PNP meets such reporting requirements more quickly because it is best suited to the task of selecting persons.
    Logical database PNP enables you to access HR master data and infotypes from Personnel Planning. For example, you have the following options:
    Reporting on the costs, number of attendees booked, and instructor for a business event on which an employee is booked
    Reporting on working time and planned compensation for a position that an employee occupies
    Reporting on the validity and proficiency of a qualification that an employee fulfils
    From a technical perspective, this means you can use PNP to report on all of the infotypes that exist for objects (infotype 1000) that have a direct relationship (infotype 1001) with the Person object.
    The ability to access infotypes from Personnel Planning using logical database PNP is a special feature that you can only use in the context of SAP Query and Ad Hoc Query. You cannot use this functionality for ABAP reports you programmed yourself.
    You can also use logical database PNP to report on data from Personnel Time Management (infotypes 2000 to 2999) and Payroll (special payroll infotypes for the USA and customer infotypes; for more information, access Customizing for the Human Resources Information System and see Payroll Results).
    Logical Database PAP
    Logical database PAP enables you to access data from Recruitment.
    regards
    navjot
    reward if helpfull

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • ABAP-- diff between sy-sy-tabix and sy-index

    Hi Guru's,
    Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
    Because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa TRANSPORTING currcode. )  in the syntax and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX  sy-tabix FROM scarr_wa TRANSPORTING currcode.) in the syntax.
    in both cases its working fine but i am not getting which one i have to use  where to modify the internal table?
    regards
    SATYA

    Hi Henry,
    SY-INDEX is the value of the current iteration. It is applicable for the following programming constructs in ABAP -
    DO...ENDDO.
    WHILE...ENDWHILE.
    SY-TABIX (TABle IndeX) is applicable to internal tables. If you scroll down in the link which Eddie has given, you will find a more detailed explanation for sy-tabix and which statements affect its value.
    Regards,
    Anand Mandalika.

  • Comas(,) are not getting displayed in the output while using OO ABAP

    Hi All,
    I am using ABAP objects to display the ALV report in which there is a requirement to output Quantity fields. The Quantity fields are getting displayed without comas ','. Please help me in getting back the comas in the output.
    Eg:
    Below logic is used in my program.
    Class name: cl_salv_form_layout_grid
    Code:
      obj_footer->create_text(
            row    = v_row_cnt
            column = v_col_cnt
            text   = Quantity).
    Expected output:
    39,545.000
    Current Output:
    39545.000
    Thanks in advance for your help.
    Thanks & Regards,
    Siva.

    Hi,
    Please check if the images are in the server and in the /images alias path.
    thanks,
    Sharmila

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • Sale order before the regeneration of ABAP report: RSM13000

    Hi there,
    I am just wondering about something.
    After we installed support packages, users could not get any sales order without to get any error message and I we could only see  an error message via SM21 which says:
    Run-time error "LOAD_TYPEPOOL_VERSION_MISMATCH" occurred.
    So after we regenerated the ABAP report: RSM13000 after that everythings seems to be ok.
    Now the question is: When we try to find the order numbers which the users created  before the regeneration we find nothing.
    What about this numbers? Did they have not been created at all or what hapened? They customer is asking now.
    Thanks in advance
    Hanseatik

    I still do not know. We created them again

Maybe you are looking for

  • Help finding deleted emails

    I am a new user to Mail 5. I had imported all of my mail boxes and emails from Entourage -- several years worth. Subsequent to that I have switched ISPs which required some adjustments to how email accounts were accessed. I had continuing problems wi

  • How to redefine function keys in forms 10g

    i want to redefine function keys, for example i want to open LOV by pressing F9 not Ctl + L in forms 10g. can any one help me. zulfiqar

  • 10.4.9 combo updater, sound problem

    Installed the 10.4.9 combo updater and everything seems fine except the sound volume is wierd. Watching stuff like videos the volume is way to loud. Have to turn down the setting all the way. Strange.... lenn

  • Cairngorm & Problems with Shared Components

    Thanks in advance for any help. I still consider myself a newbie, so please excuse any stupid errors that I make in describing the problem I am having. I am working on a Cairngorm app, the framework of which has been handed to me. I have a component

  • Can't make/recieve calls, can't run OS Doctor

    I seem to be having the problem all of a sudden where my Pre isn't making or taking calls, and I tried running WebOS doctor but when I clicked the download button, I got the "404" error. I have the updated version of Java, so that's not the issue, bu