Abap Coding in HCM Module

Hi All,
Can any one send me  link where i can study about coding in HCM Module
Thanks

Hi,
Have a look at this material link:
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PYINT_PROGRAMM.pdf
Raviiiiiiiiiiii

Similar Messages

  • Back ground job needed to scheduled immedietly using ABAP coding

    is there anything in ABAP coding in JOB_OPEN and JOB_SUBMIT, i can trigger immedtiely ,i need not to goto SM#& and do manualy
    please help me in this
    thanking you 'sridhar

    Hi,
    I use parameter STRTIMMED  with function module JOB_CLOSE.
      CALL FUNCTION 'JOB_OPEN'
        EXPORTING
          jobname          = local_job-jobname
        IMPORTING
          jobcount         = local_job-jobcount
        EXCEPTIONS
          cant_create_job  = 1
          invalid_job_data = 2
          jobname_missing  = 3
          OTHERS           = 4.
    SUBMIT abap
              WITH param = p_param AND RETURN TO SAP-SPOOL
                    VIA JOB local_job-jobname NUMBER local_job-jobcount
                  WITHOUT SPOOL DYNPRO
                  DESTINATION 'ZMD'
                  IMMEDIATELY ' '
                  KEEP IN SPOOL 'X'.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = local_job-jobcount
            jobname              = local_job-jobname
            strtimmed            = 'X'
            targetserver         = w_sys
    Cheers
    Allan

  • What is difference among F5 and F6 and F7 in ABAP coding?

    what is difference among F5 and F6 and F7 in ABAP coding ?  Can u give me any example regarding this thread ?

    Some additional info which can be quite helpful.
    a watchpoint is an indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point. Unlike breakpoints, however, watchpoints are not activated until the contents of a specified field change. Watchpoints, like dynamic breakpoints, are user-specific, and so do not affect other users running the same program. You can only define watchpoints in the Debugger.
    Use
    You set watchpoints in the Debugger to monitor the contents of specific fields. They inform you when the value of a field changes. When the value changes, the Debugger interrupts the program.
    Features
    · You can set up to five watchpoints in a program.
    See also Setting Watchpoints.
    · You can also specify the conditions under which a watchpoint is to become active.
    · You can specify a logical link for up to five (conditional) watchpoints.
    See also Specifying Logical Links.
    · You can define watchpoints as either local or global. If you define a global watchpoint, it is active in all called programs. Local watchpoints are only active in
    the specified program.
    · You can change and delete watchpoints.
    See Changing Watchpoints
    · You can use watchpoints to display changes to the references of strings, data and object references, and internal tables.
    See Memory Monitoring with Watchpoints
    Breakpoints
    Apart from being able to execute an ABAP program in the Debugger, you can also start the Debugger call by the choosing a breakpoint. This is achieved by setting one or more of these breakpoints in the program. A breakpoint is a signal at a particular point in the program that tells the ABAP runtime processor to interrupt processing and start the Debugger. The Debugger is activated when the program reaches this point.
    There is also a special kind of breakpoint called a watchpoint. When you use watchpoints, the Debugger is not activated until the contents of a particular field change. For more information, refer to the chapter Watchpoints.
    Breakpoint Variants
    The Debugger contains different breakpoint variants:
    Static
    A user-specific breakpoint is inserted in the source code as an ABAP statement using the keyword BREAK-POINT. A non user-specific breakpoint is set in the ABAP Editor using the BREAK user name statement.
    Directly set
    dynamic breakpoints
    Can be set in the ABAP Editor or the Debugger by double-clicking a line, for example. Dynamic breakpoints are always user-specific, and are deleted when you log off from the R/3 System.
    Breakpoints
    at statements
    The Debugger stops the program immediately before the specified statement is executed.
    Breakpoints
    at subroutines
    The Debugger stops the program immediately before the specified subroutine is called.
    Breakpoints at function modules
    The Debugger stops the program immediately before the specified function module is called.
    Breakpoints at methods
    The Debugger stops the program immediately before the specified method is called.
    Breakpoints at exceptions and system exceptions
    The Debugger stops the program immediately after a system exception, that is, after a runtime error has been intercepted.
    Static Breakpoints
    Static breakpoints are always user-independent if there is no specification of a user name. Once a user has inserted the statement BREAK-POINT or BREAK name in an ABAP program, the system always interrupts the program at that point for that user or only for the user name. This procedure is only useful in the development phase of an application when program execution is always to be interrupted at the same place. For more information, refer to the chapter Static Breakpoints.
    In HTTP sessions, a static breakpoint is skipped if you did not set additional dynamic HTTP breakpoints in the editor of a BSP page. Instead, a corresponding system log entry is written, which can be checked using transaction SM21.
    Dynamic Breakpoints
    Dynamic breakpoints are user-specific. Therefore, you should use them if you only want the program to be interrupted when you run it yourself, not when it is being executed by other users. All dynamic breakpoints are deleted when you log off from the R/3 System.
    Dynamic breakpoints are more flexible than static breakpoints because you can deactivate or delete them at runtime. They have the following advantages:
    · You do not have to change the program code.
    · You can set them even when the program is locked by another programmer.
    · You can define a counter that only activates the breakpoint after it has been reached.
    Special dynamic breakpoints are useful when you want to interrupt a program directly before a particular ABAP statement, a subroutine, or an event, but do not know exactly where to find it in the source code. Event here is used to refer to the occurrence of a particular statement, for example, or calling up a method. Special dynamic breakpoints are user-specific. You can only set them in the Debugger. For more information, refer to the chapter Dynamic Breakpoints.
    In HTTP sessions, the system stops both at static and dynamic breakpoints if a dynamic breakpoint was set in the editor of a BSP page before program execution.
    Lifetime and Transfer of Breakpoints
    A static breakpoint remains intact as long as the BREAK-POINT or BREAK-POINT name statement is not removed from the source code. Without saving, dynamic breakpoints only remain intact in the relevant internal session. However, they remain in effect during the entire user session if they are saved by choosing the menu path Breakpoints ® Save in the ABAP Debugger. For more details on the subject of user sessions and modes, refer to Modularization Techniques in the ABAP keyword documentation.
    If you call an HTTP session during a user session, only the HTTP breakpoints are loaded when the HTTP session is started. You activate HTTP debugging in the ABAP Editor by choosing Utilities ® Settings ® HTTP Debugging. Depending on the setting, the system then displays either the HTTP or standard breakpoints in the Editor.
    If you call an update session during a user session, breakpoints that were defined beforehand in the calling processing unit are copied to the new update session, where they can be displayed under Breakpoints. If, in the ABAP Debugger, you check Update Debugging under Settings and then, for example, call the update module func using CALL FUNCTION func IN UPDATE TASK, a new window is opened in which you can debug this function module in the update session. All the breakpoints that were set in the calling processing unit can also be processed here.
    we can keep them at :
    Statements
    Subroutines
    Function Module Calls
    at Methods
    System Exceptions
    break point :
    we can start debugging from that point or if we keep break point at some place we can directly got ot htat point using f6.
    watch point: for example if we have to check the output for 4000 records based on a field value i.e.for vendor number 'in'we have to check then we will create watchpoint on field LIFNR value '2000'. then we can directly go to vendor whose numbe ris 2000

  • ABAP Coding for RFC inputs

    Hi,
    I am new to ABAP coding. I use the WebDynpro ABAP . In that I need to call a RFC and get the data into the portal. I need to pass some input paramer to RFC. How could I do in the ABAP programming ?
    thanks
    Suresh

    Hi suresh,
    What you are asking is a not a wdbdynpro specific doubt but it is more related to abap.So i think you need to get some information about creating and using FM and RFC  in abap.
    Well i would just try to give you the steps that you should follow.
    Step 1) Create a function module by using T CODE se37 make it remote enable i.e make it a RFC (you will ust need to check a radio button in properties tab)
    Step 2) In rfc try to define the importing and exporting parameters and write your logic in the coding section.
    Step 3) After creating RFC successully now u craete your webdynpro component and create a view inside the component.In view accrding to your business requirement you call this RFC in any of the methods i.e either in hooks methods or your custom methods .And pass the parameters to that rfc and get the results from the rfc.
    Well i think i have just given you the overview of the process so while development if get any problem feel free to ask
    regards
    PG

  • FM to get ABAP Coding

    Hi,
    is there a function module to get the source of a abap report or program?
    Regards,
    Anton

    Hi,
    because i must read the abap coding, make same modifications and create the report new.
    And at the moment, i read the coding directly from database.
    Regards,
    Anton

  • What is LUW? How do we use it in SAP ABAP coding?

    Hi Friends,
    Kindly explain me what is LUW with examples and how do we use it in our ABAP coding with scenarios why and when we use it?
    Regards,
    Pradeep

    Hi,
    SAP LUW
    Die Verbuchungsverwaltung
    The Open SQL statements INSERT, UPDATE, MODIFY, and DELETE allow you to program database changes that extend over several dialog steps. Even if you have not explicitly programmed a database commit, the implicit database commit that occurs after a screen has been processed concludes the database LUW. The following diagram shows the individual database LUWs in a typical screen sequence:
    Under this procedure, you cannot roll back the database changes from previous dialog steps. It is therefore only suitable for programs in which there is no logical relationship between the individual dialog steps.
    However, the database changes in individual dialog steps normally depend on those in other dialog steps, and must therefore all be executed or rolled back together. These dependent database changes form logical units, and can be grouped into a single database LUW using the bundling techniques listed below.
    A logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW is called an SAP LUW. Unlike a database LUW, an SAP LUW can span several dialog steps, and be executed using a series of different work processes. If an SAP LUW contains database changes, you should either write all of them or none at all to the database. To ensure that this happens, you must include a database commit when your transaction has ended successfully, and a database rollback in case the program detects an error. However, since database changes from a database LUW cannot be reversed in a subsequent database LUW, you must make all of the database changes for the SAP LUW in a single database LUW. To maintain data integrity, you must bundle all of you database changes in the final database LUW of the SAP LUW. The following diagram illustrates this principle:
    Database Logical Unit of Work (LUW)
    From the point of view of database programming, a database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it was in before the transaction started.
    The database changes that occur within a database LUW are not actually written to the database until after the database commit. Until this happens, you can use a database rollback to reverse the changes. In the R/3 System, database commits and rollbacks can be triggered either implicitly or using explicit commands.
    Implicit Database Commits in the R/3 System
    A work process can only execute a single database LUW. The consequence of this is that a work process must always end a database LUW when it finishes its work for a user or an external call. Work processes trigger an implicit database commit in the following situations:
    When a dialog step is completed
    Control changes from the work process back to the SAP GUI.
    When a function module is called in another work process (RFC).
    Control passes to the other work process.
    When the called function module (RFC) in the other work process ends.
    Control returns to the calling work process.
    When a WAIT statement interrupts the work process.
    Control passes to another work process.
    Error dialogs (information, warning, or error messages) in dialog steps.
    Control passes from the work process to the SAP GUI.
    Explicit Database Commits in the R/3 System
    There are two ways to trigger an explicit database commit in your application programs:
    Call the function module DB_COMMIT
    The sole task of this function module is to start a database commit.
    Use the ABAP statement COMMIT WORK
    This statement starts a database commit, but also performs other tasks (refer to the keyword documentation for COMMIT WORK).
    Implicit Database Rollbacks in the R/3 System
    The following cases lead to an implicit database rollback:
    Runtime error in an application program
    This occurs whenever an application program has to terminate because of an unforeseen situation (for example, trying to divide by zero).
    Termination message
    Termination messages are generated using the ABAP statement MESSAGE with the message type A or X. In certain cases (updates), they are also generated with message types I, W, and E. These messages end the current application program.
    Explicit Database Rollbacks in the R/3 System
    You can trigger a database rollback explicitly using the ABAP statement ROLLBACK WORK. This statement starts a database rollback, but also performs other tasks (refer to the keyword documentation for COMMIT WORK).
    From the above, we can draw up the following list of points at which database LUWs begin and end.
    A Database LUW Begins
    Each time a dialog step starts (when the dialog step is sent to the work process).
    Whenever the previous database LUW ends in a database commit.
    Whenever the previous database LUW ends in a database rollback.
    A Database LUW Ends
    Each time a database commit occurs. This writes all of the changes to the database.
    Each time a database rollback occurs. This reverses all of the changes made during the LUW.
    Database LUWs and Database Locks
    As well as the database changes made within it, a database LUW also consists of database locks. The database system uses locks to ensure that two or more users cannot change the same data simultaneously, since this could lead to inconsistent data being written to the database. A database lock can only be active for the duration of a database LUW. They are automatically released when the database LUW ends. In order to program SAP LUWs, we need a lock mechanism within the R/3 System that allows us to create locks with a longer lifetime (refer to The R/3 Locking Concept).
    The bundling technique for database changes within an SAP LUW ensures that you can still reverse them. It also means that you can distribute a transaction across more than one work process, and even across more than one R/3 System. The possibilities for bundling database changes within an SAP LUW are listed below:
    The simplest form of bundling would be to process a whole application within a single dialog step. Here, the system checks the user’s input and updates the database without a database commit occurring within the dialog step itself. Of course, this is not suitable for complex business processes. Instead, the R/3 Basis system contains the following bundling techniques.
    Bundling using Function Modules for Updates
    If you call a function module using the CALL FUNCTION... IN UPDATE TASK statement, the function module is flagged for execution using a special update work process. This means that you can write the Open SQL statements for the database changes in the function module instead of in your program, and call the function module at the point in the program where you would otherwise have included the statements. When you call a function module using the IN UPDATE TASK addition, it and its interface parameters are stored as a log entry in a special database table called VBLOG.
    The function module is executed using an update work process when the program reaches the COMMIT WORK statement. After the COMMIT WORK statement, the dialog work process is free to receive further user input. The dialog part of the transaction finishes with the COMMIT WORK statement. The update part of the SAP LUW then begins, and this is the responsibility of the update work process. The SAP LUW is complete once the update process has committed or rolled back all of the database changes.
    For further information about how to create function modules for use in update, refer to Creating Function Modules for Database Updates
    During the update, errors only occur in exceptional cases, since the system checks for all logical errors, such as incorrect entries, in the dialog phase of the SAP LUW. If a logical error occurs, the program can terminate the update using the ROLLBACK WORK statement. Then, the function modules are not called, and the log entry is deleted from table VBLOG. Errors during the update itself are usually technical, for example, memory shortage. If a technical error occurs, the update work process triggers a database rollback, and places the log entry back into VBLOG. It then sends a mail to the user whose dialog originally generated the VBLOG entry with details of the termination. These errors must be corrected by the system administrator. After this, the returned VBLOG entries can be processed again.
    For further information about update administration, see Update Administration
    This technique of bundling database changes in the last database LUW of the SAP LUW allows you to update the database asynchronously, reducing the response times in the dialog work process. You can, for example, decouple the update entirely from the dialog work process and use a central update work process on a remote database server.
    Bundling Using Subroutines
    The statement PERFORM ON COMMIT calls a subroutine in the dialog work process. However, it is not executed until the system reaches the next COMMIT WORK statement. Here, as well, the ABAP statement COMMIT WORK defines the end of the SAP LUW, since all statements in a subroutine called with PERFORM ON COMMIT that make database changes are executed in the database LUW of the corresponding dialog step.
    The advantage of this bundling technique against CALL FUNCTION... IN UPDATE TASK is better performance, since the update data does not have to be written into an extra table. The disadvantage, however, is that you cannot pass parameters in a PERFORM... ON COMMIT statement. Data is passed using global variables and ABAP memory. There is a considerable danger of data inconsistency when you use this method to pass data.
    Bundling Using Function Modules in Other R/3 Systems
    Function modules that you call using CALL FUNCTION... IN BACKGROUND TASK DESTINATION... are registered for background execution in another R/3 System when the program reaches the next COMMIT WORK statement (using Remote Function Call). After the COMMIT WORK, the dialog process does not wait for these function modules to be executed (asynchronous update). All of the function modules that you register in this way are executed together in a single database LUW. These updates are useful, for example, when you need to maintain identical data in more than one database.
    For further details, refer to the keyword documentation.
    For more details of RFC processing, refer to the Remote Communications section of the Basis Services documentation.
    Pls. reward if useful....

  • How to use BRF plus application in abap programs (Report or Module pool)

    Hi All,
    I have created an BRF plus application through FDT_WORKBENCH to calculate bonus of the employee with the help of SDN tutorial.
    Now my concern is that how can i use this application in my report.
    I have also read in the tutorial that we can create BRF plus application through ABAP coding but my question is, if i created an application through FDT_WORKBENCH then how can i use it in my ABAP report.
    Thanks a lot in advance.
    Regards,
    Sheelesh

    Hi,
    CALLING BRF+ FROM ABAP REPORT PROGRAM :
    I think the program may be helpful for you guys.
    *CALLING THE BRF+ FROM ABAP REPORT PROGRAM :
    REPORT Z_BRFPLUS_REPORT_01.
    PARAMETERS : P_SEL TYPE STRING .
    TYPES : BEGIN OF TYPE_PRICE ,
            NUMBER TYPE DECFLOAT16 ,
            CURRENCY TYPE STRING ,
            END OF TYPE_PRICE .
    DATA : LO_FUNCTION      TYPE REF TO     IF_FDT_FUNCTION ,
           LO_CONTEXT       TYPE REF TO     IF_FDT_CONTEXT ,
           LO_RESULT        TYPE REF TO     IF_FDT_RESULT .
    DATA : LO_MESSAGE TYPE REF TO CX_FDT .
    FIELD-SYMBOLS : <FS_PRODUCT> TYPE IF_FDT_TYPES=>S_MESSAGE .
    DATA : PRODUCT TYPE STRING ,
           LS_PRICE TYPE TYPE_PRICE .
    CLEAR LS_PRICE .
    PRODUCT = P_SEL .
    TRY .
    * GET THE BRF PLUS FUNCTION .
      LO_FUNCTION ?= CL_FDT_FACTORY=>IF_FDT_FACTORY~GET_INSTANCE( )->GET_FUNCTION('0050569E629D1ED39DD2090294D9A5BD' ) .
    * SET THE BRFPLUS FUNCTION CONTEXT .
      LO_CONTEXT = LO_FUNCTION->GET_PROCESS_CONTEXT( ) .
      LO_CONTEXT->SET_VALUE( IV_NAME = 'PRODUCT' IA_VALUE = PRODUCT ) .
    * PROCESS THE BRF PLUS FUNCTION .
      LO_FUNCTION->PROCESS(
                   EXPORTING
                     IO_CONTEXT = LO_CONTEXT
                   IMPORTING
                     EO_RESULT = LO_RESULT   ) .
    * RETRIEVE THE BRF PLUS FUNCTION RESULT .
      LO_RESULT->GET_VALUE(
                    IMPORTING
                      EA_VALUE = LS_PRICE ) .
    WRITE : LS_PRICE-NUMBER ,
            / LS_PRICE-CURRENCY .
    CATCH CX_FDT INTO LO_MESSAGE .
    ENDTRY .
    Thanks & Regards,
    Joyjit Biswas

  • ABAP coding issues after BW upgrade

    Hello Gurus,
    We recently did a BW upgrade from version 3.5 to 7.31 and even since have been encountering few strange issues with many of our ABAP coding.
    For example, there is an APPEND statement in one of our Update Rules as below:
    APPEND <lw_rtab_wa> TO <lt_rtab>.
    Before upgrade, this was working as expected and the contents of <lw_rtab_wa> was getting transferred to <lt_rtab> without any issues.
    Now after upgrade, we find that the contents of <lw_rtab_wa> is being clubbed together in the 1st few columns of <lt_rtab>.
    Both the <lw_rtab_wa> & <lt_rtab> have the same fields, but the length of few fields in <lt_rtab> is bigger than that in <lw_rtab_wa>. For example DOC_NUMBER in <lw_rtab_wa> is of type C(10) while in <lt_rtab> it is C(20). This difference is causing the data of the 2nd field also to be over-writen in the DOC_NUMBER field of <lt_rtab>.
    Please let us know if you have encountered similar situations after your BW upgrade. Any possible solutions to this would be very much appreciated as this is causing PROD issues at the moment!
    Thanks
    Arvind

    Hi Arvind,
    After Upgrade In BW 7.3 or higher versions All data elements that use the domain RSCHAVL are converted from CHAR60 to SSTRING. thats the reason you are getting that syntax error.
    Take help of some ABAP programmer and try to change the syntax as suggested from below link.
    Just scroll down and check the same. even though link shows for BW 7.4 issues, its applicable for 7.3 too. Please let me know
    http://scn.sap.com/community/data-warehousing/bw/blog/2014/07/28/sap-bw-74-analysis-issues
    Thanks
    Ajay

  • ABAP coding in defining start condition for action.

    Hi Everybody,
    Can anyone tell me if ABAP coding is possible for giving condition for action? If yes, where? Is it in condition editor? I have 3 validations to be done:- 1) Filter service contract (transaction type USC), 2) Filter the active contracts, 3) Filter contracts which doesn't have billing cycle in current month.
    So, do you think these validations can be done in start condition of action? First two validations are static in nature and thus can be done. But, how about the last condition?
    Please help.
    Regards,
    Sanj.

    Hi Sanj
    I would do this.
    1. The transaction type cannot be changed, therfore I will set this up in the scheduling condition.
    2. Active contracts. Depends on teh definiton of active. If it is based on some status then I will use scheduling condition.
    3. use one of the dates in the date profile to determine if the billing date is in the current month or not.
    See if this helps.
    Thanks

  • ABAP coding in LSMW

    Hi All,
    A)Is it possible to  write ABAP coding in LSMW, if yes where can we do this. and
    B)During the First Step of LSMW we come across 1. Standard/Batch Direct Input
                                                                          2.Batch input recording
                                                                          3.Business Object Method (BAPI)
                                                                          4.IDOC(intermediate document)
    which one to use and when to use?
    C) what are the advantages/disadvantages of LSMW compared to other data transfer methods like BDC.
    please let me know the answers for above.
    useful answers will be rewarded for the same.
    Regards,
    Yellappa.

    hi
    for q posed to ashvinder, its used only for validation of the input records and their corresponding processing, i will explain a simple scenario,
    1. if u want to transfer data a part of which has already been created in the system. You
    want to decide at runtime whether the data is created or changed.
    u can write this coding in corresponding field
    2. You want to "skip" a record depending on a certain condition, i.e. this record shall not be converted and transferred to the output file.
    3. Duplicate a Record
    If want complex pricing procedures u cant do that in LSMW, u need to go for BDC's
    for ur question about what to use, BAPI or IDOC, check this link
    http://www.sap-img.com/abap/ale-bapi.htm
    http://searchsap.techtarget.com/generic/0,295582,sid21_gci1089362,00.html?bucket=ETA&topic=299357
    award points if found helpful
    Message was edited by:
            Rahul Kavuri

  • Performance of ABAP coding very poor

    Hi gurus,
    I'm a newbie in ABAP programming.
    Currently, I managed to write an ABAP coding for BW to load data from a source DSO to target DSO.
    We are using BW 3.5.
    In the source, we have YTD amount as Key Figures.
    In the start routine, we use ABAP coding to calculate the Monthly value and Last 12 Months value.
    Monthly value is defined as: current month YTD - last month YTD (except when current month = January, then monthly value for January = YTD value for January)
    Last 12 months value is calculated for example as follow:
    for March 08, then Last 12 months value is April 07-March08
    Thus the formula for last 12 Months value is:
               YTD current month current year + YTD month12 last year - YTD current month last year
    I used internal table to read and store all of the information
    However, I need to read 3 times from internal table to get all of the necessary value to calculate the monthly value and last 12 months value.
    The performance is very low. The system runs for 40 minutes to read and calculate 15500 data.
    Therefore if you can perhaps give some hint/tip/tricks how to improve the performance of the code, it will be highly appreciated.
    Thank you very much in advance.
    Best regards,
    Fen
    My code is as follow:
    Define internal table to hold last year & current year data:
      DATA: LCYEARDATA type sorted table of /bic/aZABC3_O00
            with unique key /BIC/ZABC_ENTI /BIC/ZABC_ACC
            /BIC/ZABC_SUBA /BIC/ZABC_VERS CALMONTH
            with header line.
    Create variables needed to hold last month/year values.
      DATA: CALMONTHLOW TYPE /BI0/OICALMONTH.
      DATA: CALMONTHHIGH TYPE /BI0/OICALMONTH.
      DATA: CALYEARTHISYEAR TYPE /BI0/OICALYEAR.
      DATA: CALYEARLASTYEAR TYPE /BI0/OICALYEAR.
      DATA: CURRENTMONTH TYPE /BI0/OICALMONTH2.
      DATA: CURRENTMONTHLASTYEAR TYPE /BI0/OICALMONTH.
      DATA: LASTMONTH TYPE /BI0/OICALMONTH.
      DATA: CALMONTH12LASTYEAR TYPE /BI0/OICALMONTH.
      DATA: LASTMOYTD type /BI0/OIAMOUNT.
      DATA: LAST12MONTH TYPE /BI0/OIAMOUNT.
      DATA: YTDLASTYEAR type /BI0/OIAMOUNT.
      DATA: FIRSTRUN type N.
      DATA: MONTHLYVALUE type /BI0/OIAMOUNT.
      DATA: YTDMONTHLASTYEAR type /BI0/OIAMOUNT.
      DATA: AMOUNT type /BI0/OIAMOUNT.
    Set initial value of all variables to 0.
      CALMONTHLOW = 0.
      CALMONTHHIGH = 0.
      CALYEARTHISYEAR = 0.
      CALYEARLASTYEAR = 0.
      CURRENTMONTH = 0.
      CURRENTMONTHLASTYEAR = 0.
      LASTMONTH = 0.
      LASTMOYTD = 0.
      LAST12MONTH = 0.
      YTDLASTYEAR = 0.
      YTDMONTHLASTYEAR = 0.
      FIRSTRUN = 0.
      MONTHLYVALUE = 0.
      CALMONTH12LASTYEAR = 0.
    Loop through data package.
      LOOP AT DATA_PACKAGE.
        IF DATA_PACKAGE IS NOT INITIAL.
    First run:
          IF FIRSTRUN = 0.
    Get current year from any line in the data package.
            CALYEARTHISYEAR = DATA_PACKAGE-CALMONTH(4).
            FIRSTRUN = 1.
          ENDIF.
    Calculate last year (i.e. data package year - 1).
            CALYEARLASTYEAR = CALYEARTHISYEAR - 1.
    Calculate current month
            CURRENTMONTH = DATA_PACKAGE-CALMONTH+4(2).
    *Set CALMONTHLOW and CALMONTHHIGH as time period to fill the internal
    *table:
            CONCATENATE CALYEARLASTYEAR CURRENTMONTH INTO CALMONTHLOW.
            CONCATENATE CALYEARTHISYEAR CURRENTMONTH INTO CALMONTHHIGH.
    Fill internal table with Last Years data and Current Year data:
            select *
              from /bic/aABC2_O00
              into table LCYEARDATA
              WHERE CALMONTH >= CALMONTHLOW
                AND CALMONTH <= CALMONTHHIGH
                AND /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                AND /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                AND /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                AND /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS.
    Continue with the looping
    Get last month from current month.
            LASTMONTH = DATA_PACKAGE-CALMONTH - 1.
    *CHECK IF CURRENTMONTH = JAN then LastmonthYTD amount = 0, else read
    *from the internal table.
    *CURRENTMONTH = DATA_PACKAGE-CALMONTH+4(2). (this variable has been set
    *above)
            IF CURRENTMONTH = '01'.
              LASTMOYTD = 0.
            ELSE.
              READ TABLE LCYEARDATA
                WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                  CALMONTH = LASTMONTH.
              IF sy-subrc IS INITIAL.
                LASTMOYTD = LCYEARDATA-AMOUNT.
              ENDIF.
            ENDIF.
    *Calculate Monhtly value for this month (to later be stored in data
    *package)
            MONTHLYVALUE = DATA_PACKAGE-AMOUNT - LASTMOYTD.
    Count value for Last 12 Months:
    1: Get the YTD Month12 Last Year & YTD CurrentMonth Last Year.
            CONCATENATE CALYEARLASTYEAR CURRENTMONTH INTO
            CURRENTMONTHLASTYEAR.
            CONCATENATE CALYEARLASTYEAR '12' INTO CALMONTH12LASTYEAR.
            READ TABLE LCYEARDATA
               WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                 CALMONTH = CALMONTH12LASTYEAR.
            IF sy-subrc IS INITIAL.
              YTDLASTYEAR  = LCYEARDATA-AMOUNT.
            ENDIF.
            READ TABLE LCYEARDATA
              WITH KEY
                /BIC/ZABC_ENTI = DATA_PACKAGE-/BIC/ZABC_ENTI
                /BIC/ZABC_ACC = DATA_PACKAGE-/BIC/ZABC_ACC
                /BIC/ZABC_SUBA = DATA_PACKAGE-/BIC/ZABC_SUBA
                /BIC/ZABC_VERS = DATA_PACKAGE-/BIC/ZABC_VERS
                CALMONTH = CURRENTMONTHLASTYEAR.
            IF sy-subrc IS INITIAL.
              YTDMONTHLASTYEAR  = LCYEARDATA-AMOUNT.
            ENDIF.
    2. Specify YTD This month.
        AMOUNT = DATA_PACKAGE-AMOUNT.
    *3: Last 12 Months = (YTD Last Year - YTD Month Last Year) + YTD This
    *Month
           LAST12MONTH = YTDLASTYEAR - YTDMONTHLASTYEAR + YTDTHISMONTH.
           LAST12MONTH = YTDLASTYEAR - YTDMONTHLASTYEAR + AMOUNT.
    Save MONTHLYVALUE and LAST12MONTH to the DATA_PACKAGE.
            DATA_PACKAGE-/BIC/ZAMTMO = MONTHLYVALUE.
            DATA_PACKAGE-/BIC/ZAMTLTM = LAST12MONTH.
            modify DATA_PACKAGE.
            ENDIF.
          ENDLOOP.
        ABORT = 0.

    Hi,
    Just check these blogs to improve performance...
    The SQL Trace (ST05) u2013 Quick and Easy
    The SQL Trace (ST05) – Quick and Easy
    The ABAP Runtime Trace (SE30) - Quick and Easy
    The ABAP Runtime Trace (SE30) -  Quick and Easy
    Regards,
    Sachin

  • Docs for ABAP coding for BW

    Hello Gurus,
    I need some documents or links where i can find enough info to learn abt ABAP coding in transfer, update rules, ABAP routine in infopackage and in the start routine etc. Can any one help me with this?
    Looking for some basic concepts of ABAP.
    Thank you,
    Kumar
    [email protected]

    Hi,
    Please check the following links that may be useful for you.
    http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4493c4a6-0301-0010-62a2-efd6ded61e04https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/60cecb1d-0a01-0010-8289-b14fd99062fa
    http://www.bwexpertonline.com/downloads/ABAPCodeforRuvinskyarticle.doc
    http://www.bwexpertonline.com/downloads/Extractor_Source_Code.doc
    http://www.bwexpertonline.com/downloads/Nissen.doc
    https://www.sdn.sap.com/irj/sdn/abap
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.sapgenie.com/faq/abap.htm
    Regards,
    ®

  • To implement SAP HCM module in existing SAP ECC 6.0

    Hi,
    I have SAP ECC 6.0 system already implemented 2 years back.
    I am planning to implement SAP HCM with OM, PA, SAP Time management, SAP PAYROLL in existing SAP ECC 6.0 system.
    I have currently 3 system landscape for SAP ECC.
    I would like to know what change/addition is required in above landscape to implement SAP HCM module in existing SAP ECC 6.0
    Do share your view.
    Regards.

    Hi.
    As per you, Already designed Landscape. Why dont you follow you existing Landscape which is alredy proved for other modules.
    Normally Dev/Quality/Production clients will there..
    If more that depends upon flexibility in Each client and defining different business for testing and production interfaces purpose.
    Better use Existing only remaining modules already sucessfully running in Production Right????

  • ABAP Program or Function Module to activate infospoke/openhub table

    Hi,
    Post migration to production, when i am trying to load the data in open hub table, its showing OH table is not active. i had tried to all aspect but i am unable to load the data.
    is there any ABAP Program or Function Module to activate infospoke/openhub table
    Thanks & Regards,
    Pankaj Bansal

    Hello Pankaj,
    Please check whether you have access to TCode SE14 . If Yes , You can use this TCode to activate the Tables.
    There are lot of  Posts talk about the procedure for activation through SE14. please refer the same
    Thanks & regards,
    Prasath

  • ABAP Object or function module?

    Hello all!
    I have to create a reusable routine. This routine should be select data from Z table for to get data with a parameter ID. I will pass a ID and expect result a internal table with some parameter values.
    So, my question is: What i use for to do that? ABAP Object or function module?
    I think that so easy to use function module. Why i should to use ABAP objects? What is positive points in use object and not function module?
    For me, both do the same thing... i don't see any difference. Just object is more complicated.
    Please, tell me why should i use object??
    Edited by: Rodrigo Kenji Matsunaga on Dec 10, 2009 5:51 PM

    I would go with Class.
    Read through this discussion:
    Needing Evidence on the Advantages of ABAP OO
    Class would provide you a flexibility of inheritance. E.g. if you want to use the same data selection with little modification in your other applications, you can inherit some other class form this class. Redefine the method, call the Super's method and change the output before sending back to the caller.
    Regards,
    Naimesh Patel

Maybe you are looking for

  • Iphone turns on and turns off

    i turn on m iphone 2g it is starting up then when it should let me slide to unlock it goes black (turns off) what should i do.

  • Photoshop element12won"t switch to the editor worspace?

    photoshop element12 won"t switch to the editor workspace ?

  • 3gs wont turn on or restore code 9

    my iphone 3gs wont power on the button is broke and i tried to restore it and its saying error code 9 how do i fix this?

  • Can't delete 'Flock'

    I downloaded the browser 'Flock' and then decided I don't like it. I then put it in the trash and emptied it, but it said: The operation can't be completed because the item "classic.jar" is in use. Any help would be greatly appreciated. Thank you.

  • Trouble streaming videos on Amazon

    Why am I having so much trouble streaming instant videos on Amazon when I have the updated version of Adobe Flash Player as prompted by Amazon and my computer? It keeps starting and stopping and reloading and asking me to update my flash player.