Code for Presentation Slide Counter

I have a slide presentation I have created with a slide
counter. My problem I am haveing is the slide counter updates
current frame and total number of frames from the "_root" or which
is the begining of the flash document. I have created a preloader
on a previous scene. What happens is the slide counter is adding
these 3 or 4 key frames into its total. So when the presentation
starts it shows its starting on "slide 5" and not 1.
Question: Does anyone know how to have the code read the
amount of slide in the current scene rather than the entire Movie
(_root)?
I have pasted the code below. Any ideas, help, or suggestions
would be more than appreciated. Thanks in advance.
Luke
onClipEvent (load) {
function updateFrame (inc) {
// send slides to new frame
newFrame = _root._currentFrame + inc;
_root.gotoAndStop(newFrame);
// update status indicator
totFrame = "/ " + _root._totalFrames;
curFrame = _root._currentFrame;
if (_root._currentFrame == 1) {
prevBtn.gotoAndStop(2);
} else {
prevBtn.gotoAndStop(1);
if (_root._currentFrame == _root._totalFrames) {
nextBtn.gotoAndStop(2);
} else {
nextBtn.gotoAndStop(1);
updateFrame();
Thanks Again for any help!

Got it!
THANKS FOR YOUR HELP! You pretty much had it right away with
a little tweaking. Thanks again!
onClipEvent (load) {
function updateFrame (inc) {
// send slides to new frame
newFrame = _root._currentFrame + inc;
_root.gotoAndStop(newFrame);
// update status indicator
totFrame = "/ " + (_root._totalFrames-5);
curFrame = _root._currentFrame-5;
if (_root._currentFrame-5 == 1) {
prevBtn.gotoAndStop(2);
} else {
prevBtn.gotoAndStop(1);
if (_root._currentFrame-5 == (_root._totalFrames-5)) {
nextBtn.gotoAndStop(2);
} else {
nextBtn.gotoAndStop(1);
updateFrame();
}

Similar Messages

  • Transaction code for presentation layer to AL11

    Hi
    I need to tranfer the data from Presentation layer to AL11 directly with a Transaction code. without using gui_upload.
    For example we are using CG3Y T code to transfer data  AL11 to Presentation layer .
    Transaction Code plzz
    Any Suggestions
    Regards

    Are you asking for transferring Data from Prest. Layer to Appl. Layer.
    Check the tcode CG3Z.
    Regards
    Gopi

  • I need validation code for cycle count open interface

    Hi friends i require the validation code for the
    cycle count open interface .
    can anybody help me .......
    Message was edited by:
    user506929

    Hi David
    I want to know the procedure for cycle count open interface i.e.
    1> How the data from flat file is uploaded in oracle INV
    How many Tables are needed?
    2>What validations are required ?
    3>How these validations are performed ?
    If you have any document pls send it to me at :
    [email protected]
    thanks for ur responce ......

  • Is there a way to play a song for several slides within a larger keynote presentation?

    is there a way to play a song for several slides within a larger keynote presentation?

    Place the sound file on the slide and use Builds to change the images during the sound files duration.
    Inspector > Builds > choose an effect
    Delivery: by paragraph
    more options > start build manually or,
    use automatically;    and select a delay (the amount of time the slides  show). For example; if you have a 30 second sound file and 10 images, enter a 3 second delay.

  • I need Java code for a simple graphical hit counter for a webpage

    I was wondering if anybody out there could send me some code for a simple graphical hit counter for a webpage. All the sites that I've visited are garbage and of no use to me. Please help me.
    Colin

    Not as easy as you'd imagine with applets. You need some way to store the hits, usually through a file on the server. That's not gonna happen in a hurry for 2 reasons -
    - Applets can't read/write files
    - Your web server usually won't let you run programs on their machine (ie, programs that listen for socket connections from applets, then load/read/write/close a file).
    In short, no, there is no simple java solution (that I know of).
    Cheers,
    Radish21

  • Code for an iframe that sizes the presentation correctly

    Does anyone have code for an iframe that sizes the HTML5 presentation correctly?  We want the presentation to be presented in the specific width and height we set for it.  Interestingly if we open the presentation using a JavaScript window.open or showModalDialog call it sizes correctly to a subset of the screen's width, but if we open it in an iframe it falls off the frame because the way the index.html reads the size of the display versus the iframe.

    Defiled:
    I did sign a two year contract and completed that contract. The 3gs is no longer in service. My daughter is going overseas to protect you and your family. I was attempting to find a way for her to have a reliable phone that could offer her some connection with home as she travels through the middle east.  She travels in missions all over.
    At&T unlocks other phones of theirs why not the iPhone?  AT&T says that Apple will not give them the code, it is not the carrier.  If I would have known this situation would have come up I would have bought and unlocked 3gs phone"Deggie" .  My main complaint is that Apple has not good excuse as to why they will not allow their phones to be unlocked from services well, AT&T .  I bought the phone full price, completed the contract terms, even went for and iPhone 4 with another2 year contract, along with owning an apple computer... I love the product.  My main issue is give me a good answer as to why you won't allow a phone to be unlocked. It doesn't hurt Apple, People still have to buy the phones from them, and use their App store and iTunes.
    Sorry, just upset about my daughter heading over there, boots on the ground, and just pray she will be safe. Would have liked to facetime her while she is in the airports and in specific areas allowed for that.
    Please don't come down on me for asking this question. I understand all the contracts etc.... but to single out the iPhone specifically to not unlock after contract is over does not seem fair.
    Thank you for your responses.

  • I need XI introduction slides for presentation~Where I can get it?

    Dear XI consultant:
    I need XI introduction slides for presentation~Where I can get it?
    I try to make a XI presentation slides for our customer~
    Does SAP provide a formal slides for XI presentation?
    It's better there is an case example in it.
    Coz I'm a beginner of XI.thanks for your help~
    Regards
    Jack Lee

    Hi Jack
    Latest version is PI 7.1
    This is overview document
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0ed3b8c-698c-2a10-fbaf-b1df0c82fc8a
    Thanks
    Gaurav

  • Need PL/SQL code for this

    Hi,
    I need a PL/SQL code for this one...
    Let me know if something is not clear...
    1) The table CLOB_CLOBJECT_CDA has the columns described below...
    Explaining only those fields which are important in this context
    -- CDA_STEP_ID : Basically a Sequence
    -- CLOBJECT_SOURCE1_ID : Every id has got a set of records
    -- CLOBJECT_SOURCE2_ID : Every id has got a set of records
    -- LVL : There are total 8 levels..
    This is the main aim :
    1) There are total 16 million rows..(limited to 10 rows here)
    2) We need to go through level by level (LVL column) & insert the intersection records (CLOBJECT_SOURCE1_ID intersect CLOBJECT_SOURCE2_ID)
    into another table...but this is how it goes..
    Level (LVL column) 3's basically have CLOBJECT_SOURCE1_ID as level (LVL column) 2 CDA_STEP_ID's..
    (consider the statement --** where CLOBJECT_SOURCE1_ID = 285 which is same as 1st insert statement step id)..
    The above process goes for next levels until 8..(so have to use loops)
    So for ex :
    We go through the first insert statement and insert the insertion records only when both CLOBJECT_SOURCE1_ID & CLOBJECT_SOURCE2_ID has got records ..
    If we don't find any records for both of them we should skip the corresponding step id when we go to the next levels...
    Let's go through the 1st insert statement...
    -- We have CDA_STEP_ID = 285 & two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 74...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 74 ..(In fact we insert counts into this table only if they have records)
    -- If so, we insert the intersection records into CDA_MRN_RESULTS ( we do have counts for both of them..) with CDA_STEP_ID 285...
    -- Then we insert the step id which is 285 along with the count into CLOBJECT_COUNTS..
    Let's go through another insert statement...
    -- Consider CDA_STEP_ID = 288 which has two sources CLOBJECT_SOURCE1_ID as 19 & CLOBJECT_SOURCE2_ID as 92...
    -- We see the table CLOBJECT_COUNTS & check whether we have counts for both 19 & 92 ..(we have records for 19 but not for 92)
    -- So we should not proceed with this..& also skip all those records (future records with increasing levels..basically level 3's) which have got 288 as CLOBJECT_SOURCE1_ID..
    (As said earlier that the present CDA_STEP_ID will always be CLOBJECT_SOURCE1_ID in the next level)...
    I wrote the following code which is after the statement...
    Let me have the create & insert statements here..
    create table CLOB_CLOBJECT_CDA
        CDA_STEP_ID           NUMBER,
        CDA_ID                NUMBER,
        CDA_SEQ_NUMBER        NUMBER,
        CLOBJECT_SOURCE1_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE1_ID   NUMBER,
        CLOBJECT_OPERATOR     VARCHAR2(3000),
        CLOBJECT_SOURCE2_TYPE VARCHAR2(3000),
        CLOBJECT_SOURCE2_ID   NUMBER,
        LVL                   NUMBER
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (285, 285, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 74, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (286, 286, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 75, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (287, 287, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 91, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (288, 288, 1, 'CLOBJECT', 19, 'INTERSECT', 'CLOBJECT', 92, 2);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4869, 4869, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 91, 3);  -- **
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4870, 4870, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4871, 4871, 1, 'CDA_STEP', 285, 'INTERSECT', 'CLOBJECT', 93, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4880, 4880, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 91, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4881, 4881, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 92, 3);
    insert into clob_clobject_cda (CDA_STEP_ID, CDA_ID, CDA_SEQ_NUMBER, CLOBJECT_SOURCE1_TYPE, CLOBJECT_SOURCE1_ID, CLOBJECT_OPERATOR, CLOBJECT_SOURCE2_TYPE, CLOBJECT_SOURCE2_ID, LVL)
    values (4882, 4882, 1, 'CDA_STEP', 286, 'INTERSECT', 'CLOBJECT', 93, 3);
    create table CDA_MRN_RESULTS
       CDA_STEP_ID      NUMBER,
      MRN              NUMBER,
      INSERT_DATE_TIME DATE
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19, 1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (19,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (74,  4, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  1, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (75,  6, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  2, to_date('19-10-2011', 'dd-mm-yyyy'));
    insert into cda_mrn_results (CDA_STEP_ID, MRN, INSERT_DATE_TIME)
    values (91,  3, to_date('19-10-2011', 'dd-mm-yyyy'));
    create table CLOBJECT_COUNTS
      CDA_STEP_ID    NUMBER,
      CLOBJECT_COUNT NUMBER,
      DATE_TIME      DATE
    Insert into CLOBJECT_COUNTS values (19,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (74,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (75,3, to_date('19-10-2011', 'dd-mm-yyyy'));
    Insert into CLOBJECT_COUNTS values (91,2, to_date('19-10-2011', 'dd-mm-yyyy'));The output goes into two tables...
    CDA_MRN_RESULTS : O/p of intersection records between source1 & source2 id
    CLOBJECT_COUNTS : Step id with counts ...(useful for skipping next level step id's if either of source id has "0" counts)
    Any help is appreciated..
    Thanks..

    I tried to code this..but looping takes a lot of time..I want to skip certain rows where source1_step_id & source_2_step_id are not in clobject_counts table as we proceed to the next levels..Not sure how to skip the rows..
    declare
    cursor c1 (p_level varchar2 ) is
      Select * from clob_clobject_cda
        where lvl = p_level    ;
       TYPE V_TT IS TABLE OF C1%ROWTYPE INDEX BY PLS_INTEGER;
        L_TT V_TT;
        v1 number;
        v2 number;
        v_step_id number;
        v_operator varchar2(100) := '';
    begin
    for i in 2..8 loop
      open c1(i);
      LOOP
           FETCH C1 BULK COLLECT INTO L_TT LIMIT 500;
            FOR indx IN 1 .. L_TT.COUNT
             LOOP
               v1 := L_TT(indx).clobject_source1_id;
               v2 := L_TT(indx).clobject_source2_id;
               v_step_id := L_TT(indx).cda_step_id;
               v_operator := L_TT(indx).clobject_operator;
      Execute Immediate ('Insert into cda_mrn_results Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v1 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts) ' ||
         v_operator ||
                    '  Select --+ parallel (cm 128)
                                                      distinct ' || v_step_id || ', mrn, trunc(sysdate) dt from cda_mrn_results  cm
                        where cda_step_id = ' || v2 || '
                        and   cda_step_id in (Select cda_step_id from clobject_counts)  ' );
    Insert --+ Append
           into clobject_counts Select cda_step_id, count(distinct mrn),
                       insert_date_time dt from cda_mrn_results  where cda_step_id =  v_step_id   group by cda_step_id,insert_date_time;
       COMMIT;                    
             END LOOP;
           EXIT WHEN L_TT.COUNT = 0;
         END LOOP;
      CLOSE C1;
    End Loop;    
    Commit;
    End;

  • Remote for advancing slides in Keynote

    I'm posting this as a suggestion for Apple. I use a remote to advance slides for presentations. I would really like to be able to do that with the iPad. Bluetooth would be just fine. None of my Bluetooth mice will pair with the iPad so that won't work
    If anyone has a work-around I'd be glad to hear it
    Bill

    Geez, I watched the same SteveNote and didn't see anything in there that gave me the impression that you'd be able to remotely advance Keynote slides from something outside of the iPad - the demo clearly indicated it was set up to use *the iPad itself* to hook up to a projector (not wirelessly) and be the presenter's screen (like a giant remote), with the projector getting the presentation output.
    I'm sorry some of you bought this so early and were hoping to use it as a regular laptop, as it's not one. If you really need the services of a laptop and a bluetooth mouse, well........netbooks are cheap. Cheaper than iPads.
    Having said that, give it some time - perhaps Apple will add this feature at some point, but I don't know if I would hold my breath. Even more likely there may be an iPhone/iPod app that may remotely advance iPad slides, but this will likely require them both to be talking via a WiFi router in the room.
    Bruce Robbie asked: "Does the iPad case have a strap for secure single hand holding?"
    I've seen one on the web - click here.

  • Will an Infra-Red Adapter work with a macbook pro retina display so I can use the apple TV remote for presentations?

    I have always used the apple TV remote for my presentations.  I bought a retina display last year for the betterment of my presentations and now I have to stand near my computer and hit a button to change my slides where as before I used my remote.  Will a infra-red adapter work with the apple TV remote in the macbook pro retina display?  Love my computer, but very disappointed not to have a remote for presentations that does not need the internet.  Does anyone have any ideas?

    Yes, I used that and it works great if you have wireless connection.  Im looking for  a remote that worked like the apple TV remote.  My questions is, "Is there a USB infra-red remote that works with mac.  I have found this one: Keyspan EZ1 easy presenter.  It claims with works with PC and Mac and the reviews are good.  Does anyone know anything about it or if it works with retina display macs?

  • Dynamic sub-topic slide counter in Captivate 7

    Hi, I was wondering if anyone could give me guidance on the following routine that i would like to implement using Captivate 7.
    I would like a front-end menu selector slide to dynamically count how many slides are allocated to each of the sub-topics so that it can 'show' when all slides have been completed topic by topic.
    I envisage puting a pre-loaded topic selector onto my master slide, so that when you load a new slide into the filmstrip, you would choose from a 'dropdown' as to which topic this slide belongs (this dropdown would not be visible in runtime)
    This way, when i enter the package in runtime, I can use the system variable to count how many slide are in the total package, but when i get to the menu slide, it will have dynamically counted how many slides are alloctaed to each topic before i enter the topics. Once the total amount of slides allocated to a topic have been completed, the menu button will indicate this.
    It is the sub-topic dynamic counting part of this query that i am having trouble with.
    Thank you in advance for any assitance you can provide on this matter.
    Craig

    Hi Lilybiri,
    OK, Captivate has a system variable that calculates how many slides are in a total package, but, for example, my package is broken down into sub-topics of:
    Colours
    Animals,
    Cars
    Flowers
    etc ....
    When I am developing the content and I add a new slide from my Master template, there will be a dropdown menu (not visible in runtime) from which I select which topic this new slide belongs to (ie Colours, Animals, etc ......). So I can do this for all new slides added to my package. (Probably a variable set for each slide which will be 'Slidetopic = Colours' or 'Slidetopic = Cars')
    When I finally run the package, I will have a 'Menu' slide where I can choose which sub-topic I want to visit, but I wan Captivate to dynamically count how many slides are there allocated to 'Colours', how many are set to 'Animals', etc, etc .....
    This way I can then determine exactly when I have completed the 'Cars' topic and change the menu button to indicate this fact.
    Upon initial entry, I would suspect my menu screen will display information such as:
    Total slides  = 40
    Colours = 12 slides
    Animals = 8 slides
    Cars = 14 slides
    Flowers = 6 slides
    It is the dynamic counting of the sub-topic quantity where I am hoping that someone may help me.
    Does this make my ambitions any clearer Lilybiri ?
    Thank you for your interest.
    Best wishes,
    Craig

  • T Code for Changing material price

    Hi friends,
    Can anybody tell me what is the T-Code for
    1. To change th material price
    2. Transfer posting from Un-restricted stock to block stock
    3. Transfer posting from Un-restricted stock to Quality stock

    Steve,
    I have a requirement
    Daily cycle counts are completed on inventory. SAP prints nightly a count cycle of 50 inventory items to count (Inventory Audit). This is done so our warehouse folks count items throughout the year rather than at the end of the year all at once. Every January 1 of each year the cycle count begins until we finish cycling through the inventory, which usually happens around October.
    When suspend the inventory counts it places the inventory cycle counts on hold for a period of time. The cycling that would usually happen in October of each year is extended out by the days the inventory counts were placed on hold. This is to allow for 100% inventory audit counts. As I understand SAP puts those inventory counts on hold and begins again when it is restarted.
    I will need the TCODE to stop and start the inventory cycle count…
    Can you please help me out

  • BDC OK CODE FOR ENTER NOT RECORDING

    I m creating a BDC Programme for uploading OLD PO date from excel to SAP System.
    All PO's are Service PO.
    PO's date and Delivery Date is in back date.
    My programme working fine.
    But i have to press enter manually due to   PO  Date = back date and Delivery date is also back date.
    SHDB unable to record this event.
    How to record this event.
    Is there any way to disable system messages during BDC Programme.
    When I press enter two times my programme runs very well.
    Kindly help me.
    Its very much urgent.
    Code is give below.
    REPORT zbdcme21n
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : l_file TYPE rlgrap-filename.
    DATA:   e_group_opened.
    PARAMETERS session RADIOBUTTON GROUP ctu.  "create session
    *DATA : session RADIOBUTTON GROUP ctu.
    DATA : group(12).                      "group name of session
    group = 'BDC'.
    *PARAMETERS: user(12) DEFAULT sy-uname.     "user for session in batch
    DATA : user(12).
    user = sy-uname.
    *DATA :  keep AS CHECKBOX.       "' ' = delete session if finished
    DATA :  keep TYPE checkbox.
    keep = 'X'.
    *PARAMETERS: holddate LIKE sy-datum. "'X' = keep   session if finished
    DATA : holddate LIKE sy-datum.
    holddate  = sy-datum.
    PARAMETERS ctu RADIOBUTTON GROUP  ctu.     "call transaction
    DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF i_tab OCCURS 0, "excel data stored in this file.
    row TYPE alsmex_tabline-row,
    col TYPE alsmex_tabline-col,
    value TYPE alsmex_tabline-value,
    END OF i_tab.
    DATA : BEGIN OF wa_line1 OCCURS 0, "excel data stored in this file.
    row TYPE alsmex_tabline-row,
    col TYPE alsmex_tabline-col,
    value TYPE alsmex_tabline-value,
    srno TYPE i,
    END OF wa_line1.
    DATA : wa_line2 LIKE wa_line1 OCCURS 0 WITH HEADER LINE .
    DATA : wa_hdr1  LIKE wa_line1 OCCURS 0 WITH HEADER LINE .
    DATA : wa_hdr  LIKE i_tab OCCURS 0 WITH HEADER LINE .
    DATA : wa_line LIKE i_tab OCCURS 0 WITH HEADER LINE .
    DATA : w_cnt TYPE i . "store total no of  pos
    DATA : w_hdr_counter VALUE 1. "for header line count
    DATA : w_line_counter VALUE 1. "for Line Item Counter.
    w_cnt = 0.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    PARAMETER: dataset TYPE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR dataset.
      PERFORM upload_file.
    *include bdcrecx1.
    START-OF-SELECTION.
      PERFORM process_itab.
    *include bdcrecx1.
    START-OF-SELECTION.
      PERFORM open_group.
    **********************start for header
      w_hdr_counter = 1.
      WHILE w_hdr_counter <= w_cnt.
        PERFORM bdc_dynpro      USING 'SAPMM06E' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06E-BEDAT'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        READ TABLE wa_hdr1 WITH KEY col = 2 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'EKKO-LIFNR'
                                      wa_hdr1-value.            "'800000'.
        READ TABLE wa_hdr1 WITH KEY col = 3 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-BSART'
                                      wa_hdr1-value. "'ZS'.
        READ TABLE wa_hdr1 WITH KEY col = 4 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-BEDAT'
                                      wa_hdr1-value. " '14.01.2008'.
       PERFORM bdc_field       USING 'RM06E-LPEIN'
                                     'T'.
        READ TABLE wa_hdr1 WITH KEY col = 13 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-EEIND'
                                      wa_hdr1-value.   "'14.01.2008'. "Delivery Date
        PERFORM bdc_field       USING 'RM06E-LPEIN'
                                      'T'.
        READ TABLE wa_hdr1 WITH KEY col = 6 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'EKKO-EKORG'
                                      wa_hdr1-value. "'serv'.
        READ TABLE wa_hdr1 WITH KEY col = 7 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'EKKO-EKGRP'
                                      wa_hdr1-value. "'dce'. Purchase Group
        READ TABLE wa_hdr1 WITH KEY col = 8 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-EPSTP'
                                      wa_hdr1-value. "'d'. Item Category
        READ TABLE wa_hdr1 WITH KEY col = 9 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-KNTTP'
                                      wa_hdr1-value. "'p'. Account Asign Category
        READ TABLE wa_hdr1 WITH KEY col = 10 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-WERKS'
                                      wa_hdr1-value. "'1001'.Plant
        READ TABLE wa_hdr1 WITH KEY col = 11 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-LGORT'
                                      wa_hdr1-value. " '1101'. Store Location
        READ TABLE wa_hdr1 WITH KEY col = 12 srno = w_hdr_counter.
        PERFORM bdc_field       USING 'RM06E-MATKL'
                                      wa_hdr1-value. "'c003'. Material Group
        PERFORM bdc_dynpro      USING 'SAPLMLSP' '0200'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
    ********************end of Header Data*******************
    data i type n value 1.
    data bfield type string.
        LOOP AT wa_line1 WHERE col = 1 AND srno = wa_hdr1-srno.
        READ TABLE wa_line2 WITH KEY COL = 14 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING 'RM11P-HEADTEXT'
                                        wa_line2-value. " 'Earthwork text'.
        concatenate 'ESLL-SRVPOS(' i ')' into bfield.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                       bfield.  " 'ESLL-SRVPOS(01)'. "increase counter
         PERFORM bdc_field       USING 'RM11P-NEW_ROW'
                                       '10'.
          READ TABLE wa_line2 WITH KEY COL = 15 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING  bfield "'ESLL-SRVPOS(01)'
                                        wa_line2-value.  "'5000000000'.
        concatenate 'ESLL-MENGE(' i ')' into bfield.
          READ TABLE wa_line2 WITH KEY COL = 16 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING   bfield "'ESLL-MENGE(01)' "qty
                                        wa_line2-value. "'15'.
          concatenate 'ESLL-MEINS(' i ')' into bfield.
          READ TABLE wa_line2 WITH KEY COL = 17 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING bfield "'ESLL-MEINS(01)'
                                        wa_line2-value.  "'ft3'.
          concatenate 'ESLL-TBTWR(' i ')' into bfield.
          READ TABLE wa_line2 WITH KEY COL = 18 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING   bfield  " 'ESLL-TBTWR(01)'
                                        wa_line2-value.  "'150'.
          PERFORM bdc_field       USING 'BDC_OKCODE' "Manually added
                                        '/00'.
          PERFORM bdc_dynpro      USING 'SAPLMLSK' '0200'.
          concatenate 'ESKN-PS_PSP_PNR' i ')' into bfield.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'ESKN-PS_PSP_PNR(01)'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'VRTKZ1'
                                        'X'.
          concatenate 'ESKN-SAKTO(' i ')' into bfield.
          READ TABLE wa_line2 WITH KEY COL = 19 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING 'ESKN-SAKTO(01)' "GL Account No.
                                        wa_line2-value.  " '6010010'.
          concatenate 'ESKN-PS_PSP_PNR(' i ')' into bfield.
          READ TABLE wa_line2 WITH KEY COL = 20 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
          PERFORM bdc_field       USING 'ESKN-PS_PSP_PNR(01)'
                                        wa_line2-value. " 'HR/KMP-KU'. "WBS Element
          PERFORM bdc_dynpro      USING 'SAPLMLSK' '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'ESLL-INTROW'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BACK'.
        PERFORM bdc_field       USING 'VRTKZ1'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPLMLSP' '0200'.
        i = i + 1.
        ENDLOOP.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=BACK'.
       PERFORM bdc_field       USING 'VRTKZ1'
                                     'X'.
       PERFORM bdc_dynpro      USING 'SAPLMLSP' '0200'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
    *perform bdc_field       using 'RM11P-HEADTEXT'
                                 'Earthwork text'.
    *perform bdc_field       using 'BDC_CURSOR'             "Start Service Line 2
                                 'ESLL-SRVPOS(02)'.
    *perform bdc_field       using 'RM11P-NEW_ROW'
                                 '10'.
    *perform bdc_field       using 'ESLL-SRVPOS(02)'
                                 '5000000006'.
    *perform bdc_field       using 'ESLL-MENGE(02)'
                                 '10'.
    *perform bdc_field       using 'ESLL-MEINS(02)'
                                 'kmk'.
    *perform bdc_field       using 'ESLL-TBTWR(02)'
                                 '500'.
    *perform bdc_dynpro      using 'SAPLMLSK' '0200'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'ESLL-INTROW'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_field       using 'VRTKZ1'
                                 'X'.
    *perform bdc_dynpro      using 'SAPLMLSK' '0200'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'ESKN-PS_PSP_PNR(01)'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_field       using 'VRTKZ1'
                                 'X'.
    *perform bdc_field       using 'ESKN-SAKTO(01)'
                                 '6010010'.
    *perform bdc_field       using 'ESKN-PS_PSP_PNR(01)'
                                 'HR/KMP-KU'.
    *perform bdc_dynpro      using 'SAPLMLSK' '0200'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'ESLL-INTROW'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '=BACK'.
    *perform bdc_field       using 'VRTKZ1'
                                 'X'.
    *perform bdc_dynpro      using 'SAPLMLSP' '0200'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '/00'.
    *perform bdc_field       using 'RM11P-HEADTEXT'
                                 'Earthwork text'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'ESLL-KTEXT1(01)'.
    *perform bdc_field       using 'RM11P-NEW_ROW'
                                 '10'.
    *perform bdc_dynpro      using 'SAPLMLSP' '0200'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '=ESB'.
    *perform bdc_field       using 'RM11P-HEADTEXT'
                                 'Earthwork text'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'ESLL-KTEXT1(01)'.
    *perform bdc_field       using 'RM11P-NEW_ROW'
                                 '10'.
    *perform bdc_dynpro      using 'SAPMM06E' '0120'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'RM06E-EBELP'.
    *perform bdc_field       using 'BDC_OKCODE'
                                 '=MALL'.
    *perform bdc_field       using 'RM06E-EBELP'
                                 '10'.
        PERFORM bdc_dynpro      USING 'SAPMM06E' '0120'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06E-EBELP'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=KOPF'.
       PERFORM bdc_field       USING 'RM06E-EBELP'
                                     '10'.
        PERFORM bdc_dynpro      USING 'SAPMM06E' '0101'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'EKKO-EKGRP'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=TXK'.
    *perform bdc_field       using 'EKKO-EKGRP'
                                 'DCE'.
    *perform bdc_field       using 'EKKO-PINCR'
                                 '10'.
    *perform bdc_field       using 'EKKO-UPINC'
                                 '1'.
    *perform bdc_field       using 'EKKO-WAERS'
                                 'INR'.
    *perform bdc_field       using 'EKKO-WKURS'
                                 ' 1.00000'.
        PERFORM bdc_dynpro      USING 'SAPMM06E' '0103'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06E-LTEX1(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
        PERFORM bdc_field       USING 'RM06E-LTEX1(01)'
                                      'Old PO no.'.
    *perform bdc_transaction using 'ME21'.
        w_hdr_counter = w_hdr_counter + 1.
      ENDWHILE.
      CALL TRANSACTION 'ME21' USING bdcdata  MODE 'A'.
      PERFORM close_group.
    ***************forms************
    FORM upload_file.
      CALL FUNCTION 'WS_FILENAME_GET'
      EXPORTING
    *def_filename = ' '
    *def_path = ' '
    *mask = ' '
      mode = '0'
      title = 'Choose the Appropriate excel sheet for service PO upload'
      IMPORTING
      filename = dataset
    *EXCEPTIONS
    *inv_winsys = 01
    *no_batch = 02
    *selection_cancel = 03
    *selection_error = 04
      l_file = dataset.
      PERFORM read_exceldata.
    ENDFORM.                    "UPLOAD_FILE
    *&      Form  READ_EXCELDATA
          text
    FORM read_exceldata.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
      filename = l_file
      i_begin_col = 1
      i_begin_row = 2
      i_end_col = 25
      i_end_row = 4
      TABLES
      intern = i_tab
    EXCEPTIONS
    INCONSISTENT_PARAMETERS = 1
    UPLOAD_OLE = 2
    OTHERS = 3
    ENDFORM.                    "READ_EXCELDATA
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM open_group.
      IF session = 'X'.
        SKIP.
        WRITE: /(20) 'Create group'(i01), group.
        SKIP.
      open batchinput group
        CALL FUNCTION 'BDC_OPEN_GROUP'
          EXPORTING
            client   = sy-mandt
            group    = group
            user     = user
            keep     = keep
            holddate = holddate.
        WRITE: /(30) 'BDC_OPEN_GROUP'(i02),
                (12) 'returncode:'(i05),
                     sy-subrc.
      ENDIF.
    ENDFORM.                    "OPEN_GROUP
      end batchinput session                                             *
      (call transaction using...: error session)                         *
    FORM close_group.
      IF session = 'X'.
      close batchinput group
        CALL FUNCTION 'BDC_CLOSE_GROUP'.
        WRITE: /(30) 'BDC_CLOSE_GROUP'(i04),
                (12) 'returncode:'(i05),
                     sy-subrc.
      ELSE.
        IF e_group_opened = 'X'.
          CALL FUNCTION 'BDC_CLOSE_GROUP'.
          WRITE: /.
          WRITE: /(30) 'Fehlermappe wurde erzeugt'(i06).
          e_group_opened = ' '.
        ENDIF.
      ENDIF.
    ENDFORM.                    "CLOSE_GROUP
    *&      Form  BDC_DYNPRO
          text
         -->PROGRAM    text
         -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "BDC_DYNPRO
    ****bdc field************
    FORM bdc_field USING fnam fval.
    IF FVAL <> NODATA.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDIF.
    ENDFORM.                    "BDC_FIELD
    FORM process_itab.
      APPEND LINES OF i_tab TO wa_hdr  .
      DELETE wa_hdr WHERE col > 13 .
      APPEND LINES OF i_tab TO wa_line  .
      DELETE wa_line WHERE   col <> 1   AND col <  14 .
      DATA : w_sr TYPE i.
      w_sr = 0.
      LOOP AT wa_hdr.
        IF wa_hdr-col = 1.
          w_sr = wa_hdr-value.
        ENDIF.
        wa_hdr1-row = wa_hdr-row.
        wa_hdr1-col = wa_hdr-col.
        wa_hdr1-value = wa_hdr-value.
        wa_hdr1-srno = w_sr.
        APPEND wa_hdr1.
        w_cnt = wa_hdr-row.
      ENDLOOP.
      w_sr = 0.
      LOOP AT wa_line.
        IF wa_line-col = 1.
          w_sr = wa_line-value.
        ENDIF.
        wa_line1-row = wa_line-row.
        wa_line1-col = wa_line-col.
        wa_line1-value = wa_line-value.
        wa_line1-srno = w_sr.
        APPEND wa_line1.
      ENDLOOP.
      w_sr = 0.
      CLEAR wa_line2.
      LOOP AT wa_line1.
        wa_line2-row = wa_line1-row.
        wa_line2-col = wa_line1-col.
        wa_line2-value = wa_line1-value.
        wa_line2-srno = wa_line1-srno.
        APPEND wa_line2.
      ENDLOOP.
    ENDFORM.                    "PROCESS_ITAB
    ***************forms************

    Hi Pradeep
    I find there is a problem in your code
    When ever you use
    PERFORM bdc_field USING 'BDC_OKCODE'
    you should follow it up with
    PERFORM bdc_dynpro USING <prg name> <screen number>
    Please find code below with changes from a part of your code
    PERFORM bdc_field USING 'RM06E-MATKL'
    wa_hdr1-value. "'c003'. Material Group
    * comment this statement is not needed now.
    * PERFORM bdc_dynpro USING 'SAPLMLSP' '0200'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    READ TABLE wa_line2 WITH KEY COL = 14 SRNO = wa_hdr1-srno ROW = wa_line1-ROW.
    * Put the bdc_dynpro for the prg name and screen number (I might be wrong with prg name and
    * Screen  number
    PERFORM bdc_dynpro USING 'SAPLMLSK' '0200'.
    Reward points as this will definitely help you
    Edited by: Sriram Chandran on Mar 15, 2008 4:39 PM

  • Transaction code for mass creation of physical Inventory document

    what is the transaction code for mass creation of physical Inventory document.

    MI31 is the transaction to create hundreds of physical inventory documents for annual inventory at a time.
    MICN can create several documents at a time for cycle count.
    Just look in the menu of phyiscal inventory into the knot Sessions, there are even more e.g. for counting of own stock a customer and vendor location, for vendor stock at own location etc.

  • Urgent need of code for abap hr program

    Hi,
    Can any one provide with coding to calculate the leave balance  for employee
    for a given period. Its very urgent.
    Thanks in advance,
    Subha

    Hi
    See this sample code for calculation of absence quota
    using 2001 and 2006 infotypes
    make changes as per your requirement
    REPORT zh_absence_quota
           NO STANDARD PAGE HEADING
           MESSAGE-ID zh_msg
           LINE-SIZE 169
           LINE-COUNT 60(1).
                   T A B L E S  D E C L A R A T I O N S
    TABLES:    pernr,    " Logical PNP
               t001p,    " Personnel Subarea
               t529u,    " Employment Status
               t500p,    " Personnel Area
               t501,     " Employee Group
               t503k,    " Employee Subgroup
               t549a,    " Payroll Area
               t554s,    " Absence Type
               t554t,    " Absence Type Texts
               t556a,    " Quota Type
               t527x,    " Orgn. Unit
               t556b,    " Quota Type Text
               pa0003.   " Payroll Status
    INFOTYPES:
               0000,   " Actions
               0001,   " Organizational Assignment
               2006,   " Absence Quota
               2001.   " Absences
                   T Y P E S  D E C L A R A T I O N S
    Employee Absence Structure
    TYPES: BEGIN OF s_2001,
             pernr TYPE persno,       " Personal Number
             awart TYPE awart,        " Absence Type
             subty TYPE subty,        " Sub Type
             endda TYPE endda,        " End date
             begda TYPE begda,        " Begin date
             abrtg TYPE abrtg,        " Absence days
             ename TYPE emnam,        " employee Name
             atext TYPE abwtxt,       " Absence Type Text
           END OF s_2001.
    Employee Absence Quota Structure
    TYPES: BEGIN OF s_2006,
             pernr TYPE persno,       " Personal Number
             ktart TYPE abwko,        " Absence Quota Type
             year(4) TYPE n,          " Year
             subty TYPE subty,        " Sub Type
             endda TYPE endda,        " End date
             begda TYPE begda,        " Begin date
             anzhl TYPE ptm_quonum,   " Absence Entitlement days
             ename TYPE emnam,        " employee Name
             ktext TYPE kotxt,        " Absence Type Text
             kverb TYPE kverb,        " Deduction Quota days
             anzhb TYPE ptm_quonum,   " Balance days
           END OF s_2006.
    Combined Employee Absence and Quota Structure
    TYPES: BEGIN OF s_rep,
             pernr TYPE persno,       " Personal Number
             ktart TYPE abwko,        " Absence Quota Type
             year(4) TYPE n,          " Year
             anzhl TYPE ptm_quonum,   " Absence Entitlement days
             kverb TYPE kverb,        " Deduction Quota days
             anzhb TYPE ptm_quonum,   " Balance days
             ktext TYPE kotxt,        " Quota Type Text
             awart TYPE awart,        " Absence Type
             abrtg TYPE abrtg,        " Absence days
             ename TYPE emnam,        " employee Name
             atext TYPE abwtxt,       " Absence Type Text
             endda TYPE endda,        " End date
             begda TYPE begda,        " Begin date
           END OF s_rep.
    Declaration of Variables
    DATA : gv_atext TYPE abwtxt,              " Absence Type Text
           gv_ktext TYPE kotxt,               " Absence Type Text
           gv_title1   TYPE sylisel,          " Report title
           gv_year(4)  TYPE c,                " Year
           gv_mon(2)   TYPE c,                " Month
           gv_hrs    TYPE abwtg,              " Hours
           gv_date   TYPE sydatum,            " Date
           gv_date1  TYPE sydatum,            " Date
           gv_dial.                           " Color flag
    Declaration of Constants
    CONSTANTS :
      c_x      TYPE c VALUE 'X',               " Sign
      c_1      TYPE persg   VALUE '1',         " Emp Group
      c_pernr(8) TYPE n VALUE '00000000',      " Pernr
      c_moabw  TYPE moabw   VALUE '01',        " Per SA Grouping
      c_mozko  TYPE mozko   VALUE '01',        " Per SA Grouping
      c_mopgk  TYPE mopgk   VALUE '1',         " Emp SGrp Grouping
      c_endda  TYPE sydatum VALUE '99991231',  " End Date
      c_val1(2) TYPE c VALUE '31',             " Date Type
      c_val2(2) TYPE c VALUE '12',             " Date Type
      c_val    LIKE p0041-dar01 VALUE '01',    " Date Type
      c_date1  LIKE sy-datum VALUE '18000101'. " Date
         I N T E R N A L  T A B L E S  D E C L A R A T I O N S
    DATA: i_2001 TYPE STANDARD TABLE OF s_2001 WITH HEADER LINE,
          i_2006 TYPE STANDARD TABLE OF s_2006 WITH HEADER LINE,
          i_rep1 TYPE STANDARD TABLE OF s_2006 WITH HEADER LINE,
          i_rep  TYPE STANDARD TABLE OF s_rep WITH HEADER LINE.
                     S E L E C T I O N  S C R E E N
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_ktart FOR t556a-ktart,  " Absence Quota Type
                    s_awart FOR t554s-subty.  " Absence Type
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) text-003.   " Quota & Absence
    PARAMETERS: p_qa RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) text-004.   " Quota
    PARAMETERS: p_q RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(33) text-005.   " Absence
    PARAMETERS: p_a RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF LINE.SELECTION-SCREEN END OF BLOCK b2.
                      I N I T I A L I Z A T I O N                        *
    INITIALIZATION.
                  A T  S E L E C T I O N - S C R E E N                   *
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_screen.
                   S T A R T - O F - S E L E C T I O N                   *
    START-OF-SELECTION.
    Selection of Period
      PERFORM get_period.
    Get PERNR from LDB
    GET pernr.
      IF p0000-stat2 <> '0'.
    Get the data from PA0001,PA2001, PA2006
        PERFORM get_pers_data.
      ENDIF.
                   T O P - O F - P A G E                                 *
    TOP-OF-PAGE.
    Header of the List
      PERFORM header.
                   E N D - O F - P A G E                                 *
    Footer
    END-OF-PAGE.
      IF p_qa = c_x.
    Display both Absence and Quota Data
        WRITE /1(188) sy-uline.
      ELSEIF p_q = c_x.
    Display only Quota Data
        WRITE /1(114) sy-uline.
      ELSEIF p_a = c_x.
    Display only Absence Data
        WRITE /1(125) sy-uline.
      ENDIF.
                   E N D - O F - S E L E C T I O N                       *
    END-OF-SELECTION.
    Combine the Absence and Quota Data
      PERFORM append_data.
      IF p_qa = c_x.
    Display both Absence and Quota Data
        PERFORM display_qa_data.
      ELSEIF p_q = c_x.
    Display only Quota Data
        PERFORM display_q_data.
      ELSEIF p_a = c_x.
    Display only Absence Data
        PERFORM display_a_data.
      ENDIF.
    *&      Form  validate_screen
    Validation of Selection Screen fields
    FORM validate_screen .
    Validation of Personnel Number
      CLEAR pa0003.
      IF NOT pnppernr[] IS INITIAL.
        SELECT pernr
        FROM pa0003 UP TO 1 ROWS
          INTO pa0003-pernr
          WHERE pernr IN pnppernr.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Personnel Number'(006).
        ENDIF.
      ENDIF.
    Validation of Employee Status
      CLEAR t529u.
      IF NOT pnpstat2[] IS INITIAL.
        SELECT SINGLE statv
          INTO t529u-statv
          FROM t529u
          WHERE statv IN pnpstat2 AND
                statn = '2' AND
                sprsl = sy-langu.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Invalid Employee Status'(007).
        ENDIF.
      ENDIF.
    Validation of Personnel Area
      CLEAR t500p.
      IF NOT pnpwerks[] IS INITIAL.
        SELECT persa
        FROM t500p UP TO 1 ROWS
          INTO t500p-persa
          WHERE persa IN pnpwerks.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Personnel Area'(008).
        ENDIF.
      ENDIF.
    Validation of Personnel Sub Area
      CLEAR t001p.
      IF NOT pnpbtrtl[] IS INITIAL.
        SELECT btrtl
        FROM t001p UP TO 1 ROWS
          INTO t001p-btrtl
          WHERE btrtl IN pnpbtrtl.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Personnel Sub Area'(009).
        ENDIF.
      ENDIF.
    Validation of Employee Group
      CLEAR t501.
      IF NOT pnppersg[] IS INITIAL.
        SELECT persg
        FROM t501 UP TO 1 ROWS
          INTO t501-persg
          WHERE persg IN pnppersg.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Employee Group'(010).
        ENDIF.
      ENDIF.
    Validation of Employee Sub Group
      CLEAR t503k.
      IF NOT pnppersk[] IS INITIAL.
        SELECT persk
        FROM t503k UP TO 1 ROWS
          INTO t503k-persk
          WHERE persk IN pnppersk.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Employee Sub Group'(011).
        ENDIF.
      ENDIF.
    Validation of Payroll Area
      CLEAR t549a.
      IF NOT pnpabkrs[] IS INITIAL.
        SELECT abkrs
        FROM t549a UP TO 1 ROWS
          INTO t549a-abkrs
          WHERE abkrs IN pnpabkrs.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Employee Payroll Area'(026).
        ENDIF.
      ENDIF.
    Validation of Absence Type
      CLEAR t554s.
      IF NOT s_awart[] IS INITIAL.
        SELECT subty
        FROM t554s UP TO 1 ROWS
          INTO t554s-subty
          WHERE subty IN s_awart AND
                moabw EQ c_moabw AND
                endda EQ c_endda.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Employee Absence Type'(012).
        ENDIF.
      ENDIF.
    Validation of Absence Quota Type
      CLEAR t556a.
      IF NOT s_ktart[] IS INITIAL.
        SELECT ktart
        FROM t556a UP TO 1 ROWS
          INTO t556a-ktart
          WHERE ktart IN s_ktart AND
                mopgk EQ c_mopgk AND
                mozko EQ c_mozko AND
                endda EQ c_endda.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE e999 WITH 'Incorrect Employee Quota Type'(013).
        ENDIF.
      ENDIF.
    ENDFORM.                  "validate_screen
    *&      Form  get_period
    Get the Correct Period based on Selection screen selection
    FORM get_period.
      CLEAR: gv_year,gv_mon, gv_date, gv_date1.
      gv_year = sy-datum+0(4).
      gv_mon  = sy-datum+4(2).
      IF pnptimr1 = c_x.      " Current Date
        pnpbegda = sy-datum.
        pnpendda = sy-datum.
      ELSEIF pnptimr2 = c_x.  " Current Month
        CONCATENATE gv_year gv_mon c_val INTO gv_date.
        CONCATENATE gv_year gv_mon c_val1 INTO gv_date1.
        pnpbegda = gv_date.
        pnpendda = gv_date1.
      ELSEIF pnptimr3 = c_x.  " Current Year
        CONCATENATE gv_year c_val c_val INTO gv_date.
        CONCATENATE gv_year c_val2 c_val1 INTO gv_date1.
        pnpbegda = gv_date.
        pnpendda = gv_date1.
      ELSEIF pnptimr4 = c_x.  " Upto Today
        pnpbegda = c_date1.
        pnpendda = sy-datum.
      ELSEIF pnptimr5 = c_x.  " From Today
        pnpbegda = sy-datum.
        pnpendda = c_endda.
      ELSE.
        IF ( pnpbegda IS INITIAL AND pnpendda IS INITIAL ).
          pnpbegda = c_date1.
          pnpendda = c_endda.
        ELSEIF pnpbegda IS INITIAL AND NOT pnpendda IS INITIAL.
          pnpbegda = c_date1.
          pnpendda = pnpendda.
        ELSEIF NOT ( pnpbegda IS INITIAL AND pnpendda IS INITIAL ).
          pnpbegda = pnpbegda.
          pnpendda = pnpendda.
        ENDIF.
      ENDIF.
    ENDFORM.              "get_period
    *&      Form  get_pers_data
    Get the Absence and Quota Data from PA0001,PA2001,PA2006
    FORM get_pers_data.
      DATA: lv_year1(4) TYPE n,
            lv_year2(4) TYPE n,
            lv_date1 TYPE sydatum,
            lv_date2 TYPE sydatum,
            lv_anzhb TYPE ptm_quonum.   " Last Year Balance days
    Get data from Respective Infotypes
      rp_provide_from_last p0001 space pnpbegda pnpendda.
    Absence Data
      LOOP AT p2001 WHERE pernr = pernr-pernr AND
                          begda GE pnpbegda   AND
                          endda LE pnpendda.
        IF p2001-awart IN s_awart.
          i_2001-pernr    = pernr-pernr.
          i_2001-subty    = p2001-subty.
          i_2001-awart    = p2001-awart.
          i_2001-abrtg    = p2001-abrtg.
          i_2001-begda    = p2001-begda.
          i_2001-endda    = p2001-endda.
          READ TABLE p0001 WITH KEY pernr = p2001-pernr.
          i_2001-ename    = p0001-ename.
    Get the Absence Type Text
          CLEAR gv_atext.
          SELECT SINGLE atext INTO gv_atext FROM t554t
                  WHERE sprsl = sy-langu AND
                        moabw = c_moabw  AND
                        awart = p2001-awart.
          IF sy-subrc = 0.
            i_2001-atext = gv_atext.
          ENDIF.
          APPEND i_2001.
          CLEAR i_2001.
        ENDIF.
      ENDLOOP.
    Quota Data
      LOOP AT p2006 WHERE pernr = pernr-pernr AND
                          begda GE pnpbegda   AND
                          endda LE pnpendda.
        IF p2006-ktart IN s_ktart.
          i_2006-pernr    = pernr-pernr.
          i_2006-subty    = p2006-subty.
          i_2006-begda    = p2006-begda.
          i_2006-endda    = p2006-endda.
          i_2006-year     = p2006-endda+0(4).
          i_2006-ktart    = p2006-ktart.
          i_2006-anzhl    = p2006-anzhl.
          i_2006-kverb    = p2006-kverb.
          i_2006-anzhb    = p2006-anzhl - p2006-kverb.
          READ TABLE p0001 WITH KEY pernr = p2001-pernr.
          i_2006-ename    = p0001-ename.
    Get the Quota Type Text
          CLEAR gv_ktext.
          SELECT SINGLE ktext INTO gv_ktext FROM t556b
                  WHERE sprsl = sy-langu AND
                        mopgk = c_mopgk  AND
                        mozko = c_mozko  AND
                        ktart = p2006-ktart.
          IF sy-subrc = 0.
            i_2006-ktext = gv_ktext.
          ENDIF.
          APPEND i_2006.
          CLEAR i_2006.
        ENDIF.
      ENDLOOP.
    For Vacation Quota (80) get the Balance of the Last Year and
    add to the Current Year Quota
      LOOP AT i_2006.
        IF i_2006-ktart = '80'.
          lv_year1 = i_2006-endda+0(4).
          lv_year2 = lv_year1 - 1.
          CONCATENATE lv_year2 '01' '01' INTO lv_date1.
          CONCATENATE lv_year2 '12' '31' INTO lv_date2.
          LOOP AT p2006 WHERE pernr = i_2006-pernr AND
                              begda GE lv_date1    AND
                              endda LE lv_date2    AND
                              ktart = '80'.
            lv_anzhb = p2006-anzhl - p2006-kverb.
            i_rep1-pernr = i_2006-pernr.
            i_rep1-ktext = i_2006-ktext.
            i_rep1-anzhl = p2006-anzhl.
            i_rep1-kverb = p2006-kverb.
            i_rep1-ename = i_2006-ename.
            i_rep1-begda = p2006-begda.
            i_rep1-endda = p2006-endda.
            i_rep1-anzhb = lv_anzhb.
            i_rep1-ktart = '80'.
            i_rep1-year = lv_year2.
            APPEND i_rep1.
            CLEAR: i_rep1.
          ENDLOOP.
        ENDIF.
        CLEAR: lv_year1, lv_year2,
               lv_date1, lv_date2,lv_anzhb.
      ENDLOOP.
      SORT i_rep1 BY pernr ktart.
    ENDFORM.          "get_pers_data
    *&      Form  append_data
    Put the Absence and Quota Data into one Report Int Table
    FORM append_data.
      CLEAR:   i_rep.
      REFRESH: i_rep.
      SORT i_2001 BY pernr awart.
      SORT i_2006 BY pernr ktart year.
    Move I_REP1 data into i_2006
      LOOP AT i_rep1.
        MOVE-CORRESPONDING i_rep1 TO i_2006.
        APPEND i_2006.
        CLEAR  i_2006.
      ENDLOOP.
    Move the Absence and Quota Data into a final Int Table
      LOOP AT i_2006.
        i_rep-pernr = i_2006-pernr.
        i_rep-ename = i_2006-ename.
        i_rep-ktart = i_2006-ktart.
        i_rep-anzhl = i_2006-anzhl.
        i_rep-kverb = i_2006-kverb.
        i_rep-ktext = i_2006-ktext.
        i_rep-anzhb = i_2006-anzhb.
        i_rep-year  = i_2006-year.
        CLEAR i_2001.
        CASE i_2006-ktart.
          WHEN '81'.
            PERFORM get_2001 USING i_2006-pernr '1000' i_2006-year.
          WHEN '50'.
            PERFORM get_2001 USING i_2006-pernr '1002' i_2006-year.
          WHEN '80'.
            PERFORM get_2001 USING i_2006-pernr '1001' i_2006-year.
          WHEN '56'.
            PERFORM get_2001 USING i_2006-pernr '1003' i_2006-year.
          WHEN '51'.
            PERFORM get_2001 USING i_2006-pernr '1004' i_2006-year.
          WHEN '52'.
            PERFORM get_2001 USING i_2006-pernr '1005' i_2006-year.
          WHEN '54'.
            PERFORM get_2001 USING i_2006-pernr '1006' i_2006-year.
          WHEN '53'.
            PERFORM get_2001 USING i_2006-pernr '1007' i_2006-year.
          WHEN '55'.
            PERFORM get_2001 USING i_2006-pernr '1008' i_2006-year.
          WHEN '57'.
            PERFORM get_2001 USING i_2006-pernr '1009' i_2006-year.
          WHEN '90'.
            PERFORM get_2001 USING i_2006-pernr '2000' i_2006-year.
          WHEN '58'.
            PERFORM get_2001 USING i_2006-pernr '2001' i_2006-year.
          WHEN '59'.
            PERFORM get_2001 USING i_2006-pernr '2002' i_2006-year.
          WHEN '91'.
            PERFORM get_2001 USING i_2006-pernr '2003' i_2006-year.
        ENDCASE.
        IF sy-subrc <> 0.
          APPEND i_rep.
        ENDIF.
        CLEAR i_rep.
      ENDLOOP.
      SORT i_rep BY pernr ktart year.
      DELETE i_rep WHERE pernr = ' '.
    ENDFORM.              " append_data
    *&      Form  display_qa_data
    Display the Absence and Quota Data
    FORM display_qa_data.
      DATA: lv_flag,                   " New Flag
            lv_tot2 TYPE ptm_quonum.   " Absence Balance days
      IF i_rep[] IS INITIAL.
        MESSAGE i000 WITH 'No Data found'(014).
      ELSE.
        LOOP AT i_rep.
    toggle color
          PERFORM toggle_color.
          IF lv_flag <> space.
            NEW-LINE.
          ENDIF.
          AT NEW pernr.
            READ TABLE i_rep INDEX sy-tabix.
            WRITE:/1 sy-vline,2(8) i_rep-pernr,
              10 sy-vline,11(40)   i_rep-ename.
          ENDAT.
          AT NEW ktart.
            READ TABLE i_rep INDEX sy-tabix.
            WRITE: 1 sy-vline, 10 sy-vline,
              51 sy-vline,52(25)   i_rep-ktext.
          ENDAT.
          AT NEW year.
            READ TABLE i_rep INDEX sy-tabix.
            WRITE: 1 sy-vline, 10 sy-vline,
                  51 sy-vline,
                  77 sy-vline, 78(4)  i_rep-year,
                  82 sy-vline, 83(11) i_rep-anzhl,
                  94 sy-vline, 95(25) i_rep-atext,
                 120 sy-vline,133 sy-vline,
                 144 sy-vline,
                 155 sy-vline,156(13)  i_rep-anzhb,
                 169 sy-vline.
          lv_tot2 = lv_tot2 + i_rep-anzhb.
          ENDAT.
          WRITE: 1 sy-vline,  10 sy-vline,
                51 sy-vline,  77 sy-vline,
                82 sy-vline,  94 sy-vline,
               120 sy-vline,121(12)  i_rep-abrtg NO-ZERO,
               133 sy-vline,134(10)  i_rep-begda NO-ZERO,
               144 sy-vline,145(10)  i_rep-endda NO-ZERO,
               155 sy-vline,169 sy-vline.
          NEW-LINE.
          AT END OF pernr.
            WRITE  : /1(169) sy-uline.
            SUM.
            FORMAT COLOR 3.
            WRITE:/1 sy-vline,   10 sy-vline,
                  51 sy-vline,   77 sy-vline,
                  82 sy-vline,   94 sy-vline,
                 120 sy-vline,121(12) i_rep-abrtg,
                 133 sy-vline,144 sy-vline,
                 155 sy-vline, 156(13) lv_tot2,
                 169 sy-vline.
            FORMAT COLOR OFF.
            WRITE  : /1(169) sy-uline.
            CLEAR lv_tot2.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.              " display_qa_data
    *&      Form  display_q_data
    Display only the Quota Data
    FORM display_q_data.
      DATA: lv_flag.               " New Flag
      SORT i_2006 BY pernr ktart year.
      IF i_2006[] IS INITIAL.
        MESSAGE i000 WITH 'No Data found'(014).
      ELSE.
        LOOP AT i_2006.
    Toggle Color
          PERFORM toggle_color.
          IF lv_flag <> space.
            NEW-LINE.
          ENDIF.
          AT NEW pernr.
            READ TABLE i_2006 INDEX sy-tabix.
            WRITE: /1 sy-vline,  2(8)  i_2006-pernr,
                   10 sy-vline,11(40)  i_2006-ename.
          ENDAT.
          AT NEW ktart.
            READ TABLE i_2006 INDEX sy-tabix.
            WRITE: 1 sy-vline,10 sy-vline,
                  51 sy-vline,52(25)  i_2006-ktext.
          ENDAT.
          AT NEW year.
            READ TABLE i_2006 INDEX sy-tabix.
            WRITE: 1 sy-vline,  10 sy-vline,
                  51 sy-vline,
                  77 sy-vline,78(4)  i_2006-year,
                  82 sy-vline,83(11) i_2006-anzhl,
                  94 sy-vline,95(13) i_2006-anzhb,
                 108 sy-vline.
            NEW-LINE.
          ENDAT.
          AT END OF pernr.
            WRITE  : /1(108) sy-uline.
            SUM.
            FORMAT COLOR 3.
            WRITE: /1 sy-vline, 10 sy-vline,
                   51 sy-vline,
                   77 sy-vline, 82 sy-vline,
                   94 sy-vline, 95(13) i_2006-anzhb,
                  108 sy-vline.
            FORMAT COLOR OFF.
            WRITE  : /1(108) sy-uline.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.              " display_q_data
    *&      Form  display_a_data
    Display Only the Absence Quota
    FORM display_a_data.
      DATA: lv_flag.               " New Flag
      SORT i_2001 BY pernr awart.
      IF i_2001[] IS INITIAL.
        MESSAGE i000 WITH 'No Data found'(014).
      ELSE.
        LOOP AT i_2001.
    Toggle Color
          PERFORM toggle_color.
          IF lv_flag <> space.
            NEW-LINE.
          ENDIF.
          AT NEW pernr.
            READ TABLE i_2001 INDEX sy-tabix.
            WRITE: /1 sy-vline, 2(10) i_2001-pernr,
                   10 sy-vline,11(40) i_2001-ename.
          ENDAT.
          WRITE:  1 sy-vline, 10 sy-vline,
                  51 sy-vline,52(25) i_2001-atext,
                  77 sy-vline,78(12) i_2001-abrtg,
                  90 sy-vline,91(10) i_2001-begda,
                 101 sy-vline,102(10) i_2001-endda,
                 112 sy-vline.
          NEW-LINE.
          AT END OF pernr.
            WRITE  : /1(112) sy-uline.
            SUM.
            FORMAT COLOR 3.
            WRITE: /1 sy-vline, 10 sy-vline,
                   51 sy-vline,
                   77 sy-vline,78(12) i_2001-abrtg,
                   90 sy-vline,101 sy-vline,
                  112 sy-vline.
            FORMAT COLOR OFF.
            WRITE  : /1(112) sy-uline.
          ENDAT.
        ENDLOOP.
      ENDIF.
    ENDFORM.              " display_a_data
    *&      Form  header
    Write the Report Header
    FORM header .
      data : lv_pers type pbtxt,
             lv_orgn type orgtx.
      gv_title1 = sy-title.              " Set List Header
      IF p_qa = c_x.
        NEW-PAGE LINE-SIZE 193.
      ELSEIF p_a = c_x.
        NEW-PAGE LINE-SIZE 125.
      ELSEIF p_q = c_x.
        NEW-PAGE LINE-SIZE 119.
      ENDIF.
    Standard header
      FORMAT RESET.
      CALL FUNCTION 'Z_STANDARD_HEADER'
        EXPORTING
          title1 = gv_title1.
    Get the Personal Area and Org.Unit Texts
      clear : lv_pers,lv_orgn.
      select single name1 into lv_pers
        from t500p where persa = pnpwerks-low.
      select single orgtx into lv_orgn
        from t527x where sprsl = sy-langu and
                         orgeh = pnporgeh-low and
                         endda = c_endda.
      if not lv_pers is initial.
        write : /2 'Personal Area:'(017), 17(25) lv_pers color 7.
      endif.
      if not lv_orgn is initial.
        write : /2 'Organization Unit:'(021), 20(25) lv_orgn color 3.
      endif.
      IF p_qa = c_x.
        FORMAT COLOR COL_HEADING.
        WRITE  : /1(169) sy-uline.
        WRITE:/1 sy-vline,2(8)    'Emp.No'(015) CENTERED,
              10 sy-vline,11(40)  'Employee Name'(016) CENTERED,
              51 sy-vline,52(25)  'Quota Description'(018) CENTERED,
              77 sy-vline,78(4)   'Year'(027),
              82 sy-vline,83(11)  'Entitlement'(019),
              94 sy-vline,95(25)  'Absence Description'(022) CENTERED,
             120 sy-vline,121(12) 'Absence days'(023),
             133 sy-vline,134(10) 'From Date'(024),
             144 sy-vline,145(10) 'To Date'(025),
             155 sy-vline,156(13) 'Quota Balance'(020),
             169 sy-vline.
        WRITE  : /1(169) sy-uline.
      ELSEIF p_q = c_x.
        FORMAT COLOR COL_HEADING.
        WRITE  : /1(108) sy-uline.
        WRITE:/1 sy-vline,2(8)   'Emp.No'(015) CENTERED,
              10 sy-vline,11(40) 'Employee Name'(016) CENTERED,
              51 sy-vline,52(25) 'Quota Description'(018) CENTERED,
              77 sy-vline,78(4)  'Year'(027),
              82 sy-vline,83(11) 'Entitlement'(019),
              94 sy-vline,95(13) 'Quota Balance'(020),
             108 sy-vline.
        WRITE  : /1(108) sy-uline.
      ELSEIF p_a = c_x.
        FORMAT COLOR COL_HEADING.
        WRITE  : /1(112) sy-uline.
        WRITE:/1 sy-vline,2(8)    'Emp.No'(015) CENTERED,
              10 sy-vline,11(40)  'Employee Name'(016) CENTERED,
              51 sy-vline,52(25)  'Absence Description'(022) CENTERED,
              77 sy-vline,78(12)  'Absence days'(023),
              90 sy-vline,91(10)  'From Date'(024),
             101 sy-vline,102(10) 'To Date'(025),
             112 sy-vline.
        WRITE  : /1(112) sy-uline.
      ENDIF.
    ENDFORM.                    " header
    *&      Form  toggle_color
    This routine alters the color of the records in the list
    FORM toggle_color.
      IF gv_dial = space.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
        gv_dial = c_x.
      ELSE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        CLEAR gv_dial.
      ENDIF.
    ENDFORM.                    " toggle_color
    *&      Form  get_2001
    Get the ABsence type for each Quota type
    FORM get_2001 USING p_pernr TYPE persno
                        p_value TYPE awart
                        p_year.
      LOOP AT i_2001 WHERE pernr = p_pernr AND
                           awart = p_value AND
                           endda+0(4) = p_year.
        i_rep-awart = i_2001-awart.
        i_rep-abrtg = i_2001-abrtg.
        i_rep-atext = i_2001-atext.
        i_rep-begda = i_2001-begda.
        i_rep-endda = i_2001-endda.
        APPEND i_rep.
      ENDLOOP.
    ENDFORM.                                                    " get_2001
    <b>
    Reward points for useful Answers</b>
    Regards
    Anji

Maybe you are looking for

  • Banner image will not display in Dreamweaver; can you help?

    Banner image will not display in Dreamweaver; can you help?

  • Which one do I get?

    hello peeps! I am looking for a bluetooth headset you know the ones that go on your ear I guess the wireless kind. Now can I get any kind or do I have to buy the apple one?

  • Noisy Video Exports

    Hey When I export dnxhd or cineform, anything it is always noisier than what is displayed in premiere. Im on a pc have you experienced anything similar here are some pictures it is hard to see in compressed pictures but it looks like noise and bandin

  • APEX_LIST.SELECT_ITEM() issue

    Hi all, I'm new to Apex. I'm having a problem when I want to download a CSV report from an interactive report, the thing here is that the interactive report has this SQL query code in its region source: select APEX_ITEM.SELECT_LIST(1,'Y','Yes;Y,No;N'

  • Duplicated Photos in Library

    Somehow each of my pictures in the library have been duplicated.  How do I easily delete all duplicates?