To Store more than 99 Hrs

Hi ALL,
Could anyone tell me, by using the Char InfoObject with the DataType (TIMS HH:MM:SS), can I store more than 99 hrs, i.e 100:00:00?

Hi Mahesh,
The maximum value you can display using a TIMS field is 23:59:59 (internally 86399). If you try to load a value 86400, it will be displayed as 00:00:00. 86401 will be as 00:00:01 and it goes on...
And if you want to display any value more than 23:59:59, you will have to use an info object of CHAR type of bigger length (>8). And you will have to write a routine to load value in format hhh:mm:ss.
In the routine, you can use the stmts like
sec = value mod 60.
value = (value - sec) / 60.
min = value mod 60.
hour = (value - min) / 60.
then you can concatenate the values into the result field by inserting ':' b/w them.
check the logic, i dint try it. I was in a hurry... 
Regards,
BIJESH

Similar Messages

  • Is there a datatype that allows me to store more than one item at a time

    Hello Everyone,
    Is there a datatype that allows me to store more than one item at a time , in a column in a row?
    I have to prepare a monthly account purchase system. Basically in this system a customer purchases items in an entire month as and when required on credit and then pays at the end of the month to clear the dues. So, i need to search the item from the inventory and then add it to the customer. So that when i want to see all the items purchased by a customer in the current month i get to see them. Later i calculate the bill and then ask him to pay and flushout old items which customer has purchased.
    I am having great difficulty in preparing the database.
    Please can anyone guide me! i have to finish this project in a weeks time.
    Item Database:
    SQL> desc items;
    Name Null? Type
    ITEMID VARCHAR2(10)
    ITEMCODE VARCHAR2(10)
    ITEMPRICE NUMBER(10)
    ITEMQUAN NUMBER(10)
    Customer Database:
    SQL> desc customerdb;
    Name Null? Type
    CUSTID VARCHAR2(10)
    CUSTFNAME VARCHAR2(20)
    CUSTLNAME VARCHAR2(20)
    CUSTMOBNO NUMBER(10)
    CUSTADD VARCHAR2(20)
    I need to store for every customer the items he has purchased in a month. But if i add a items purchased by a customer to the customer table entries look this.
    SQL> select * from customerdb;
    CUSTID CUSTFNAME CUSTLNAME CUSTMOBNO CUSTADD ITEM ITEMPRICE ITEMQUANTITY
    123 abc xyz 9988556677 a1/8,hill dales soap 10 1
    123 abc xyz 9988556677 " toothbrush 18 1
    I can create a itempurchase table similar to above table without columns custfname,csutlnamecustmobno,custadd
    ItemPurchaseTable :
    CUSTID ITEM ITEMPRICE ITEMQUANTITY
    123 soap 10 1
    123 toothbrush 18 1
    ill just have it as follows. But still the CUSTID FK from CustomerDB repeats for every row. I dont know how to solve this issue. Please can anyone help me.
    I need to map 1 customer to the many items he has purchased in a month.
    Edited by: Yukta Lolap on Oct 8, 2012 10:58 PM
    Edited by: Yukta Lolap on Oct 8, 2012 11:00 PM

    You must seriously read and learn about Normalization of tables; It improves your database design (at times may increase or decrease performance, subjective cases) and eases the Understanding efforts for a new person.
    See the below tables and compare to the tables you have created
    create table customers
      customer_id       number      primary key,
      fname             varchar2(50)  not null,
      mname             varchar2(50),
      lname             varchar2(50)  not null,
      join_date         date          default sysdate not null,
      is_active         char(1)     default 'N',
      constraint chk_active check (is_active in ('Y', 'N')) enable
    create table customer_address
      address_id        number      primary key,
      customer_id       number      not null,
      line_1            varchar2(100)   not null,
      line_2            varchar2(100),
      line_3            varchar2(100),
      city              varchar2(100)   not null,
      state             varchar2(100)   not null,
      zip_code          number          not null,
      is_active         char(1)         default 'N' not null,
      constraint chk_add_active check (is_active in ('Y', 'N')),
      constraint fk_cust_id foreign key (customer_id) references customers(customer_id)
    create table customer_contact
      contact_id        number      primary key,
      address_id        number      not null,
      area_code         number,
      landline          number,
      mobile            number,
      is_active         char(1)   default 'N' not null,
      constraint chk_cont_active check (is_active in ('Y', 'N'))
      constraint fk_add_id foreign key (address_id) references customer_address(address_id)
    create table inventory
      inventory_id          number        primary key,
      item_code             varchar2(25)    not null,
      item_name             varchar2(100)   not null,
      item_price            number(8, 2)    default 0,
      item_quantity         number          default 0,
      constraint chk_item_quant check (item_quantity >= 0)
    );You may have to improvise and adapt these tables according to your data and design to add or remove Columns/Constraints/Foreign Keys etc. I created them according to my understanding.
    --Edit:- Added Purchases table and sample data;
    create table purchases
      purchase_id           number        primary key,
      purchase_lot          number        unique key  not null,     --> Unique Key to map all the Purchases, at a time, for a customer
      customer_id           number        not null,
      item_code             number        not null,
      item_price            number(8,2)   not null,
      item_quantity         number        not null,
      discount              number(3,1)   default 0,
      purchase_date         date          default sysdate   not null,
      payment_mode          varchar2(20),
      constraint fk_cust_id foreign key (customer_id) references customers(customer_id)
    insert into purchases values (1, 1001, 1, 'AZ123', 653, 10, 0, sysdate, 'Cash');
    insert into purchases values (2, 1001, 1, 'AZ124', 225.5, 15, 2, sysdate, 'Cash');
    insert into purchases values (3, 1001, 1, 'AZ125', 90, 20, 3.5, sysdate, 'Cash');
    insert into purchases values (4, 1002, 2, 'AZ126', 111, 10, 0, sysdate, 'Cash');
    insert into purchases values (5, 1002, 2, 'AZ127', 100, 10, 0, sysdate, 'Cash');
    insert into purchases values (6, 1003, 1, 'AZ123', 101.25, 2, 0, sysdate, 'Cash');
    insert into purchases values (7, 1003, 1, 'AZ121', 1000, 1, 0, sysdate, 'Cash');Edited by: Purvesh K on Oct 9, 2012 12:22 PM (Added Price Column and modified sample data.)

  • Is it normal if it takes more than 5 hrs to download and process ios 5 and backup in itunes (syncing)

    is it normal if it takes more than 5 hrs to download and process ios 5 and backup in itunes (syncing)

    Hi Thaimic,
    Thanks for your reply.
    IP Adddress: 192.168.0.101
    Subnetmask: 255.255.255.0
    Router: 192.168.0.7
    DNS: 180.168.255.118, 192.168.1.1
    These are my WLAN details.under DHCP and BootP. Could you please tell me what to do with the DNS ? I do not have idea about the DNS.

  • Data Load taking more than 24 hrs

    Hi All,
    We are in the process of loading the data from R3 to BW. It’s taking more than 24hrs to load 1 yr data. This is because of complexity of ABAP code its taking this much time. We did all the possible ways to improve the performance of the code. But no luck.
    In case if the same thing happened in the production system, then how should I forward with the data load as it’s taking more than 24 hrs for 1 yr data.
    I m Planning to load int with out data transfer 1st and then Full load.
    Please correct if I m wrong.
    Thanks,
    RS.

    Hi,
    where is your ABAP code complexity loacted? in R/3 or in BW?
    Are you talking about loading in empty cube taking long time? extraction time?
    Analyze the different steps in your monitor and tell us where is the bottleneck;
    If you already know the above and you have performed all the tunings (e.g. number range buffereing when filling an empty cube...) then you're correct; init without data and then full loads.
    As suggested you could segment your full loads and even run them in paralel...
    hope this helps...
    Olivier.

  • Can I store more than One value in HashMap using Same kay?

    Hi,
    I want to store more than one value in HashMap using same key................. is it possible?
    If yes, then please give me source code for that.....
    Thankx in Adv.......

    I want to store more than one value in HashMap using >same key................. is it possible?I don't think so
    Message was edited by:
    manuel.leiria

  • 10g BLOB/CLOB can we store more than 4k in SQL

    Dear Friends
    I know we had issues with BLOB and CLOB storing more than 4k in Oracle 8i using SQL. Is it the same in 10g BLOB/CLOB can we store more than 4k in SQL?
    Please help me with some documentationw which explains these aspects with CLOB and BLOB in 10g
    Thanks
    Farouk

    Thanks for your help,
    I understand we can store blobs more than 4k in 10g using DBMB_LOG but there is a constraint in 8i that using SQL u can store directly only 4k and using a bind variable in PL/SQL we can store upto 32K. Is that the same in 10g or can we store directly using sql more than 4k?
    Thanks
    Farouk

  • CAT!!! I kept my player for more than 7 hrs for the initial cha

    Hi Cat,
    I have kept my zen v plus for more than 7 hrs for the initial charge, still the Play icon not appeared on the display, its showing still the battery charging flash icon.
    TELL ME WHAT TO DO?
    Thanks & Regds,
    2CREATIVE

    Depends on how strong your wifi connection is.
    you can try a reset hold down the home/sleep button together until you see the apple logo and then release.

  • HT1351 i can not store more than 7 gb data in my ipod classic 7 gen 120gb

    i can not store more than 7 gb data in my ipod classic 7 gen 120gb

    See Corrupt iPod classic. What do you see for the stats?
    tt2

  • I can not store more than 7 gb data in my ipod classic 7 gen 120gb

    i can not store more than 7 gb data in my ipod classic 7 gen 120gb

    See Corrupt iPod classic. What do you see for the stats?
    tt2

  • Jobs taking more than 3 hrs to complete!!!

    i have a job which creates indexes..
    the job used to get completed within 28 mins..
    however yesterday it took more than 3 hrs and still running..any ideas ??

    however yesterday it took more than 3 hrs Start by checking the execution plans for the historical SQL and ensure that they are the save (see dba_hist_sqlplan). If the execution plans changed, that's a big clue.
    It could be several things:
    - Did you re-analyze stats recently?
    - Could there be contention for data blocks?
    Run a STATSPACK report for both time periods, and you should be able to see the exact issue.
    Hope this helps. . .
    Donald K. Burleson
    Oracle Press author

  • I ried to reset my iphone its taking more than 12 hrs still going on,

    i tried to reset my iphone its taking more than 12 hrs still going on,How much ususally it takes to rest the i-phone.

    yes it is quite normal, simply dont worry.

  • Anyone else getting MORE than 24 hrs on their rentals?

    Just as the subject says, I was wondering if anyone else getting more than 24 hrs on their rentals? So far I have gotten to play my rented movie for over 24 hours. I checked and the file is still on my hard drive. I assume I am not continuing to pay for this movie, but who knows?

    It happened to us with the only movie we've rented so far. I had been fooling around with the iMac remote trying to figure out why I couldn't start the movie with that, when iTunes crashed (a first for me!!). So the next day when I discovered the countdown timer was off, I assumed that crash must have affected the time stamp on it. The movie stayed around for at least 48 hours after we first started it, then disappeared as expected.

  • Mail send to  employee even worked for more than 45 hrs

    Hi All,
    We have developed functionality in which if employee works less than 45 hrs then mail is triggered to that employee.
    But the issue is sometimes mail is triggered to some employees even if he worked more than 45 hrs.
    We tried to create a same scenario in quality and development but mail is not triggered in that case.
    Please find the below code.
    Please let me is it because of not clearing wa_time variable???
    GET peras.
      rp_provide_from_last p0000 space sy-datum sy-datum. "latest p0000 record
      IF p0000-stat2 EQ '3'.
        rp_provide_from_last p0001 space sy-datum sy-datum."latest p0001 record
        IF p0001-bukrs EQ '***'.
          rp_read_infotype peras-pernr 2001 p2001 gv_beg  gv_end.
          rp_read_infotype peras-pernr 2002 p2002 gv_beg  gv_end.
          rp_read_infotype peras-pernr 2006 p2006 '18000101' sy-datum.
          IF rb1 EQ 'X'.
            n = 1.
          ELSEIF rb2 EQ 'X'.
            n = 5.
          ENDIF.
          CLEAR : gv_cntr,gv_dat,gv_week.
          gv_dat = gv_beg.
          DO n TIMES.
            IF gv_dat  GT gv_end.
              gv_week = n - 1.
              EXIT.
            ENDIF.
            gv_cntr = gv_cntr + 1.
            IF  gv_cntr GT 1 .
    *          gv_beg = gv_beg + 2.
              gv_dat =  gv_dat + 2.
            ENDIF.
            DO 5 TIMES .
    *          if rb2 eq 'X'.
              IF gv_dat  LE gv_end.
    *            endif.
                READ TABLE it_time INTO wa_time WITH KEY pernr = p0001-pernr
                                                         ldate = gv_dat
                                                         satza = 'P10'.
                IF sy-subrc EQ '0'.
                  gv_in = wa_time-ltime.
                  READ TABLE it_time INTO wa_time WITH KEY pernr = p0001-pernr
                                                        ldate = gv_dat
                                                        satza = 'P20'.
                  IF sy-subrc EQ '0'.
                    gv_out = wa_time-ltime.
                    gv_time =  gv_time + ( gv_out - gv_in )  .
    *                CALL FUNCTION 'MONI_TIME_CONVERT'
    *                  EXPORTING
    *                    ld_duration        = gv_time
    *                  IMPORTING
    *                    lt_output_duration = gv_tot.
    *gv_tote = gv_tot.
    *   gv_total = gv_total  +  gv_tote.
    *    clear : gv_tot,gv_tote.
    **CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    **  EXPORTING
    **    input                      =  gv_time
    ***   NO_TYPE_CHECK              = 'X'
    ***   ROUND_SIGN                 = ' '
    **   UNIT_IN                    = 'S'
    **   UNIT_OUT                   = 'H'
    ** IMPORTING
    ***   ADD_CONST                  =
    ***   DECIMALS                   =
    ***   DENOMINATOR                =
    ***   NUMERATOR                  =
    **   OUTPUT                     =  gv_total
    ** EXCEPTIONS
    **   CONVERSION_NOT_FOUND       = 1
    **   DIVISION_BY_ZERO           = 2
    **   INPUT_INVALID              = 3
    **   OUTPUT_INVALID             = 4
    **   OVERFLOW                   = 5
    **   TYPE_INVALID               = 6
    **   UNITS_MISSING              = 7
    **   UNIT_IN_NOT_FOUND          = 8
    **   UNIT_OUT_NOT_FOUND         = 9
    **   OTHERS                     = 10
    **IF sy-subrc <> 0.
    *** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    **ENDIF.
    *                CALL FUNCTION 'POINT_IN_TIME_CONVERT'
    *                  EXPORTING
    **   KZ_ENDTERMIN        = ' '
    *                    point_in_time       = gv_time
    *                 IMPORTING
    **   DATE                =
    *                   time                = gv_hours."actual working hours
    *                gv_total = gv_total + gv_hours.
                    gv_punch = 'X'.
                    CLEAR wa_final.
                    CLEAR :gv_out,gv_in,gv_hours.
                  ENDIF.
                ENDIF.
                IF gv_punch IS  INITIAL .
                  LOOP AT p2001 WHERE pernr EQ peras-pernr AND begda LE gv_dat AND endda GE gv_dat.
    *              gv_total = gv_total + 090000.
                    gv_time = gv_time + 32400.
                    gv_abs = 'X'.
                  ENDLOOP.
                ENDIF.
                IF gv_punch IS INITIAL AND   gv_abs IS INITIAL.
                  LOOP AT p2002  WHERE pernr EQ peras-pernr AND begda LE gv_dat AND endda GE gv_dat.
                    gv_time = gv_time + 32400.
                    gv_prs = 'X'.
    *              gv_total = gv_total + 090000.
                  ENDLOOP.
                ENDIF.
    *            PERFORM holiday_check USING gv_dat.
                IF gv_punch IS INITIAL AND gv_abs IS INITIAL AND gv_prs IS INITIAL.
                  CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
                    EXPORTING
                      date                = gv_dat
                      holiday_calendar_id = 'HM'
                    IMPORTING
                      holiday_found       = gv_ind.
                  IF gv_ind  EQ 'X'.
                    gv_time = gv_time + 32400.
                  ENDIF.
                  CLEAR gv_ind.
                ENDIF.
                CLEAR :gv_punch, gv_abs ,gv_prs.
                gv_dat = gv_dat + 1.
                IF gv_dat GT gv_end.
                  EXIT.
                ENDIF.
              ENDIF.
            ENDDO.
            CLEAR : gv_tot,gv_tim.
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_time
              IMPORTING
                lt_output_duration = gv_tot.
    *        IF gv_beg LE gv_end.
            CONCATENATE gv_tot+2(2) gv_tot+5(2) gv_tot+8(2) INTO gv_tim.
            v_dat = ( gv_dat - 1 ).
            wa-awh = wa-awh + gv_time.
            IF  v_dat EQ gv_end.
              wa-pernr = p0001-pernr.
              APPEND wa TO it.
              CLEAR wa.
            ENDIF.
            IF  gv_tim LT c_hrs .
              wa_final-pernr = p0001-pernr.
    *          WA_FINAL-BEGDA = SY-DATUM.
              wa_final-ename = p0001-ename.
    *          wa_final-actual  = gv_time.
              wa_final-diff = gv_45hrs - gv_time.
              wa_final-plans = p0001-plans.
              CLEAR : wa_t001p.
              READ TABLE it_t001p INTO wa_t001p WITH KEY werks = p0001-werks
                                                         btrtl = p0001-btrtl.
              IF sy-subrc EQ 0.
                wa_final-dept = wa_t001p-btext.
              ENDIF.
              CLEAR gv_org.
              PERFORM org_text.
              wa_final-divsn = gv_org.
              wa_final-werks = p0001-werks.
              wa_final-sacha =  p0001-sachp.
              IF wa_final-diff GT 0.
                APPEND wa_final TO it_final.
              ENDIF.
              CLEAR wa_final.
            ENDIF.
    *        ENDIF.
            CLEAR : gv_time ,gv_hours.
            CLEAR gv_tot.
            CLEAR : gv_total.
          ENDDO.
          CLEAR gv_cntr.
    *    ENDIF.
        ENDIF.
      ENDIF.
    *  CLEAR gv_beg.
    END-OF-SELECTION.

    Hi Ketul,
    Still i'm facing the same issue even after clearing wa_time variable.Sometime it's triggering and sometimes it not.
    I'm attaching the whole code for your reference. Pls let me know.
    Waiting for your reply.
    Thanks!!!!!!!!
    CODE:
    REPORT  zhr_vwgsipl_pt_wrknghrs.
    INCLUDE zhr_vwgsipl_wrkng_hrs_top. "data declaration
    INCLUDE zhr_vwgsipl_wrkng_hrs_init.
    INCLUDE zhr_vwgsipl_wrkng_hrs_process. " PROCESSING.
    INCLUDE zhr_vwgsipl_wrkng_hrs_display ."DISPLAY
    *&      Form  ORG_TEXT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM org_text .
      CALL FUNCTION 'HR_READ_FOREIGN_OBJECT_TEXT'
        EXPORTING
          otype                         = 'O'
          objid                         = p0001-orgeh
          costcenter                    = p0001-kostl
    *   CONTROLLINGAREA               =
         status                        = '1'
         begda                         = '18000101'
         endda                         = '99991231'
         reference_date                = sy-datum
         langu                         = sy-langu
       IMPORTING
    *   SHORT_TEXT                    =
         object_text                   = gv_org
    *     costcenter_name               = gv_cst
    *   INTEGRATION_ACTIVE            =
    *   RETURN                        =
       EXCEPTIONS
         nothing_found                 = 1
         wrong_objecttype              = 2
         missing_costcenter_data       = 3
         missing_object_id             = 4
         OTHERS                        = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " ORG_TEXT
    & Include           ZHR_VWGSIPL_WRKNG_HRS_INIT
    IF rb1 EQ 'X'.
    *   IF pn-begda IS  INITIAL.
       IF sy-batch EQ 'X'.
         gv_beg = sy-datum - 4."sy-datum  - 5.
         gv_end = sy-datum.
       ELSE.
         gv_beg = pn-begda.
         gv_end = pn-endda.
       ENDIF.
    ELSEIF rb2 EQ 'X'.
       IF sy-batch NE 'X'." IS NOT  INITIAL.
         gv_beg = pn-begda.
         gv_end = pn-endda.
         CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
             date = gv_beg
           IMPORTING
             day  = gv_day.
         IF gv_day LT 5.
           gv_beg = gv_beg - gv_day + 1 .
         ELSEIF gv_day EQ 5 .
           gv_beg =  gv_beg + 3.
         ELSEIF gv_day EQ  6.
           gv_beg =  gv_beg + 2.
         ELSEIF gv_day EQ  7.
           gv_beg =  gv_beg + 1.
         ENDIF.
         CLEAR gv_day.
         CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
             date = gv_end
           IMPORTING
             day  = gv_day.
         IF gv_day LT 5.
           gv_end =  gv_end - gv_day - 2.
         ELSEIF gv_day EQ 5.
           gv_end =  gv_end.
         ELSEIF gv_day EQ 6.
           gv_end =  gv_end - 1.
         ELSEIF gv_day EQ 7.
           gv_end =  gv_end - 2.
         ENDIF.
    *   ENDIF.
    * ENDIF.
       ELSE.
         IF sy-datum+4(2) NE '01'.
           gv_mnth = sy-datum+4(2) - 01."c_date+4(2) - 1."sy-datum+4(2) - 1.
         ELSE.
           gv_mnth = 12.
         ENDIF.
         CONCATENATE sy-datum+0(4) gv_mnth  sy-datum+6(2) INTO gv_beg.
         CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
             date = gv_beg
           IMPORTING
             day  = gv_day.
         IF gv_day LT 5.
           gv_beg = gv_beg - gv_day + 1 .
         ELSEIF gv_day EQ 5 .
           gv_beg =  gv_beg + 3.
         ELSEIF gv_day EQ  6.
           gv_beg =  gv_beg + 2.
         ELSEIF gv_day EQ  7.
           gv_beg =  gv_beg + 1.
         ENDIF.
         CLEAR gv_day.
         CALL FUNCTION 'DATE_COMPUTE_DAY'
           EXPORTING
             date = sy-datum
           IMPORTING
             day  = gv_day.
         IF gv_day LT 5.
           gv_end =  sy-datum - gv_day - 2.
         ELSEIF gv_day EQ 5.
           gv_end =  sy-datum.
         ELSEIF gv_day EQ 6.
           gv_end =  sy-datum - 1.
         ELSEIF gv_day EQ 7.
           gv_end =  sy-datum - 2.
         ENDIF.
       ENDIF.
    ENDIF.
    CLEAR : it_time,it_receiver,it_usrid,it_t001p.
    SELECT pernr ldate ltime satza
           FROM teven INTO TABLE it_time
           WHERE pernr IN pnppernr AND
          ldate BETWEEN  gv_beg AND gv_end
               AND stokz NE 'X'.
    SELECT pernr subty usrid  usrid_long
       FROM pa0105 INTO TABLE it_receiver
             WHERE "pernr IN pnppernr
              " AND subty = '0010'
                endda >= gv_end
               AND begda <= gv_end.
    SORT it_receiver BY pernr.
    *clear wa_admin.
    *      select single werks sachz
    *        from pa0001
    *        into  wa_admin
    *        where pernr in wa_final-pernr
    *         and endda >= sy-datum
    *                and begda <= sy-datum.
    SELECT  werks sachx usrid
       FROM t526 INTO TABLE it_usrid.
    * SELECT pernr usrid  usrid_long
    * FROM pa0105 INTO TABLE it_ccreceiver
    *   FOR ALL ENTRIES IN it_usrid
    *       WHERE usrid EQ it_usrid-usrid
    *         AND subty = '0010'
    *         AND endda >= gv_end
    *         AND begda <= gv_end.
    SELECT werks btrtl btext  FROM t001p
        INTO TABLE it_t001p
        WHERE werks IN pnpwerks
        AND btrtl IN pnpbtrtl.
    *&  Include   ZHR_VWGSIPL_WRKNG_HRS_PROCESS
    GET peras.
      rp_provide_from_last p0000 space sy-datum sy-datum. "latest p0000 record
      IF p0000-stat2 EQ '3'.
        rp_provide_from_last p0001 space sy-datum sy-datum."latest p0001 record
        IF p0001-bukrs EQ '2680'.
          rp_read_infotype peras-pernr 2001 p2001 gv_beg  gv_end.
          rp_read_infotype peras-pernr 2002 p2002 gv_beg  gv_end.
          rp_read_infotype peras-pernr 2006 p2006 '18000101' sy-datum.
          IF rb1 EQ 'X'.
            n = 1.
          ELSEIF rb2 EQ 'X'.
            n = 5.
          ENDIF.
          CLEAR : gv_cntr,gv_dat,gv_week.
          gv_dat = gv_beg.
          DO n TIMES.
            IF gv_dat  GT gv_end.
              gv_week = n - 1.
              EXIT.
            ENDIF.
            gv_cntr = gv_cntr + 1.
            IF  gv_cntr GT 1 .
    *          gv_beg = gv_beg + 2.
              gv_dat =  gv_dat + 2.
            ENDIF.
            DO 5 TIMES .
    *          if rb2 eq 'X'.
              IF gv_dat  LE gv_end.
    *            endif.
                READ TABLE it_time INTO wa_time WITH KEY pernr = p0001-pernr
                                                         ldate = gv_dat
                                                         satza = 'P10'.
                IF sy-subrc EQ '0'.
                  gv_in = wa_time-ltime.
                  CLEAR : wa_time.
                  READ TABLE it_time INTO wa_time WITH KEY pernr = p0001-pernr
                                                        ldate = gv_dat
                                                        satza = 'P20'.
                  IF sy-subrc EQ '0'.
                    gv_out = wa_time-ltime.
                    gv_time =  gv_time + ( gv_out - gv_in )  .
                     CLEAR : wa_time.
    *                CALL FUNCTION 'MONI_TIME_CONVERT'
    *                  EXPORTING
    *                    ld_duration        = gv_time
    *                  IMPORTING
    *                    lt_output_duration = gv_tot.
    *gv_tote = gv_tot.
    *   gv_total = gv_total  +  gv_tote.
    *    clear : gv_tot,gv_tote.
    **CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
    **  EXPORTING
    **    input                      =  gv_time
    ***   NO_TYPE_CHECK              = 'X'
    ***   ROUND_SIGN                 = ' '
    **   UNIT_IN                    = 'S'
    **   UNIT_OUT                   = 'H'
    ** IMPORTING
    ***   ADD_CONST                  =
    ***   DECIMALS                   =
    ***   DENOMINATOR                =
    ***   NUMERATOR                  =
    **   OUTPUT                     =  gv_total
    ** EXCEPTIONS
    **   CONVERSION_NOT_FOUND       = 1
    **   DIVISION_BY_ZERO           = 2
    **   INPUT_INVALID              = 3
    **   OUTPUT_INVALID             = 4
    **   OVERFLOW                   = 5
    **   TYPE_INVALID               = 6
    **   UNITS_MISSING              = 7
    **   UNIT_IN_NOT_FOUND          = 8
    **   UNIT_OUT_NOT_FOUND         = 9
    **   OTHERS                     = 10
    **IF sy-subrc <> 0.
    *** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    **ENDIF.
    *                CALL FUNCTION 'POINT_IN_TIME_CONVERT'
    *                  EXPORTING
    **   KZ_ENDTERMIN        = ' '
    *                    point_in_time       = gv_time
    *                 IMPORTING
    **   DATE                =
    *                   time                = gv_hours."actual working hours
    *                gv_total = gv_total + gv_hours.
                    gv_punch = 'X'.
                    CLEAR wa_final.
                    CLEAR :gv_out,gv_in,gv_hours.
                  ENDIF.
                ENDIF.
                IF gv_punch IS  INITIAL .
                  LOOP AT p2001 WHERE pernr EQ peras-pernr AND begda LE gv_dat AND endda GE gv_dat.
    *              gv_total = gv_total + 090000.
                    gv_time = gv_time + 32400.
                    gv_abs = 'X'.
                  ENDLOOP.
                ENDIF.
                IF gv_punch IS INITIAL AND   gv_abs IS INITIAL.
                  LOOP AT p2002  WHERE pernr EQ peras-pernr AND begda LE gv_dat AND endda GE gv_dat.
                    gv_time = gv_time + 32400.
                    gv_prs = 'X'.
    *              gv_total = gv_total + 090000.
                  ENDLOOP.
                ENDIF.
    *            PERFORM holiday_check USING gv_dat.
                IF gv_punch IS INITIAL AND gv_abs IS INITIAL AND gv_prs IS INITIAL.
                  CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
                    EXPORTING
                      date                = gv_dat
                      holiday_calendar_id = 'HM'
                    IMPORTING
                      holiday_found       = gv_ind.
                  IF gv_ind  EQ 'X'.
                    gv_time = gv_time + 32400.
                  ENDIF.
                  CLEAR gv_ind.
                ENDIF.
                CLEAR :gv_punch, gv_abs ,gv_prs.
                gv_dat = gv_dat + 1.
                IF gv_dat GT gv_end.
                  EXIT.
                ENDIF.
              ENDIF.
            ENDDO.
            CLEAR : gv_tot,gv_tim.
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_time
              IMPORTING
                lt_output_duration = gv_tot.
    *        IF gv_beg LE gv_end.
            CONCATENATE gv_tot+2(2) gv_tot+5(2) gv_tot+8(2) INTO gv_tim.
            v_dat = ( gv_dat - 1 ).
            wa-awh = wa-awh + gv_time.
            IF  v_dat EQ gv_end.
              wa-pernr = p0001-pernr.
              APPEND wa TO it.
              CLEAR wa.
            ENDIF.
            IF  gv_tim LT c_hrs .
              wa_final-pernr = p0001-pernr.
    *          WA_FINAL-BEGDA = SY-DATUM.
              wa_final-ename = p0001-ename.
    *          wa_final-actual  = gv_time.
              wa_final-diff = gv_45hrs - gv_time.
              wa_final-plans = p0001-plans.
              CLEAR : wa_t001p.
              READ TABLE it_t001p INTO wa_t001p WITH KEY werks = p0001-werks
                                                         btrtl = p0001-btrtl.
              IF sy-subrc EQ 0.
                wa_final-dept = wa_t001p-btext.
              ENDIF.
              CLEAR gv_org.
              PERFORM org_text.
              wa_final-divsn = gv_org.
              wa_final-werks = p0001-werks.
              wa_final-sacha =  p0001-sachp.
              IF wa_final-diff GT 0.
                APPEND wa_final TO it_final.
              ENDIF.
              CLEAR wa_final.
            ENDIF.
    *        ENDIF.
            CLEAR : gv_time ,gv_hours.
            CLEAR: gv_tot,gv_tim.
            CLEAR : gv_total.
          ENDDO.
          CLEAR gv_cntr.
    *    ENDIF.
        ENDIF.
      ENDIF.
    *  CLEAR gv_beg.
    END-OF-SELECTION.
    *&  Include    ZHR_VWGSIPL_WRKNG_HRS_DISPLAY
    CALL FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
      EXPORTING
       begda           = gv_beg
        endda           = gv_end
    *   TAB_MODE        = ' '
    IMPORTING
    *   DAYS            =
       c_weeks         = gv_week
    *   C_MONTHS        =
    *   C_YEARS         =
    *   WEEKS           =
    *   MONTHS          =
    *   YEARS           =
    *   D_MONTHS        =
    *   MONTH_TAB       =
    gv_week = gv_week + 1.
    * CALL FUNCTION 'DATE_COMPUTE_DAY'
    *     EXPORTING
    *       date = gv_end
    *     IMPORTING
    *       day  = gv_day1.
    * if gv_day1 eq '5' or gv_day1 eq
    LOOP AT it_final INTO wa_final."looping at list of employee hvng shrtg.
      CLEAR : gv_diff ,gv_cntr1 , gv_cntr2,gv_upl,gv_upl1.
      IF rb2 EQ 'X'.
        CLEAR : gv_cntr1.
        LOOP AT it_final INTO wa_final WHERE pernr EQ wa_final-pernr .
          gv_diff = gv_diff +  wa_final-diff.   " total shrtg
    *      gv_cntr1 = gv_cntr1 + 1.
        ENDLOOP.
    *    calc no od dyas to be deducted.
        gv_cntr1 = FLOOR( gv_diff / 32400 ) .
        gv_cntr2 = ( gv_diff MOD  32400 ) .
        IF gv_cntr2 IS NOT INITIAL.
          gv_cntr2 = '0.50' .
        ENDIF.
        CLEAR gv_quota.
    *total el quota available.
        LOOP AT p2006 WHERE subty EQ '20' and DESTA le sy-datum  and DEEND ge sy-datum  .
          gv_quota = gv_quota +  p2006-anzhl - p2006-kverb.
          gv_quota = FLOOR( gv_quota ).
        ENDLOOP.
    *leaves to be deducted
        IF gv_cntr1 LE gv_quota.
    *deduction from EL.
          quota-pernr = wa_final-pernr .
          quota-infty = c_infty.
          quota-subty =  c_sub.
          PERFORM holidy_check.
          quota-endda = sy-datum +  gv_cntr1 + gv_no - 1.
          CLEAR gv_no.
          quota-begda = sy-datum.
          quota-awart = c_sub.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
              number = wa_final-pernr.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '2001'
              number        = wa_final-pernr
              subtype       = c_sub
              validityend   = quota-endda
              validitybegin = quota-begda
              record        = quota
              operation     = 'INS'
              tclas         = 'A'
              nocommit      = no_commit
            IMPORTING
              return        = bapireturn
              key           = bapipakey.
          gv_start2 = quota-endda.
    *preparing the list whose leave has been deducted.
          wa_mail-pernr =  wa_final-pernr.
          wa_mail-ename = wa_final-ename.
          wa_mail-divsn = wa_final-divsn.
          wa_mail-dept = wa_final-dept.
          wa_mail-lvdays = gv_cntr1.
          CONCATENATE sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum+0(4) '-' quota-endda+6(2) '.'  quota-endda+4(2) '.' quota-endda+0(4) INTO wa_mail-lvdat.
    *      wa_mail-lvdat = sy-datum.
          wa_mail-lvtyp = 'Earned Leave'.
          IF bapireturn-message IS NOT INITIAL.
            wa_mail-status = bapireturn-message.
          ELSE.
            wa_mail-status = 'Created'.
          ENDIF.
          wa_mail-werks = wa_final-werks.
          wa_mail-sacha = wa_final-sacha.
          gv_plnd = gv_week * 45 * 60 * 60. "total planned working hrs
          CALL FUNCTION 'MONI_TIME_CONVERT'
            EXPORTING
              ld_duration        = gv_plnd
            IMPORTING
              lt_output_duration = wa_mail-plnd.
          CLEAR wa.
          READ TABLE it INTO wa WITH KEY pernr = wa_final-pernr..
          IF wa IS NOT INITIAL.
            gv_actl =  wa-awh . "actual wrkng hrs "gv_plnd - gv_diff. "actual wrkng hrs
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_actl
              IMPORTING
                lt_output_duration = wa_mail-actl.
          ENDIF.
          APPEND wa_mail TO it_mail.
          CLEAR :wa_mail,gv_plnd,gv_actl.
          CLEAR quota .
    *    REFRESH quota.
        ELSE.
          gv_upl = gv_cntr1 - gv_quota.
    *unpaid leave deduction
          IF gv_quota IS NOT INITIAL.
            quota-pernr = wa_final-pernr .
            quota-infty = c_infty.
            quota-subty =  c_sub.
            PERFORM holiday_check1.
            quota-endda = sy-datum + gv_quota + gv_no - 1.
            CLEAR gv_no.
            quota-begda = sy-datum.
            quota-awart = c_sub.
            CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
              EXPORTING
                number = wa_final-pernr.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty                  = '2001'
                number                 = wa_final-pernr
                subtype                = c_sub
    *   OBJECTID               =
    *   LOCKINDICATOR          =
               validityend            = quota-endda
               validitybegin          =  quota-begda
    *   RECORDNUMBER           =
                record                 = quota
                operation              = 'INS'
               tclas                  = 'A'
    *   DIALOG_MODE            = '0'
               nocommit               = no_commit
    *   VIEW_IDENTIFIER        =
    *   SECONDARY_RECORD       =
             IMPORTING
               return                 = bapireturn
               key                    = bapipakey
            gv_start1 = quota-endda.
            wa_mail-pernr =  wa_final-pernr.
            wa_mail-ename = wa_final-ename.
            wa_mail-divsn = wa_final-divsn.
            wa_mail-dept = wa_final-dept.
            gv_quota1 = gv_quota.
            wa_mail-lvdays = gv_quota1.
            CONCATENATE sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum+0(4) '-' quota-endda+6(2) '.'  quota-endda+4(2) '.' quota-endda+0(4) INTO wa_mail-lvdat.
    *        wa_mail-lvdat = sy-datum.
            wa_mail-lvtyp = 'Earned Leave'.
    *        CONCATENATE bapireturn-id
    *               bapireturn-number INTO  wa_mail-status.
            IF bapireturn-message IS NOT INITIAL.
              wa_mail-status = bapireturn-message.
            ELSE.
              wa_mail-status = 'Created'.
            ENDIF.
            wa_mail-werks = wa_final-werks.
            wa_mail-sacha = wa_final-sacha.
            gv_plnd = gv_week * 45 * 60 * 60.
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_plnd
              IMPORTING
                lt_output_duration = wa_mail-plnd.
            CLEAR wa.
            READ TABLE it INTO wa WITH KEY pernr = wa_final-pernr..
            IF wa IS NOT INITIAL.
              gv_actl =  wa-awh . "actual wrkng hrs "gv_plnd - gv_diff. "actual wrkng hrs
              CALL FUNCTION 'MONI_TIME_CONVERT'
                EXPORTING
                  ld_duration        = gv_actl
                IMPORTING
                  lt_output_duration = wa_mail-actl.
            ENDIF.
            APPEND wa_mail TO it_mail.
            CLEAR :gv_plnd,gv_actl,wa_mail.
            CLEAR quota .
    *    REFRESH quota.
            CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
              EXPORTING
                number = wa_final-pernr.
          ENDIF.
    *      gv_upl1 =  CEIL( gv_upl  + gv_cntr2 ).
          IF gv_upl IS NOT INITIAL.
    *Unpaid leave deduction
            quota-pernr = wa_final-pernr .
            quota-infty = c_infty.
            quota-subty =  c_sub1.
    *        quota-stdaz = gv_upl + gv_cntr2 .
            IF gv_start1 IS INITIAL.
              PERFORM holiday_check2.
              quota-endda = sy-datum +  gv_upl + gv_no - 1.
              quota-begda = sy-datum.
              CLEAR gv_no.
            ELSE.
              PERFORM holiday_check3.
              quota-endda = gv_start1 +  gv_upl + gv_no.
              quota-begda = gv_start1 + 1.
              CLEAR gv_no.
            ENDIF.
            quota-awart = c_sub1.
            CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
              EXPORTING
                number = wa_final-pernr.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = '2001'
                number        = wa_final-pernr
                subtype       = c_sub1
                validityend   = quota-endda
                validitybegin = quota-begda
                record        = quota
                operation     = 'INS'
                tclas         = 'A'
                nocommit      = no_commit
              IMPORTING
                return        = bapireturn
                key           = bapipakey.
            CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
              EXPORTING
                number = wa_final-pernr.
            gv_start2 = quota-endda.
            wa_mail-pernr =  wa_final-pernr.
            wa_mail-ename = wa_final-ename.
            wa_mail-divsn = wa_final-divsn.
            wa_mail-dept = wa_final-dept.
            wa_mail-lvdays = gv_upl.
            CONCATENATE quota-begda+6(2) '.' quota-begda+4(2) '.' quota-begda+0(4) '-' quota-endda+6(2) '.'  quota-endda+4(2) '.' quota-endda+0(4) INTO wa_mail-lvdat.
    *        wa_mail-lvdat = quota-begda.
            wa_mail-lvtyp = 'Unpaid Leave'.
    *        CONCATENATE bapireturn-id
    *        bapireturn-number INTO  wa_mail-status.
            IF bapireturn-message IS NOT INITIAL.
              wa_mail-status = bapireturn-message.
            ELSE.
              wa_mail-status = 'Created'.
            ENDIF.
            wa_mail-werks = wa_final-werks.
            wa_mail-sacha = wa_final-sacha.
            gv_plnd = gv_week * 45 * 60 * 60.
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_plnd
              IMPORTING
                lt_output_duration = wa_mail-plnd.
            CLEAR wa.
            READ TABLE it INTO wa WITH KEY pernr = wa_final-pernr..
            IF wa IS NOT INITIAL.
              gv_actl =  wa-awh . "actual wrkng hrs "gv_plnd - gv_diff. "actual wrkng hrs
              CALL FUNCTION 'MONI_TIME_CONVERT'
                EXPORTING
                  ld_duration        = gv_actl
                IMPORTING
                  lt_output_duration = wa_mail-actl.
            ENDIF.
            APPEND wa_mail TO it_mail.
            CLEAR :gv_actl,gv_plnd,wa_mail.
            CLEAR quota.
          ENDIF.
        ENDIF.
    *  half day unpaid leave
        IF gv_cntr2 IS NOT INITIAL.
          quota-pernr = wa_final-pernr .
          quota-infty = c_infty.
          quota-subty =  c_sub1.
          quota-beguz = '090000'.
          quota-enduz = '133000'.
    *      quota-stdaz =  gv_cntr2 .
          IF gv_start2 IS INITIAL.
            PERFORM holiday_check4.
            quota-endda = sy-datum  + gv_no.
            quota-begda = sy-datum + gv_no .
            CLEAR gv_no.
          ELSE.
            PERFORM holiday_check5.
            quota-endda = gv_start2 +  gv_no + 1.
            quota-begda = gv_start2 +  gv_no + 1."gv_start2 + 1.
            CLEAR gv_no.
          ENDIF.
          quota-awart = c_sub1.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
              number = wa_final-pernr.
          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '2001'
              number        = wa_final-pernr
              subtype       = c_sub1
              validityend   = quota-endda
              validitybegin = quota-begda
              record        = quota
              operation     = 'INS'
              tclas         = 'A'
              nocommit      = no_commit
            IMPORTING
              return        = bapireturn
              key           = bapipakey.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              number = wa_final-pernr.
          wa_mail-pernr =  wa_final-pernr.
          wa_mail-ename = wa_final-ename.
          wa_mail-divsn = wa_final-divsn.
          wa_mail-dept = wa_final-dept.
          wa_mail-lvdays = '0.5'.
          CONCATENATE quota-begda+6(2) '.' quota-begda+4(2) '.' quota-begda+0(4) '-' quota-endda+6(2) '.'  quota-endda+4(2) '.' quota-endda+0(4) INTO wa_mail-lvdat.
    *        wa_mail-lvdat = quota-begda.
          wa_mail-lvtyp = 'Unpaid Leave'.
    *        CONCATENATE bapireturn-id
    *        bapireturn-number INTO  wa_mail-status.
          IF bapireturn-message IS NOT INITIAL.
            wa_mail-status = bapireturn-message.
          ELSE.
            wa_mail-status = 'Created'.
          ENDIF.
          wa_mail-werks = wa_final-werks.
          wa_mail-sacha = wa_final-sacha.
          gv_plnd = gv_week * 45 * 60 * 60.
          CALL FUNCTION 'MONI_TIME_CONVERT'
            EXPORTING
              ld_duration        = gv_plnd
            IMPORTING
              lt_output_duration = wa_mail-plnd.
          CLEAR wa.
          READ TABLE it INTO wa WITH KEY pernr = wa_final-pernr..
          IF wa IS NOT INITIAL.
            gv_actl =  wa-awh . "actual wrkng hrs "gv_plnd - gv_diff. "actual wrkng hrs
            CALL FUNCTION 'MONI_TIME_CONVERT'
              EXPORTING
                ld_duration        = gv_actl
              IMPORTING
                lt_output_duration = wa_mail-actl.
          ENDIF.
          APPEND wa_mail TO it_mail.
          CLEAR : gv_plnd,gv_actl,wa_mail.
          CLEAR quota.
        ENDIF.
      ENDIF.
      DELETE it_final WHERE pernr EQ wa_final-pernr.
      IF bapireturn IS  INITIAL.
        READ TABLE it_receiver INTO wa_receiver WITH KEY pernr = wa_final-pernr
                                                          subty = '0010'.
        IF sy-subrc EQ '0'.
          receiver = wa_receiver-usrid_long.
          CLEAR wa_receiver.
        ENDIF.
    *Commented for cc mail to HR.
    *    READ TABLE it_usrid INTO wa_usrid WITH KEY werks = p0001-werks
    *                                               sachx = p0001-sachp.
    *    IF sy-subrc EQ '0'.
    *      READ TABLE it_receiver INTO wa_receiver WITH KEY usrid = wa_usrid-usrid.
    *      IF sy-subrc EQ '0'.
    *        READ TABLE it_receiver INTO wa_receiver WITH KEY pernr = wa_receiver-pernr
    *                                                         subty = '0010'.
    *        IF rb2 EQ 'X'.
    *          cc_reciv = wa_receiver-usrid_long.
    *        ENDIF.
    *      ENDIF.
    *    ENDIF.
        CONCATENATE wa_final-begda+6(2)'.' wa_final-begda+4(2) '.' wa_final-begda+0(4) INTO gv_begda.
        CONCATENATE wa_final-ltime+0(2)'.' wa_final-ltime+2(2)  INTO gv_ltime.
    *  if empid is not initial and employee is not initial and reciever is not initial.
    **------------Create Content--------------------*
        CONCATENATE 'Dear' wa_final-ename INTO hello_emp SEPARATED BY space.
        CONCATENATE hello_emp ',' INTO hello_emp.
        APPEND hello_emp TO content.
        CLEAR: hello_emp.
        APPEND space TO content.
        IF rb1 EQ 'X'.
          APPEND 'This is to inform you that there is a shortfall in your working hours this week. As you are aware,our working hour policy states that an employee needs to work 45 hours a week - that is,'
            TO content.
          APPEND  'an average of nine hours a day including the half-hour lunch break.'  TO content.
        ELSE.
          APPEND 'You have not worked 45 hours in a week and the same is also not regularized till 15th of the current month.' TO content.
        ENDIF.
        APPEND space TO content.
        IF rb1 EQ 'X'.
          APPEND 'It is recommended that you get this done at the earliest, as it could impact your Earned Leaves, and perhaps, even your salary. ' TO content.
          APPEND space TO content.
          APPEND 'All it requires is regularising your attendance which takes just a few minutes via our ESS portal. Here is the link: http:************.' TO content.
          APPEND space TO content.
          APPEND 'If you have any queries, do refer to our Leave Policy or contact HR Team.' TO content.
          APPEND space TO content.
          APPEND space TO content.
          APPEND 'Best Regards,' TO content.
          APPEND space TO content.
          APPEND 'Your HR Team' TO content.
          APPEND space TO content.
          APPEND '**This is an automatically generated mail. Please do not reply to this mail.**' TO content.
    *      APPEND ' You are therefore, advised to regularize your attendance to ensure 45 hours. Failure to do so will lead to deduction of Earned Leave for the shortfall of the absence period.'
    *      TO content.
        ELSE.
          APPEND 'Hence, the short fall of the working hours has been adjusted against your “Earned Leave”.' TO content.
    *    ENDIF.
    *    CONCATENATE hello_emp '.' INTO hello_emp.
          APPEND space TO content.
          APPEND'If, you do not have sufficient quota of Earned Leave, this will be treated as “Unpaid Leave” and salary will be deducted accordingly.' TO content.
          APPEND space TO content.
          APPEND 'For details, please refer the Leave Policy.' TO content.
          APPEND space TO content.
          APPEND 'Kindly use the following link to access the ESS portal to check your “Leaves and Quotas”.' TO content.
          APPEND space TO content.
          APPEND 'http:**************' TO content.
          APPEND space TO content.
          APPEND space TO content.
          APPEND '**This is an automatically generated mail. Please do not reply to this mail.**' TO content.
          APPEND space TO content.
        ENDIF.
    *APPEND'Best Regards,' TO content.
    *APPEND employee TO content.
    **------------Mail trigger----------------------*
        TRY.
            send_request = cl_bcs=>create_persistent( ).
          CATCH cx_send_req_bcs.
        ENDTRY.
        WRITE 'Shortfall of working time' TO subject.
        TRY.
            CALL METHOD cl_document_bcs=>create_document
              EXPORTING
                i_type        = 'RAW'
                i_subject     = subject
    *    i_length      =
    *    i_language    = SPACE
    *    i_importance  =
    *    i_sensitivity =
                i_text        = content
    *    i_hex         =
    *    i_header      =
    *    i_sender      =
              RECEIVING
                result        = mail_doc
          CATCH cx_document_bcs.
        ENDTRY.
        TRY.
            CALL METHOD send_request->set_document
              EXPORTING
                i_document = mail_doc.
          CATCH cx_send_req_bcs .
        ENDTRY.
        TRY.
            CALL METHOD cl_sapuser_bcs=>create
              EXPORTING
                i_user = sy-uname
              RECEIVING
                result = sender.
          CATCH cx_address_bcs .
        ENDTRY.
        TRY.
            CALL METHOD send_request->set_sender
              EXPORTING
                i_sender = sender.
          CATCH cx_send_req_bcs .
        ENDTRY.
        TRY.
            CALL METHOD cl_cam_address_bcs=>create_internet_address
              EXPORTING
                i_address_string = receiver
    *    i_address_name   =
    *    i_incl_sapuser   =
              RECEIVING
                result           = recipient
          CATCH cx_address_bcs .
        ENDTRY.
        CLEAR :receiver.
    *    *Commented for cc mail to HR.
    *    TRY.
    *        CALL METHOD cl_cam_address_bcs=>create_internet_address
    *          EXPORTING
    *            i_address_string = cc_reciv
    **    i_address_name   =
    **    i_incl_sapuser   =
    *          RECEIVING
    *            result           = recipient_cc
    *      CATCH cx_address_bcs .
    *    ENDTRY.
        TRY.
            CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient  = recipient
                i_express    = 'U'
    *    i_copy       =
    *    i_blind_copy =
    *    i_no_forward =
          CATCH cx_send_req_bcs .
        ENDTRY.
    *    TRY.
    *        CALL METHOD send_request->add_recipient
    *          EXPORTING
    *            i_recipient  = recipient_cc
    *            i_express    = 'U'
    *            i_copy       = 'X'
    **    i_blind_copy =
    **    i_no_forward =
    *      CATCH cx_send_req_bcs .
    *    ENDTRY.
        TRY.
            CALL METHOD send_request->set_send_immediately
              EXPORTING
                i_send_immediately = 'X'.
          CATCH cx_send_req_bcs .
        ENDTRY.
        TRY.
            CALL METHOD send_request->send
    *  EXPORTING
    *    i_with_error_screen = SPACE
    *  receiving
    *    RESULT              =
          CATCH cx_send_req_bcs .
        ENDTRY.
        COMMIT WORK.
      ELSE.
        READ TABLE it_usrid INTO wa_usrid WITH KEY werks = p0001-werks
                                                   sachx = p0001-sachp.
        IF sy-subrc EQ '0'.
          READ TABLE it_receiver INTO wa_receiver WITH KEY usrid = wa_usrid-usrid.
          IF sy-subrc EQ '0'.
            READ TABLE it_receiver INTO wa_receiver WITH KEY pernr = wa_receiver-pernr
                                                             subty = '0010'.
            receiver = wa_receiver-usrid_long.
            cc_reciv = '*'.
          ENDIF.
        ENDIF.
        CONCATENATE wa_final-begda+6(2)'.' wa_final-begda+4(2) '.' wa_final-begda+0(4) INTO gv_begda.
        CONCATENATE wa_final-ltime+0(2)'.' wa_final-ltime+2(2)  INTO gv_ltime.
    *  if empid is not initial and employee is not initial and reciever is not initial.
    **------------Create Content--------------------*
        CONCATENATE  'Hello' ',' INTO hello_emp.
    *      CONCATENATE hello_emp ',' INTO hello_emp.
        APPEND hello_emp TO content.
        CLEAR: hello_emp.
        APPEND space TO content.
        CONCATENATE 'Employee' wa_final-ename  bapireturn-type
      bapireturn-id
      bapireturn-number
      bapireturn-message
      bapireturn-log_no
      bapireturn-log_msg_no
      bapireturn-message_v1
      bapireturn-message_v2
      bapireturn-message_v3
      bapireturn-message_v4 INTO hello_emp SEPARATED BY space.
        APPEND hello_emp TO content.
        CLEAR: hello_emp.
        APPEND space TO content.
    *    CONCATENATE hello_emp '.' INTO hello_emp.
    *    APPEND hello_emp TO content.
    *    CLEAR: hello_emp.
    *    APPEND space TO content.
    *    APPEND 'For details, please refer Leave Policy.' TO content.
    *    APPEND space TO content.
        APPEND 'Please check Infotype 2001 and 2006 .' TO content.
        APPEND space TO content.
    *    APPEND '***********************l' TO content.
    *    APPEND space TO content.
    *    APPEND space TO content.
        APPEND '**This is an automatically generated mail. Please do not reply to this mail.**' TO content.
        APPEND space TO content.
    *APPEND'Best Regards,' TO content.
    *APPEND employee TO content.
    **------------Mail trigger----------------------*
        TRY.
            send_request = cl_bcs=>create_persistent( ).
          CATCH cx_send_req_bcs.
        ENDTRY.
        WRITE 'Shortfall of working time' TO subject.
        TRY.
            CALL METHOD cl_document_bcs=>create_document
              EXPORTING
                i_type        = 'RAW'
                i_subject     = subject
    *    i_length      =
    *    i_language    = SPACE
    *    i_importance  =
    *    i_sensitivity =
                i_text        = content
    *    i_hex         =
    *    i_header      =
    *    i_sender      =
              RECEIVING
                result        = mail_doc
          CATCH cx_document_bcs.
        ENDTRY.
        TRY.
            CALL METHOD send_request->set_document
              EXPORTING
                i_document = mail_doc.
          CATCH cx_send_req_bcs .
        ENDTRY.
        TRY.
            CALL METHOD cl_sapuser_bcs=>create
              EXPORTING
                i_user = sy-uname
              RECEIVING
                result = sender.
          CATCH cx_address_bcs .
        ENDTRY.
        TRY.
            CALL METHOD send_request->set_sender
              EXPORTING
                i_sender = sender.
          CATCH cx_send_req_bcs .
        ENDTRY.
        TRY.
            CALL METHOD cl_cam_address_bcs=>create_internet_address
              EXPORTING
                i_address_string = receiver
    *    i_address_name   =
    *    i_incl_sapuser   =
              RECEIVING
                result           = recipient
          CATCH cx_address_bcs .
        ENDTRY.
        TRY.
            CALL METHOD cl_cam_address_bcs=>create_internet_address
              EXPORTING
                i_ad

  • SAPup phase is idle for more than 12 hrs

    Hi all,
    I am BW 3.1 upgrade to BI 7.0
    We have a J2EE engine 6.20 running on BW 3.1 so i installed as on Note: 934615
    then started the ABAP upgrade.
    Now upgrade is in SAPup phase giving info like
    "The parallel running java upgrade wil take some more time"
    I tried to stop and restart again its coming to the same phase.
    And its is idle for more than 12 hrs.
    Pls guide me solve this issue..
    Thanks & Regards
    Karthikeyan

    Got stucked because of Java, uninstall java instance. Issue got resolved

  • How to restrict not more than 9 hrs in Timesheet

    Hi
    Is there any way to restrict not more than 9 hrs in Timesheet in PWA 2010
    Regards
    Santhu

    Hi Santhu,
    In server settings, timesheet settings, set the maximum hours per timesheet:
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

Maybe you are looking for