SNAPSHOT : clause IN not working for more than 1 entry

Greetings,
I'm trying to use snapshots templates to confine a snapshot to a
particular set of data. My 'where' clause of my snapshot is
something like this:
(...) where attribute IN (:VALUES)
-When I define my template variable VALUES as "'value1'", it
returns ok only the records which attribute has the
value 'value1'. [OK]
-When I define my template variable VALUES
as "'value1','value2'", it doesn't return any record!! [WRONG!]
Is this a bug (or a not implemented feature) of oracle lite? Or
am I doing anything wrong?
If it is a bug, anyone has an idea of how can I turn around this
problem if I don't know what are the filter values that I'm
going to use (defined by each user) and how many they are?
thanks,
psalazar.

In our application we tend to use views to return appropriate values for a particular user.
For example (we do building inspections) the publication item sql is like
select * from inspection_sites where id in (select site_id from v_pda_bi_sites where bi_id=:bi_id)
The view acts like a dynamic parameter table (in this cases looks at experience level, status of sites, and responsibility allocations). Once the driving views are tuned this works quite efficiently, and as the dependant tables for the publication item automatically includes all of the tables in the driving view, the object gets refreshed if there is any change to any of them, even if the site details themselves have not changed

Similar Messages

  • LSMW For Converting Open Sales Orders (not working for more than 1 item)

    Hi,
    I am using following standard object for Open sales orders .
    Object               0090   Sales documents                   
    Method               0000                                     
    Program Name         RVINVB10                                 
    Program Type         D   Direct Input                         
    Its not working for more than 1 line item.
    For more than 1 line item its giving Error saying that
    '102122                         V1                   845
    Print parameter SAPML2 1 is not defined
    Can anybody help me out in this regard.
    Thanks in advance.
    Nitin.

    hello, friend.
    i will still research the subject.  but the first thing that comes into my mind is t-code VA05.  with this, you have the option to change the Plant en masse.  so a possible workaround is for you to list a number of sales orders using VA05.  you then sort the line items by Plant.  choose all items with the same plant, change the plant via mass change... then change back to the original plant.  hopefully, the new settings should apply.
    do test a few sales orders by doing this for a larger scope.
    regards.

  • PSE8 Backup/Synchronization not working for more than a month

    1. Reconnecting files shows that a file is not connected; however, no file is listed. How do I find missing file's properties.
    2. Backup/synchronization preferences works fine.
    3. I can select one or more or the whole catalog.
    4. The twirly icons show next to the album(s) for a second or show but then the synced icon remains in album/albums.
    5. I click OK and after the hour glass shows a while, it finishes.
    6. I click on icon and see that sychronization is on.
    7. If I check (unsynced items, synced items, or items marked for sync) it shows nothing and says that none of those choices matches.
    8. I have repaired and reindexed countless times (never has there been a "repair" problem.
    9. I click on optimize and that works.
    10. After that I notice "generating thumb nails" and the twirly thing moving. I've let it generate thumbnails for more than 24 hours and it's still going.
    I have spent countles hours during day and night, and I can't get it to work.
    I noticed that someone wrote that he had a similar problem that began with his using the IPAD. And I started using the IPAD also, but I couldn't sync my files with photoshop.com before that.
    Customer service and Help provides me with no answers. What should I do?

    Hi clairenanak:
    Sorry to hear about the troubles.
    On your #1, you may have disconnected files of media types that are not visible. To ensure that all media types are visible, go to View > Media Types, and check any items that are not currently checked. Then try the Reconnect.
    As far as backup/sync not working, disconnected files can stop sync from working.
    After resolving the disconnected files issue, let us know if sync is not working. We may need to look at the sync log to determine why.
    As for the Organizer constantly generating thumbnails, this could indicated that you have many files, for example 10,000, in your catalog.
    If you have many files in your catalog, then you may need to just wait for the process to finish.
    It may also indicate a problem with the thumbnail cache that can't be repaired by the Optimize command.
    You can manually reset this file by doing the following:
    Determine the name of your Elements Organizer catalog.
    The name of the catalog appears in the lower-left of the Organizer.
        Alternatively, you can open the Organizer and then click File >  Catalog. The name of the catalog will show in the list at the bottom  with " [current]" after it.
    Close the Elements Organizer.
    Navigate in Windows Explorer to the folder that contains your catalog. Here are the default locations:
       Windows 7 or Vista: C:\ProgramData\Adobe\Elements Organizer\Catalogs\<CATALOG NAME>  
    Click Start, type "%ProgramData%" (including the quotation marks) into the Start Search, and then press Enter.
    Open each folder in the above structure until you have opened the catalog folder.
       Windows XP: C:\Documents and Settings\All Users\Application Data\Adobe\Elements Organizer\Catalogs\<CATALOG NAME>  
    Choose Start > Run, type "%AllUsersProfile%\Application Data" (including the quotation marks) in the Open text box, then press Enter or click OK.
    Open each folder in the above structure until you have opened the catalog folder.
       NOTE: Replace <CATALOG NAME> with the name of the catalog that you determined in Step 1 above.
    There should be a file called thumb.5.cache, which is the thumbnail cache. Delete this file.
    The next time you open the Elements Organizer, the thumbnail cache will begin to rebuild. This may take some time, depending on the number of files you have in the catalog.
    HTH

  • E3200 - USB port does NOT work for more than one device

    We needed a new router that had the dual band connectivity as our previous router stopped working properly when we started using a baby monitor operating on the same 2.4 GHz. The choice was between E3200 and E2500. We chose the E3200 mainly because it also offered a USB port. We were hoping to use that to connect our printer and two external drives (thus bypassing our old desktop that's been working as a server). However, it turns out that the USB port on E3200 does NOT support USB hubs! So, you can ONLY use ONE device - either a printer or one external storage drive. That wasn't really clear at all from the description. I feel like we wasted the extra $50 hoping to get functionality that just isn't there. Can't believe that in this day and age, Cisco thinks we all have only ONE USB device we might want to connect to the network! The router itself is fast enough, but the extra $50 for a USB port that doesn't do much and some speedboost phantom ability is just not worth it. 

    Just to save time to you all, after numerous attempts to install a USB hub to my E3200,
    I wrote to Cisco Customer Service (live chat) and I specifically requested how to set up the usb hub or the virtual USB port and they said that they do not have a software to install a USB hub.
    Hope this help
    Massimo
    (Mod note: Edited for guideline compliance.)

  • CustomDatumExample.java does not work for more than 2 attributes

    The CustomDatumExample.java only works
    if the Employee object has 2 attributes -
    (EmpName and EmpNo). If I try to add
    another attribute to the Employee object I get java.lang.ArrayIndexOutOfBoundsException: 2 on the getAttr3 method.
    Anyone know why?
    Employee object
    CREATE TYPE employee AS OBJECT
    empname VARCHAR2(50),
    empno INTEGER,
    attr3 VARCHAR2(50)
    Custom object class
    public class Employee implements CustomDatum, CustomDatumFactory
    public static final String SQLNAME = "EMPLOYEE";
    public static final int SQLTYPECODE = OracleTypes.STRUCT;
    MutableStruct _struct;
    static int[] _sqlType =
    12, 4
    static CustomDatumFactory[] _factory = new CustomDatumFactory[3];
    static final Employee _EmployeeFactory = new Employee();
    public static CustomDatumFactory getFactory()
    return _EmployeeFactory;
    /* constructor */
    public Employee()
    struct = new MutableStruct(new Object[3], sqlType, _factory);
    /* CustomDatum interface */
    public Datum toDatum(OracleConnection c) throws SQLException
    return struct.toDatum(c, SQL_NAME);
    /* CustomDatumFactory interface */
    public CustomDatum create(Datum d, int sqlType) throws SQLException
    if (d == null) return null;
    Employee o = new Employee();
    o._struct = new MutableStruct((STRUCT) d, sqlType, factory);
    return o;
    /* accessor methods */
    public String getEmpname() throws SQLException
    { return (String) _struct.getAttribute(0); }
    public void setEmpname(String empname) throws SQLException
    { _struct.setAttribute(0, empname); }
    public Integer getEmpno() throws SQLException
    { return (Integer) _struct.getAttribute(1); }
    public void setEmpno(Integer empno) throws SQLException
    { _struct.setAttribute(1, empno); }
    public String getAttr3() throws SQLException
    { return (String) _struct.getAttribute(2); }
    public void setAttr3(String attr3) throws SQLException
    { _struct.setAttribute(2, attr3); }
    null

    Just to save time to you all, after numerous attempts to install a USB hub to my E3200,
    I wrote to Cisco Customer Service (live chat) and I specifically requested how to set up the usb hub or the virtual USB port and they said that they do not have a software to install a USB hub.
    Hope this help
    Massimo
    (Mod note: Edited for guideline compliance.)

  • Daily lot size not working for more than 5 days grouping

    Dear All,
    I want to create the procurement proposal for 6 days once. So I have created new lot size ZB by copying TB and maintained no of periods as 6.
    Assigned the lot size in Material master. After MRP run, the procurement proposal created for every two weeks on Monday. It is not created as expected (6 days once). Is there any other settings needs to be maintained to achieve the requirement?. The same problem happening for the no of periods 7,8,9 also with daily lot size.
    I don't want to use the planning calendar for this. Daily lot size is working only upto no of periods as 5.
    Could you please someone explain the standard functionality of daily lot size with combination of no of periods?
    Thanks in advance.
    Regards,
    Ganesh

    Ganesh,
    Check if your lot size is something similar to screenshot below. It is important that you have lot sizing procedure as 'Period lot size' and period as 'Daily lot size'
    With the above lot size (number of period as 8 days) I can see expected results.
    Regards,
    Himanshu

  • Bought a ipod nano 6th and is not playing for more than 2 min?

    bought a ipod nano 6th and is not playing for more than 2 min?

    The most likely problem is that the headset is not inserted fully. When you insert the headset, you should feel and hear a "Click" to let you know it is inserted all the way.
    The problem is that if it is not inserted all the way, the nano does not detect it. If it is not detected, it will pause playback when the screen goes dark. This is to keep your battery from draining when there is nothing connected to listen to the music.
    i

  • Songs stop playing on my iphone I try to start it again and it will not play for more than 2-4 seconds, does anyone have the solution to this problem?

    I have Imatch and songs stop playing on my iphone I try to start it again and it will not play for more than 2-4 seconds, does anyone have the solution to this problem?

    By "hard reset" you mean hold down the Home and power buttons until the iOS device restarts, correct?

  • HP LaserJet 1300 not connected for more than 1 day

    Since Apple came out with the Yosemite printing system, I cannot print wirelessly for more than one day. I have reset my modem, changed the location of my network, unplugged and repowered Airport Extreme, started in Safe Mode, and more.
    No matter what I do: I either get:  a printer name with a number in parenthese or a long Bonjour number when deleting and adding a printer on my laptop.
    Whatever I do, it only works from about 24 to 36 hours. Then when i go to print it says Printer is Not Connected. I can delete and add again, usually it will find the printer, add it, print, and then a day or two later, the printer is not connected again.
    But I have to keep redoing this both to my laptop and my wife's, and we have not had reliable printing since Yosemite cane out about October 18, 2014.
    Equipment
    iMac:
    Operating Sysem: 10.10.1
    Printer: HP LaserJet 1300
    Network: Comcast
    Router: Airport Extreme
    The only thing I have not done I can think of is reset Airport Extreme.  I can do that, but don't know if I will then have additional problems.
    This all started with the YIosemite update but at this point I don't know if it is an HP-related problem or a general Yosemite-related problem.
    I appreciate any help I can get. Have wasted probably 40 hours over two-plus months trying to get this fixed. When Apple could not fix it back in October, the person referred me to HP. The person at HP Business did not know my printer was supported for Yosemite although his own web site said it was. So that was not much help And after resetting printers, deleting and adding printers, etc., I don't know what else to do.
    Thanks for listening.

    Did it start not syncing after the iOS 4.2 update?

  • Apex 4.0 tree does not work with more than 2 levels.

    When I have more than 2 levels in my tree, I only see the root node. The query works fine and returns 132 rows when I run it in SQL. It is just the tree that does not work.
    The same tree when built in 3.2 works fine.
    This is my tree query:
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    "NAME" as title,
    null as icon,
    "ID" as value,
    null as tooltip,
    null as link
    from (
    SELECT '__TOP_NODE__' id
    , NULL pid
    , 'BI Applications' name
    , '' link_id
    , null a1
         , null a2
    FROM dual
    1 b) BIA Modules
    UNION ALL
    SELECT '__MD_'||module_key id
    , '__TOP_NODE__' pid
    , module_name name
    , module_key link_id
    , '__MD__' a1
         , null a2
    FROM c_bia_module
    Level = 2
    Parent = Module
    Node = Functional Areas
    ID = '__FA_' prefixing functional area code
    UNION ALL
    SELECT '__FA_'||funcarea_key id
    , '__MD_'||module_key pid
    , funcarea_name name
    , funcarea_key link_id
    , '__FA__' a1
         , null a2
    FROM c_functional_area
    Level = 3
    Parent = Functional Area
    Node = Fact Group
    ID = '__FG_' prefixing fact group key
    UNION ALL
    SELECT '__FG_'||factgroup_key id
    , '__FA_'||funcarea_key pid
    , factgroup_name name
    , factgroup_key link_id
    , '__FG__' a1
         , null a2
    FROM c_fact_group
    start with "PID" is null
    connect by prior "ID" = "PID"
    order siblings by "NAME"
    If I reduce the query to just use two levels like:
    SELECT '__TOP_NODE__' id
    , NULL pid
    , 'BI Applications' name
    , '' link_id
    , null a1
         , null a2
    FROM dual
    1 b) BIA Modules
    UNION ALL
    SELECT '__MD_'||module_key id
    , '__TOP_NODE__' pid
    , module_name name
    , module_key link_id
    , '__MD__' a1
         , null a2
    FROM c_bia_module
    It works fine. Can somebody let me know what I am doing wrong? Is there a way to set the number of levels supported in 4.0?

    Hi Vidya,
    Thanks for posting your example. You may want to remove your workspace details from the previous posting, or at least update the password on the workspace. I've taken a look at your example and initially couldn't see anything wrong with your tree query. However, when I ran your query in SQL Workshop, it only returned one row, which would explain why you were only seeing one node in your tree! I've updated your query to use a WITH clause, and the tree is now working correctly. I believe you've hit an underlying database bug where the CONNECT BY query is only returning 1 row, when in fact it should return > 1 row. By re-writing the query to use a WITH clause, you can get around the problem.
    Regards,
    Hilary

  • 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

  • Add row not working if more than 5 records are displayed on the screen

    Hello all,
    Does anyone know why the add row button on an sql updateable report would stop inserting a blank row for data entry when more than 5 records have been entered into the form? I can insert up to 5 records. After that, a blank row is no longer supplied by the button. Odd. Have any ideas?
    Any assistance would be greatly appreciated!!!
    Michelle

    You're welcome, Michelle!
    The "Maximum Row Count" setting determines the maximum number of rows Apex will, or could, retrieve for a report. In your original settings, this was only 15, so matched the numbers of rows on a page - therefore, you would (A) only have one page of records and (B) never see a "New Row" as that would be record number 16 (or something higher than 15), which Apex would ignore!
    One thing to note, though, is that some of the pagination schemes (the ones with a "Z" in the description) will count the full number of records available every time the report is loaded - for small tables, this is not an issue but for large tables, you may want to use one of the other schemes.
    Andy

  • CONVERT_OTFSPOOLJOB_2_PDF is not working with more than 200 pages

    HI all,
    i am trying to print out Inspection Results (OTFs generated by QGA3 Transaction) via the CONVERT_OTFSPOOLJOB_2_PDF funtion module.
    But if the Inspection Results have more than 200 pages the FM only creates a PDF without content.
    The PDF is there but it has 0 bytes.
    This is how i fill the FM:
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid              = i_spool
                  no_dialog                = 'X'
             IMPORTING
                  pdf_bytecount            = wl_numbytes
                  pdf_spoolid              = wl_pdfspoolid
                  btc_jobname              = wl_jobname
                  btc_jobcount             = wl_jobcount
             TABLES
                  pdf                      = tl_pdf
             EXCEPTIONS
                  err_no_otf_spooljob      = 1
                  err_no_spooljob          = 2
                  err_no_permission        = 3
                  err_conv_not_possible    = 4
                  err_bad_dstdevice        = 5
                  user_cancelled           = 6
                  err_spoolerror           = 7
                  err_temseerror           = 8
                  err_btcjob_open_failed   = 9
                  err_btcjob_submit_failed = 10
                  err_btcjob_close_failed  = 11.
    Does anyone have an idea ?
    Thanks and Regards
    Volker

    That's because the function reverts to background processing when the page size is over 99 pages (see the code).  I posted how to handle this a while back but basically you can either use RSPO_RETURN_SPOOLJOB directly or you can continue to use your current function but you have to poll for the completion of the job (BP_JOB_STATUS_GET) and then get the resulting spool in RAW format with RSPO_RETURN_SPOOLJOB then convert it:
    FIELD-SYMBOLS: <fs_line> TYPE x.
    DATA: gv_pdf TYPE xstring.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
      EXPORTING
        rqident              = p_spono
        desired_type         = 'RAW'
      TABLES
        buffer               = gt_buffer
      EXCEPTIONS
        no_such_job          = 1
        job_contains_no_data = 2
        selection_empty      = 3
        no_permission        = 4
        can_not_access       = 5
        read_error           = 6
        type_no_match        = 7
        OTHERS               = 8.
    LOOP AT gt_buffer INTO gs_buffer.
      ASSIGN gs_buffer TO <fs_line> CASTING TYPE x.
      CONCATENATE gv_pdf <fs_line> INTO gv_pdf IN BYTE MODE.
    ENDLOOP.

  • Networked L7680 does not work from more than one computer at a time.

    Have installed latest driver software on both computers. Printer will only work with one computer on at a time. When I run windows device trouble shooter from the last computer turned on it says printer is off. It works ok from the first computer turned on.
    Any help is appreciated.

    Networked how??  Please explain how everything is connected and model number of equipment.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • My wifi wasn't working for more than 10 minutes at a time after updating to IOS8 and resetting network settings. I turned off google drive, turned off Bluetooth, reset network settings and rebooted my iPad4. So far so good.

    I have an ipad4.  Wifi keeps cutting out after the upgrade even after I forget the network and resign on or reset all network settings. I deleted iCloud drive from my iPad, turned off Bluetooth, reset network settings, and rebooted my iPad. Since I upgraded to IOS8 this is the longest wifi has consistently been working for me. Which is approximately an hour now. Anyone else find that this worked or have figured out if this or anything out there is a permanent fix?

    Hi CollinGCC78,
    It sounds like you have been on the right track in troubleshooting this issue. If you are still having issues, you may want to double-check the steps outlined in the following article, in order if possible (apologies for replicating any steps you have already taken):
    iOS: Troubleshooting Wi-Fi networks and connections
    Regards,
    - Brenden

Maybe you are looking for

  • Open URL from Java in a new browser tab

    Hi OTN, Surprisingly can't find the implimintation. In an ADF managed bean I retrieve String url. I need to open a new browser tab with this url. Found this thread Open a url in a new window in the backing bean which shows using javascript "service.a

  • Error in Integration of Defect Module of HP QC with SolMan Ehp 1

    Hi, We are using QC version 10 patch 12 and connected with SolMan Ehp 1 for testing. We are facing a problem in integrating the defect module of QC with Service desk of SolMan. The required settings are done in SPRO -> SAP Solution Manager -> Scenari

  • Reservation issue

    Dear all, When I create reservation using T. code MB21 & Mov. Type: 202  we use to enter input parameter  Material, Quantity in , UnE, plant , SLoc & Batch number. But here I have have been facing one problem which is created due to acceptance of any

  • Report to view user nm, authorization objects, activity, transaction code.

    Hi All, I want to view a user-wise report that displays the transaction code, authorization objects and activities for which the user has authorization. Is there any standard report to view all this at a glance? Can anybody help me on this? Thanks.

  • Un invoice service orders ( Report )

    Hi all, Please let me know if there is a standard report for uninvoice service orders/  ?? which table in R/3 holds that information. Thank you