Open items move on desktop

When I have several items open on the desktop the one I'm working on is suddenly covered by others from 'behind'. It is particularly hard to use the scroll bar because putting the cursor near the 'edge' of an item seems to activate this effect. How can I turn it off?

Hi jacbouvier, Welcome to Apple Discussions.
It sounds like what is hapening may be that when you go to the scroll bar you are going a bit too far to the right and activating a window behind the one you are working one. If this is the case, just drag your active window further right to cover other windows or expand it cover them.
If this happens independently of your mouse actions let us know and we can troubleshoot it further.
-mj
[email protected]

Similar Messages

  • Weird Happenings with Trash Access, Desktop Item Movement, About this Mac

    My computer appeared to working fine as off six or so hours ago, but when I went to move a word doc on my desktop to another place on my desktop, I notice something strange and unnerving. I could pick up the doc, highlight it, even open it, but I could not move it from one place to another on my desktop. The icon appears to move with my mouse after I click on it, as it always does, but when I go to drop it at the desired location, the icon does not "stick." There is just a quick blur as the translucent dragged copy zooms back to original. I can move icons from the desktop to a finder window or a folder on the desktop that isn't opened in a finder window, but I can drop a doc or a folder onto the desktop from the finder window. I have no idea what is going on with this.
    As I was traversing my dock shortly after this initial discovery, I made another. When I click on my trash, the animated dock ceases movement and ability to function. the mouse pauses, does a spinning beachball, and in 2 minutes things appear to be normal. However, I just want to know what is going on, and I have no clue. When this occurs, I can still select items on the desktop and open them. However, I can not access the dock at all and I can't even use the command tab feature to switch apps.
    Finally, as I went to sign up to post here, I noticed the final issue. I tried to click the "About this Mac" feature under the apple icon in the upper left corner and the info window would not open, hence the lack of info regarding my operating system.
    Anyone? Help me please.

    Hi JEDz, and a warm welcome to the forums!
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these files to the Desktop.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist
    /Users/YourUserName/Library/Preferences/com.apple.dock.plist
    /Users/YourUserName/Library/Preferences/com.apple.desktop.plist
    Test if the Finder/Desktop/Dock works right while in Safe Mode, reboot when complete, test again.

  • So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    So I have a file on my desktop and I cannot open it, move it to a folder, or delete it from my mac. I dont know what it has in it, and that makes me suspicious. What can I do to remove this unremovable file from my computer? Is it a virus?

    First, I would recommend repairing the hard drive with Disk Utility.
    If that doesn't fix the problem, there's a very dangerous command you can execute in the Terminal.  This is very hazardous, because a simple typo can result in very drastic consequences.  I have seen people erase their entire hard drive by putting a space in the wrong place!  So, please follow the directions I'm going to give you very carefully!
    Open the Terminal, which is found in the Utilities folder in the Applications folder.  In the Terminal, enter the following:
    sudo rm -f
    Make sure to put a space after the "-f"!  Then, drag the troublesome file from the Finder and drop it on the Terminal window.  That should insert the path to the file in the command.  Then go back to the Terminal and press return.  You will be asked for your password, and when you type it, nothing will be shown as a security measure.  Press return again after entering your password.  The file should be deleted.

  • Case: When trying t work in a second desktop, a program cannot be used if open in the first desktop. The screen just moves back to the first deskt

    When I try to work in a second desktop, a program cannot be used if already open in the first desktop. The screen just moves back to the first desktop. Anybody else have this issue?

    Whether or not this behavior occurs depends upon various preference settings and upon how you try to access the application in question.  Personally, I like to organize my desktops according to project, so I regularly have windows from the same application spread out over several desktops. No problem.
    For example, I have a Safari window in Desktop 1 and I want a Safari window in desktop 2. If, while in desktop 2, I bring Safari to the front by clicking on the Dock icon, I can open a new window in the usual ways. I could also just control-click on the Safari icon in the dock to get a new window in desktop 2. 
    (The only application that is a little weird in this regard is Finder. You have to do the control-click on it or it will always switch to a space with a window open.)
    To make all this occur, I have Safari assigned to no desktops (control-click on Safari icon, then on Options) and in Mission Control preferences (in System Preferences) I have "When switching to an application..." UNchecked.
    (Note that, with these settings, if an application is already in front and you click on its icon - or click twice on the icon if the applcation is not in front - the OS will assume you are looking for another open window and will switch spaces to give you one.)
    Hope this helps.
    charlie

  • QT 7.6 fails to open when movie icon clicked

    I just downloaded and installed the new update to Leopard (10.5.7) and now, something seems to have gone wrong with Quicktime's - to be exact QT Pro 7.6 - ability to recognize files. Until this morning, I could open a movie file (say, .mov, .MPEG, etc.) or audio file (e.g. MP3) with a control-click on the icon and choosing QT from the various players offered for opening the file. Or, as usual, I could simply double-click on a QT icon. Either way, the file would open in QT and be ready to play.
    Now, suddenly, this no longer works. If I double-click on a QT icon or try to Open it with the control-click move, I see QT appear for an instant - its name appears in the menu bar at top of desktop - but it disappears just as quickly and the file is not presented in a player window.
    I can still open Quicktime as a program first and then use its "Open File ...." menu command to pick a file and play it, no problem. And once the program is open, I can do the double-click move and QT files will open normally for playing.
    I have re-downloaded and re-installed QT, but no luck. I am repairing disk permissions and will see if that helps. (No luck; nothing has changed.)
    If anyone could enlighten me as to how OS X or its apps recognize file types, I'd be grateful. I know that in the Info pane, one can assign an app to a specific file or to all files of a certain type, but I don't quite understand where this linkage could get broken - if that is indeed what has happened on my machine.
    I don't see any other problems of this sort with other kinds of files or apps.
    Thanks in advance.
    John

    I had not repaired permissions, but I will try that. And in response to a suggestion from someone on the Leopard/Finder & Files discussion, I installed the 10.5.7 update and my experience is explained there, like so:
    First, thanks, Baltwo, much for the response and suggested fix. I did set up another admin account and logged-in there, the problem did not seem to exist there, so I went back and installed the 10.5.7 Combo Update, as suggested, and ... well, things have become slightly more mysterious.
    For instance, I have a couple of .MOV files I'd downloaded from the Web. I double-clicked on one of them and I got the same problematic behavior: Quicktime flashed open momentarily, then disappeared, and the .MOV file is left unopened. I tried the other movie file, and same thing. Then, I picked an MP3 file and control-clicked it and chose from the pop-up menu to Open it with Quicktime. Voila, it opened. And now, with that MP3 still open, I went back to the .MOV files and they both opened in Quicktime with a standard double-click.
    I now closed QT and tried to double-click one of the .MOV files. Sure enough, it opened just fine. And the second one, too. I closed QT and tried this again, to confirm. But no, now these files would not open the right way.
    Puzzle No. 1: In my Finder's list of Recent (App) Items, the name Quicktime shows up twice. This is downright strange, and makes me wonder if the OS is confused or seeing some set of mismatched QT components from different releases of the program.
    I can erase the Recent Items list and then, even if I my trying to open a QT file fails, the name Quicktime shows up in the list. If I then do get another QT file to open, there will be a second listing of QT in the Recent Items list - as if two distinct programs had been called upon.
    Puzzle No. 2: When I did open that MP3, it seemed to take considerably longer than usual, as if the computer were having to sort something out before it opened the file. And when MP3 data is loading into QT, it takes much longer than it used to - maybe 5 times slower or more. This new sluggishness in Quicktime actually has been evident to me ever since I first installed Leopard a few weeks ago. I got to live with it, but it was certainly annoying at first - and still is, if I think about it, because it makes me suspect that QT, or more likely, supporting code within Leopard, has been diddled in some way that's highly optimized for the Intel processor and in so doing treats Power PC as a lesser chip, or even an afterthought. My further trouble with opening QT files seems to point to the same thing. Certainly, I hope I'm wrong.
    Puzzle No. 3: I tried to open some .DV movie files that I'd made with iMovie awhile back. Their icon shows the QT logo and they've always opened by default with QT. A double-click wouldn't open them, no matter if the QT was already open or not. With QT already open to an MP3 file, one of these .DVs opened with the Control-click-Open move, but not the others. Otherwise, nothing doing.
    Maybe some of this evidence points to another possible fix, or offers insight into changes we're not being told about or that were unanticipated. I hope Apple is listening and will offer some advice or a fix.
    Thanks all, John

  • Why can't i delete items on my desktop

    When I try to delete items from my desktop, I keep getting the message: The operation can’t be completed because you don’t have permission to access some of the items.
    I've gone into Get Info and unlocked the items to try to move them and I still can't delete them. I can open them, but not delete them.
    Can anyone help? Thank you!

    Oh no, I have another problem. When I try to delete a few of the items it says: The operation can’t be completed because the item “staffing.doc” is in use.
    I've unlocked it and changed the preferences so I can access it, but I still can't delete it. It's not open on my computer.
    Do you have any suggestions?

  • Doubt about report FBL5N of screen field:Open items and Cleared items

    hi
    i know the report FBL5N is use DDF LDB and the report work flow is BSID->BKFP->BSEG
    but i don't know to differentiate Open Items and Cleared items in this report.
    Open items and Cleared items stand for a field flag in these table (BSID,BKFP,BSEG )? if true the field is?
    or they must be calc in program ? if true what about calc rules?
    waiting for help! thank you!

    Hi,
    Here is the difference in Open Items and Cleared Items.
    In FI first the document is Open (when it is posted) so the entry is made in table BSID. Once the document is cleared, it will move from BSID to BSAD. And for Cleared item you will see Clearing Document no and Clearing date values updated (these are blank when the item is open).
    The only difference in Open and Cleared is via Clearing Document and Clearing Date. If the values are present, it means document is cleared.
    Hope this helps.
    ashish
    Message was edited by:
            Ashish Gundawar

  • Letter of credit aginst Open item and Oldest open items

    I raise the sales order against Letter of Credit. when i am saving the order throughs a message that Maximum open item value is exceeded for static credit check.
    When i am doing delivery system throughs an error that order is blocked
    Can u suggest me come out from this problem and guide me for Statci credit against Letter of credit( how the System behaves)
    Kishore

    Hi,
    Open items check means it will consider all the open items when it is doing credit check. Here it adds all the open items amount and do the credit check..
    Oldest open item means it will consider only the oldest open item and based on tht i will do credit check..Here i will check the oldest open item value and its date then do the credit check..
    Coming to payment terms check, system is responding correctly.. because payment terms are immed due net. tht means still time is there in the same day. that is the reason it is not blocking the second document.
    once move to 2nd day then it means first doc is not cleared tht is the reason it is blocking the 2 nd doc on 2nd doc..
    Hope u have understand..
    Regards
    Sankar

  • F-03 missing open items (Not able to run RFSEPA02)

    Hi all,
    One of the GL account was change to open item managed. The situation is that we still have open items which do not appear in F-03.
    I checked SAP note 136754 and it asks me to run program RFSEPA02 but when I run that program it says "
    "Do not use the report program to set up open item management for the   
    account.                                                                               
    Create a new account with the correct account assignment. Post your    
    items to the new account. If you want to use the original account      
    number, you must bring the account balance to zero, change the account 
    assignment, and repost the items. You can remove the old items by      
    archiving the documents"
    Can anybody tell me what to do as we have hundreds of movements on accounts that are “uncleared?
    Is there any other program?
    Thanks,
    JR

    Hello Ravana,
    check OSS note 175960 if you still want to use the program RFSEPA02.
    Best regards
    Jean-Marc

  • Trouble creating a open items report (BSID and BSAD tables)

    Hi guys,
    im creating a report that must display open items for an especific date, and i do it very well with a query from BSID table.
    The problem comes when u use a date on the past, example last week.
    if u do that, the items are now closed and are no longer stored in BSID table, so i think that they must be now in BSAD table, but i dont know how to relate wich ones are recently closed...
    i also tried to do a query from BSAD with augdt >= last week date, and i almost get the items that i needed(this items plus the ones from BSID), but is not exactly because u can close an item with a date in the past..
    is there any way to relate that 2 tables, or what exactly happens when an items change from bsid to bsad??
    any ideas?

    Hi;
    I think the best way to recive the necessary information is using logical data base DDF.  You can use report RFITEMAR to see how use the logical data base.
    Some months ago I've read the data in my report in following way:
    1. make Z-copy of report RFITEMAR
    2. in Z-copy after end-of-selection insert
    export it_pos to memory id 'POS_TABLE'.
    3. In your report write a form similar to my form below:
    *&      Form  submit_zrfitemar
    FORM submit_zrfitemar  tables    rkunnr  type trgr_kunnr
                                     it_pos  type it_rfposxext
                           using     ibukrs  type bukrs
                                     idatsd  type sy-datum.
       data: rspar    type table of rsparams,
             l_rspar  type rsparams,
             l_pos    type rfposxext,
             akunnr  type kunnr.
       l_rspar-selname = 'DD_KUNNR'.
       l_rspar-kind    = 'S'.
       loop at rkunnr.
           move-corresponding rkunnr to l_rspar.
           if l_rspar-high = ''.
               l_rspar-option  = 'EQ'.
               else.
               l_rspar-option  = 'BT'.
           endif.
           append l_rspar to rspar.
        endloop.
        clear: l_rspar.
        l_rspar-selname = 'DD_BUKRS'.
        l_rspar-kind    = 'S'.
        l_rspar-sign    = 'I'.
        l_rspar-option  = 'BT'.
        l_rspar-low  = ibukrs.
        append l_rspar to rspar.
        clear: l_rspar.
        l_rspar-selname = 'PA_STIDA'.
        l_rspar-kind    = 'S'.
        l_rspar-sign    = 'I'.
        l_rspar-option  = 'BT'.
        l_rspar-low  = idatsd.
        append l_rspar to rspar.
        clear: it_pos[].
      submit ZRFITEMAR
      with selection-table rspar
      and return.
      import it_pos from memory id 'POS_TABLE'.
    ENDFORM.                    " submit_zrfitemar
    You find the necessary data in table IT_POS.
    JS
    Edited by: John Smith on Oct 9, 2008 5:42 PM

  • Function module for customer open item aging report

    Hi all,
    Please let me know the FM for customer open item aging or which FM is used in tcode S_ALR_87012178 to get the age wise open item of customer.
    Thanks in advance
    Regards
    Puneet

    <b><u>Part4</u></b><br />
    <br />
    <pre class="jive-pre"><code class="jive-code jive-java"><font color="red">&quot;&#38;----</font>
    <font color="red">&quot;*&#38;      Form  process_data</font>
    <font color="red">&quot;&#38;----</font>
    FORM PROCESS_DATA .
      DATA : L_TOTAL_TMP(15). <font color="red">&quot; LIKE BSID-DMBTR. </font>
      CLEAR :  L_TOTAL,LPD_TOTALS.
    <font color="red">&quot;* As per Customer accumulate the amount.</font>
    <font color="red">&quot;* For overdue items.</font>
      CLEAR : L_TOTAL_TMP.
      LOOP AT L_OPENDUE_LT.
      CONDENSE L_OPENDUE_LT-DMBTR NO-GAPS.
      L_TOTAL_TMP = L_TOTAL_TMP + L_OPENDUE_LT-DMBTR.
        AT END OF KUNNR.
          LPD_TOTALS-KUNNR = L_OPENDUE_LT-KUNNR.
          LPD_TOTALS-LPD_TOTAL = L_TOTAL_TMP.
          APPEND LPD_TOTALS.
          CLEAR : L_TOTAL_TMP.
        ENDAT.
      ENDLOOP.
      CLEAR :  L_TOTAL,LOA_TOTALS.
    <font color="red">&quot;* As per Customer accumulate the amount.</font>
    <font color="red">&quot;* For Open Items.</font>
      CLEAR : L_TOTAL_TMP.
      LOOP AT L_OPENDUE_LE.
        CONDENSE L_OPENDUE_LE-DMBTR NO-GAPS.
        L_TOTAL_TMP = L_TOTAL_TMP + L_OPENDUE_LE-DMBTR.
        AT END OF KUNNR.
          LOA_TOTALS-KUNNR = L_OPENDUE_LE-KUNNR.
          LOA_TOTALS-LOA_TOTAL = L_TOTAL_TMP.
          APPEND LOA_TOTALS.
          CLEAR : L_TOTAL_TMP.
        ENDAT.
      ENDLOOP.
    <font color="red">&quot;* Get ageing data based slabs, and duedate.</font>
      PERFORM AGEING_DATA.
      LOOP AT L_BSID.
    <font color="red">&quot;* Move the data to final internal table.</font>
        MOVE L_BSID-KUNNR TO FINAL_DATA-KUNNR.
        MOVE L_LANDX TO FINAL_DATA-LANDX.
        MOVE L_PSTLZ TO FINAL_DATA-PSTLZ.
        MOVE L_NAME TO FINAL_DATA-NAME1.
        MOVE L_PHONE TO FINAL_DATA-PHONE.
        MOVE L_SORTL TO FINAL_DATA-SORTL.
        MOVE L_BSID-ZTERM TO FINAL_DATA-ZTERM.  
        MOVE L_BUSAB TO FINAL_DATA-BUSAB.        
        READ TABLE LPD_TOTALS WITH KEY KUNNR = L_BSID-KUNNR.
        IF SY-SUBRC EQ 0.
          MOVE LPD_TOTALS-LPD_TOTAL TO FINAL_DATA-LPD_TOTAL.
        ENDIF.
        READ TABLE LOA_TOTALS WITH KEY KUNNR = L_BSID-KUNNR.
        IF SY-SUBRC EQ 0.
          MOVE LOA_TOTALS-LOA_TOTAL TO FINAL_DATA-LOA_TOTAL.
        ENDIF.
        READ TABLE AGE_DATA WITH KEY KUNNR = L_BSID-KUNNR.
        IF SY-SUBRC EQ 0.
          MOVE AGE_DATA-CURAMT TO FINAL_DATA-CURAMT.
          MOVE AGE_DATA-AMT1 TO FINAL_DATA-AMT1.
          MOVE AGE_DATA-AMT2 TO FINAL_DATA-AMT2.
          MOVE AGE_DATA-AMT3 TO FINAL_DATA-AMT3.
          MOVE AGE_DATA-AMT4 TO FINAL_DATA-AMT4.
          MOVE AGE_DATA-AMT5 TO FINAL_DATA-AMT5.
          MOVE AGE_DATA-AMT6 TO FINAL_DATA-AMT6.
        ENDIF.
        ENDIF.
        APPEND FINAL_DATA.
        CLEAR: FINAL_DATA.
      ENDLOOP.
    ENDFORM.                    <font color="red">&quot; process_data</font>
    </code></pre>

  • Credit Management (Open Items and Oldest Open Items)

    I have 2 questions.
    1)What is the difference between Open Items check and Oldest open items
    2) I want to activate a Credit management check which should work in way that the Order will be blocked on the basis of Payment term check
    Let say if I am using the Payment terms 0001 i.e Payment immediately due net .now what I want is that if I post the first invoice system as configured will check only the Credit check againt the credit Limit but when i post the 2nd invoice on the same day and the first invoice is not cleared system should give a warning message for it .
    Currenlty as i Configured it working but not for the same day option its give a warning on the 2nd day's invoice
    SO Need the help of Experts.
    Thanks in advance

    Hi,
    Open items check means it will consider all the open items when it is doing credit check. Here it adds all the open items amount and do the credit check..
    Oldest open item means it will consider only the oldest open item and based on tht i will do credit check..Here i will check the oldest open item value and its date then do the credit check..
    Coming to payment terms check, system is responding correctly.. because payment terms are immed due net. tht means still time is there in the same day. that is the reason it is not blocking the second document.
    once move to 2nd day then it means first doc is not cleared tht is the reason it is blocking the 2 nd doc on 2nd doc..
    Hope u have understand..
    Regards
    Sankar

  • Fetching AR open items and customer's credit limit to Collateral Management

    Hi
    Is there a badi that you can use to fetch receivables data (open invoices/items and credit limit) from FI-AR to Collateral Management System?
    Answer: The badi Get Receivables has to be used
    BAPI1010_6 u201ECreditAccountDetail
    Other bapi of interest, :
    BAPI_AR_ACC_GETOPENITEMS
    BAPI_AR_ACC_GETCURRENTBALANCE
    Edited by: EI18 on Sep 9, 2011 10:21 PM

    Hi,
    Open items check means it will consider all the open items when it is doing credit check. Here it adds all the open items amount and do the credit check..
    Oldest open item means it will consider only the oldest open item and based on tht i will do credit check..Here i will check the oldest open item value and its date then do the credit check..
    Coming to payment terms check, system is responding correctly.. because payment terms are immed due net. tht means still time is there in the same day. that is the reason it is not blocking the second document.
    once move to 2nd day then it means first doc is not cleared tht is the reason it is blocking the 2 nd doc on 2nd doc..
    Hope u have understand..
    Regards
    Sankar

  • Customer Open Items in FI

    Hi All,
       I have to make a report in FI, which should show the below given Customer open Invoice details for a given customer in selection screen.
    Invoice No | Invoice date |  Invoice Amount  |   Payment    |    Balance | Currency |
    1.  I have selected all open item details (BELNR, BUDAT, WRBTR, WAERS ) from BSID for the given customer.
    2. Selected the cleared items from BSAD for the above accounting documents..and updated the BSAD-WRBTR in payment column.
      When there is no payment made against a Invoice its coming up, but when there is partial/ full payment made as this is no more open item this invoice number not coming up in the report.. Hope I have explianed my problem clearly..
       Please suggest me how should I finish this report. Thanks in advances..its very urgent..
    Regards
    Jaker.

    Hi,
    See the attached report for the Customer AR's (Open Items) and write accrodingly.
    report zf_rept_debtor_ageing
           no standard page heading
           message-id fb
           line-count 65
           line-size 230.
    Purpose : This ABAP program will fetch the Account Receivables for
               a Customer for the given period and display the due days.
    tables: t001,       " Company Codes
            t005,       " Countries
            skb1,       " GL Master
            kna1.       " Customer Master
    Internal Tables
    Internal table for BSID (Open Items) data
    data: begin of it_bsid occurs 0,
            kunnr like bsid-kunnr,         " Customer Number
            gjahr like bsid-gjahr,         " Fiscal Year
            belnr like bsid-belnr,         " Acc.Document
            buzei like bsid-buzei,         " Item
            budat like bsid-budat,         " Posting Date
            shkzg like bsid-shkzg,         " Dr/Cr Indicator
            dmbtr like bsid-dmbtr,         " Amount(Local Curr)
            wrbtr like bsid-wrbtr,         " Amount(Doc Curr)
            dmbe2 like bsid-dmbe2,         " Amount(USD)
            waers like bsid-waers,         " Currency
            zterm like bsid-zterm,         " Payment Terms
            vbeln like bsid-vbeln,         " Billing Doc
            zfbdt like bsid-zfbdt,         " Baseline Date
            zbd1t like bsid-zbd1t,         " No of days
            hkont like bsid-hkont,         " GL Account
            name1 like kna1-name1,         " Customer Name
            land1 like kna1-land1,         " Country
          end of it_bsid.
    Internal table for BSAD (Closed Items) data
    data: begin of it_bsad occurs 0,
            kunnr like bsad-kunnr,         " Customer Number
            gjahr like bsad-gjahr,         " Fiscal Year
            belnr like bsad-belnr,         " Acc.Document
            buzei like bsad-buzei,         " Item
            budat like bsad-budat,         " Posting Date
            shkzg like bsad-shkzg,         " Dr/Cr Indicator
            dmbtr like bsad-dmbtr,         " Amount(Local Curr)
            wrbtr like bsid-wrbtr,         " Amount(Doc Curr)
            dmbe2 like bsad-dmbe2,         " Amount(USD)
            waers like bsad-waers,         " Currency
            zterm like bsid-zterm,         " Payment Terms
            vbeln like bsid-vbeln,         " Billing Doc
            zfbdt like bsid-zfbdt,         " Baseline Date
            zbd1t like bsid-zbd1t,         " No of days
            hkont like bsid-hkont,         " GL Account
            name1 like kna1-name1,         " Customer Name
            land1 like kna1-land1,         " Country
          end of it_bsad.
    Internal table for Report Output
    data: begin of it_report occurs 0,
            kunnr like bsid-kunnr,         " Customer Number
            belnr like bsid-belnr,         " Acc.Document
            name1 like kna1-name1,         " Customer Name
            land1 like kna1-land1,         " Country
            shkzg like bsid-shkzg,         " Dr/Cr Indicator
            budat like bsid-budat,         " Posting Date
            dmbtr like bsid-dmbtr,         " Amount(Local Curr)
            wrbtr like bsid-wrbtr,         " Amount(Doc Curr)
            dmbe2 like bsid-dmbe2,         " Amount(USD)
            waers like bsid-waers,         " Currency
            due_amnt like bsid-dmbtr,      " Amount(Over Due)
            d_amnt1  like bsid-dmbtr,      " Amount(0-30 Future Due)
            d_amnt2  like bsid-dmbtr,      " Amount(31-60 Future Due)
            d_amnt3  like bsid-dmbtr,      " Amount(61-90 Future Due)
            d_amnt4  like bsid-dmbtr,      " Amount(91-120 Future Due)
            d_amnt5  like bsid-dmbtr,      " Amount(more than 120)
            due_date like bsid-budat,      " Due date
            zterm    like bsid-zterm,      " Payment Terms
            vbeln    like bsid-vbeln,      " Billing Doc
          end of it_report.
           Declaration of Data and Variables
    data: v_days  type i,            " Difference days
          v_waers like t001-waers,   " Co.Code Currency
          v_sum1  like bsid-dmbtr,                              " Totals 1
          v_sum2  like bsid-dmbtr,                              " Totals 2
          v_sum3  like bsid-dmbtr,                              " Totals 3
          v_sum4  like bsid-dmbtr,                              " Totals 4
          v_sum5  like bsid-dmbtr,                              " Totals 5
          v_sum6  like bsid-dmbtr,                              " Totals 6
          v_sum7  like bsid-dmbtr,                              " Totals 7
          v_sum8  like bsid-dmbe2.                              " Totals 8
    Constants
    constants: c_doc_waers(3) value 'USD',
               c_mitkz type c value 'D'.
                       Selection Screen
    selection-screen : begin of block b1 with frame title text-001.
    parameters: p_bukrs like t001-bukrs obligatory.      " Company Code
    select-options:s_kunnr for kna1-kunnr,               " Customer Number
                   s_land1 for t005-land1,               " Country
                   s_hkont for skb1-saknr.               " G/L Account
    parameters: p_date  like sy-datum obligatory.        " Report Date
    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 2(30) text-003 for field p_rb1.
    parameters: p_rb1 radiobutton group rb.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 2(30) text-004 for field p_rb2.
    parameters: p_rb2 radiobutton group rb.
    selection-screen end of line.
    selection-screen: end of block b2.
    selection-screen : begin of block b4 with frame.
    selection-screen begin of line.
    selection-screen comment 2(29) text-038 for field p_chk1.
    parameters: p_chk1 as checkbox.
    selection-screen end of line.
    selection-screen: end of block b4.
    selection-screen : begin of block b3 with frame title text-030.
    selection-screen begin of line.
    selection-screen comment 2(30) text-031 for field p_rb3.
    parameters: p_rb3 radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 2(30) text-032 for field p_rb4.
    parameters: p_rb4 radiobutton group rb1.
    selection-screen end of line.
    selection-screen: end of block b3.
    *********Initialization**********************************************
    initialization.
    At Selection Screen
    at selection-screen.
    Checking for the input values of selection screen.
      perform screen_check.
    Top-Of-Page
    top-of-page.
      if p_rb3 = 'X'.
        if p_chk1 = 'X'.
    Write the Column Headings for detailed report(in Doc Currency)
          perform col_heading2.
        else.
    Write the Column Headings for detailed report
          perform col_heading.
        endif.
      else.
    Write the Column Headings for summary report
        perform col_heading1.
      endif.
    Start-Of-Selection
    start-of-selection.
    Get the Customer Open Items from BSID
      perform get_open_data.
    Get the Customer Closed Items from BSAD
      perform get_close_data.
    Get the data from BSID,BSAD and KNA1 into one int.table
      perform process_data.
    End-Of-Selection
    end-of-selection.
      if it_report[] is initial.
        write : 'No Documents found'(005).
      else.
        if p_rb3 = 'X'.
    Write the Detailed Report
          perform write_report.
        else.
    Write the Summary Report
          perform write_report1.
        endif.
      endif.
    At Line-Selection
    at line-selection.
    When double clicked on BELNR leave to transaction FB03
      perform line_sel.
    *&      Form  SCREEN_CHECK
    Checking for the input values of selection screen
    form screen_check.
    Validation of Company Code
      clear t001.
      if not p_bukrs is initial.
        select bukrs from t001 up to 1 rows
               into t001-bukrs
               where bukrs = p_bukrs.
        endselect.
        if sy-subrc ne 0.
          message e000 with 'Invalid Company Code'(006).
        endif.
      endif.
    Validation of Customer Number
      clear kna1.
      if not s_kunnr is initial.
        select kunnr from kna1 up to 1 rows
               into kna1-kunnr
               where kunnr in s_kunnr.
        endselect.
        if sy-subrc ne 0.
          message e000 with 'Invalid Customer Number'(007).
        endif.
      endif.
    Validation of Country
      clear t005.
      if not s_land1 is initial.
        select land1 from t005 up to 1 rows
               into t005-land1
               where land1 in s_land1.
        endselect.
        if sy-subrc ne 0.
          message e000 with 'Invalid Country'(036).
        endif.
      endif.
    Validation of GL Account
      clear skb1.
      if not s_hkont is initial.
        select saknr from skb1 up to 1 rows
               into skb1-saknr
               where saknr in s_hkont and
                     mitkz = c_mitkz.
        endselect.
        if sy-subrc ne 0.
          message e000 with 'Invalid GL Reconciliation Account'(037).
        endif.
      endif.
    endform.                    " SCREEN_CHECK
    *&      Form  COL_HEADING
    Write the Column Headings for detailed report
    form col_heading.
      skip .
      write: /88 'DEBTOR AGEING REPORT AS AT:'(019) centered,
             116  p_date  centered, 198 sy-pagno.
      skip .
      write: /2 'CoCode:'(016),13(4) p_bukrs color 3.
      if not s_kunnr is initial.
        if not s_kunnr-high is initial.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3,
                    '-', s_kunnr-high color 3.
        else.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3.
        endif.
      endif.
      if not s_land1 is initial.
        if not s_land1-high is initial.
          write: /2 'Country:'(042),13(4) s_land1-low color 3,
                  '-', s_land1-high color 3.
        else.
          write: /2 'Country:'(042),13(4) s_land1-low color 3.
        endif.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3.
          endif.
        endif.
      else.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3.
          endif.
        endif.
      endif.
      write: 183 'Run Date:'(029), sy-datum.
      format color col_heading.
      write at /1(203) sy-uline .
      write: / sy-vline,  2(10) 'Customer'(008) centered,
            12 sy-vline, 13(30) 'Customer Name'(009),
            43 sy-vline, 44(3)  'Cty'(014) centered,
            47 sy-vline, 48(15) 'Amount'(013) right-justified,
            63 sy-vline, 64(4)  'Curr'(011) centered,
            68 sy-vline, 69(15) 'Overdue'(012) centered,
            84 sy-vline, 85(15) '0 - 30 Days'(010) centered,
           100 sy-vline,101(15) '31 - 60 Days'(028) centered,
           116 sy-vline,117(15) '61 - 90 Days'(021) centered,
           132 sy-vline,133(15) '91 - 120 Days'(022) centered,
           148 sy-vline,149(15) 'Above 120 Days'(023) centered,
           164 sy-vline,165(10) 'Due Date'(024) centered,
           175 sy-vline,176(5)  'PayT'(025) centered,
           181 sy-vline,182(10) 'Bill.Doc.'(026) centered,
           192 sy-vline,193(10) 'Doc.No.'(027) centered,
           203 sy-vline.
      write at /1(203) sy-uline.
      format color off.
    endform.                    " COL_HEADING
    *&      Form  COL_HEADING1
    Write the Column Headings for summary report
    form col_heading1.
      skip .
      write: /54 'DEBTOR AGEING REPORT (SUMMARY) AS AT:'(033) centered,
              92  p_date  centered, 158 sy-pagno.
      skip .
      write: /2 'CoCode:'(016), 13(4) p_bukrs color 3.
      if not s_kunnr is initial.
        if not s_kunnr-high is initial.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3,
                    '-', s_kunnr-high color 3.
        else.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3.
        endif.
      endif.
      if not s_land1 is initial.
        if not s_land1-high is initial.
          write: /2 'Country:'(042),13(4) s_land1-low color 3,
                  '-', s_land1-high color 3.
        else.
          write: /2 'Country:'(042),13(4) s_land1-low color 3.
        endif.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3.
          endif.
        endif.
      else.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3.
          endif.
        endif.
      endif.
      write: 144 'Run Date:'(029), sy-datum.
      format color col_heading.
      write at /1(164) sy-uline .
      write: / sy-vline,  2(10) 'Customer'(008) centered,
            12 sy-vline, 13(30) 'Customer Name'(009),
            43 sy-vline, 44(3)  'Cty'(014) centered,
            47 sy-vline, 48(15) 'Amount'(013) right-justified,
            63 sy-vline, 64(4)  'Curr'(011) centered,
            68 sy-vline, 69(15) 'Overdue'(012) centered,
            84 sy-vline, 85(15) '0 - 30 Days'(010) centered,
           100 sy-vline,101(15) '31 - 60 Days'(028) centered,
           116 sy-vline,117(15) '61 - 90 Days'(021) centered,
           132 sy-vline,133(15) '91 - 120 Days'(022) centered,
           148 sy-vline,149(15) 'Above 120 Days'(023) centered,
           164 sy-vline.
      write at /1(164) sy-uline.
      format color off.
    endform.                    " COL_HEADING1
    *&      Form  COL_HEADING2
    Write the Column Headings for summary report(in Doc Curr)
    form col_heading2.
      skip .
      write: /99 'DEBTOR AGEING REPORT AS AT:'(019) centered,
             127  p_date  centered, 220 sy-pagno.
      skip .
      write: /2 'CoCode:'(016),13(4) p_bukrs color 3.
      if not s_kunnr is initial.
        if not s_kunnr-high is initial.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3,
                    '-', s_kunnr-high color 3.
        else.
          write: 20 'Customer:'(041),33 s_kunnr-low color 3.
        endif.
      endif.
      if not s_land1 is initial.
        if not s_land1-high is initial.
          write: /2 'Country:'(042),13(4) s_land1-low color 3,
                  '-', s_land1-high color 3.
        else.
          write: /2 'Country:'(042),13(4) s_land1-low color 3.
        endif.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: 20 'GL Account:'(043),33 s_hkont-low color 3.
          endif.
        endif.
      else.
        if not s_hkont is initial.
          if not s_hkont-high is initial.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3,
                      '-', s_hkont-high color 3.
          else.
            write: /2 'GL Account:'(043),14 s_hkont-low color 3.
          endif.
        endif.
      endif.
      write: 204 'Run Date:'(029), sy-datum.
      format color col_heading.
      write at /1(225) sy-uline .
      write: / sy-vline,  2(10) 'Customer'(008) centered,
            12 sy-vline, 13(30) 'Customer Name'(009),
            43 sy-vline, 44(3)  'Cty'(014) centered,
            47 sy-vline, 48(15) 'Amount'(013) right-justified,
            63 sy-vline, 64(4)  'Curr'(011) centered,
            68 sy-vline, 69(15) 'Overdue'(012) centered,
            84 sy-vline, 85(15) '0 - 30 Days'(010) centered,
           100 sy-vline,101(15) '31 - 60 Days'(028) centered,
           116 sy-vline,117(15) '61 - 90 Days'(021) centered,
           132 sy-vline,133(15) '91 - 120 Days'(022) centered,
           148 sy-vline,149(15) 'Above 120 Days'(023) centered,
           164 sy-vline,165(10) 'Due Date'(024) centered,
           175 sy-vline,176(5)  'PayT'(025) centered,
           181 sy-vline,182(10) 'Bill.Doc.'(026) centered,
           192 sy-vline,193(10) 'Doc.No.'(027) centered,
           203 sy-vline,204(16) 'Amount(Doc.Curr)'(039),
           220 sy-vline,221(4)  'Curr'(040),
           225 sy-vline.
      write at /1(225) sy-uline.
      format color off.
    endform.                    " COL_HEADING2
    *&      Form  GET_OPEN_DATA
    Get the Customer Open Items from BSID
    form get_open_data.
      select a~kunnr          " Customer Number
             a~gjahr          " Fiscal Year
             a~belnr          " Acc.Document
             a~buzei          " Item
             a~budat          " Posting Date
             a~shkzg          " Dr/Cr Indicator
             a~dmbtr          " Amount(Local Curr)
             a~wrbtr          " Amount(Doc Curr)
             a~dmbe2          " Amount(USD)
             a~waers          " Currency
             a~zterm          " Payment Terms
             a~vbeln          " Billing Doc
             a~zfbdt          " Baseline Date
             a~zbd1t          " No of days
             a~hkont          " GL account
             b~name1          " Customer Name
             b~land1          " Country
         into table it_bsid
         from bsid as a join kna1 as b
         on akunnr = bkunnr
         where a~bukrs = p_bukrs  and
               a~kunnr in s_kunnr and
               a~hkont in s_hkont and
               b~land1 in s_land1 and
               a~budat le p_date.
      sort it_bsid by kunnr gjahr belnr buzei budat.
    endform.                    " GET_OPEN_DATA
    *&      Form  GET_CLOSE_DATA
    Get the Customer closed Items from BSID
    form get_close_data.
      select a~kunnr          " Customer Number
             a~gjahr          " Fiscal Year
             a~belnr          " Acc.Document
             a~buzei          " Item
             a~budat          " Posting Date
             a~shkzg          " Dr/Cr Indicator
             a~dmbtr          " Amount(Local Curr)
             a~wrbtr          " Amount(Doc Curr)
             a~dmbe2          " Amount(USD)
             a~waers          " Currency
             a~zterm          " Payment Terms
             a~vbeln          " Billing Doc
             a~zfbdt          " Baseline Date
             a~zbd1t          " No of days
             a~hkont          " GL account
             b~name1          " Customer Name
             b~land1          " Country
        into table it_bsad
        from bsad as a join kna1 as b
        on akunnr = bkunnr
        where a~bukrs = p_bukrs  and
              a~kunnr in s_kunnr and
              a~hkont in s_hkont and
              b~land1 in s_land1 and
              a~augdt > p_date   and
              a~budat le p_date.
      sort it_bsad by kunnr gjahr belnr buzei budat.
    endform.                    " GET_CLOSE_DATA
    *&      Form  PROCESS_DATA
    Get the data from BSID,BSAD and KNA1 into one int.table
    form process_data.
    *Move the data from BSID to final output int table
      loop at it_bsid.
        move-corresponding it_bsid to it_report.
        it_report-due_date = it_bsid-zfbdt + it_bsid-zbd1t.
        append it_report.
        clear it_report.
      endloop.
    *Move the data from BSAD to final output int table
      loop at it_bsad.
        move-corresponding it_bsad to it_report.
        it_report-due_date = it_bsad-zfbdt + it_bsad-zbd1t.
        append it_report.
        clear it_report.
      endloop.
      sort it_report by kunnr belnr.
      loop at it_report.
        if it_report-shkzg = 'H'.    " Credit
          it_report-dmbtr = it_report-dmbtr * -1.
          it_report-dmbe2 = it_report-dmbe2 * -1.
        endif.
        v_days = it_report-due_date - p_date.
    For Company Code Currency
        if p_rb1 = 'X'.
          if v_days le 0.
            it_report-due_amnt = it_report-dmbtr.
          elseif v_days between 1 and 30.
            it_report-d_amnt1 = it_report-dmbtr.
          elseif v_days between 31 and 60.
            it_report-d_amnt2 = it_report-dmbtr.
          elseif v_days between 61 and 90.
            it_report-d_amnt3 = it_report-dmbtr.
          elseif v_days between 91 and 120.
            it_report-d_amnt4 = it_report-dmbtr.
          elseif v_days > 120.
            it_report-d_amnt5 = it_report-dmbtr.
          endif.
    For Group Currency
        else.
          if v_days le 0.
            it_report-due_amnt = it_report-dmbe2.
          elseif v_days between 1 and 30.
            it_report-d_amnt1 = it_report-dmbe2.
          elseif v_days between 31 and 60.
            it_report-d_amnt2 = it_report-dmbe2.
          elseif v_days between 61 and 90.
            it_report-d_amnt3 = it_report-dmbe2.
          elseif v_days between 91 and 120.
            it_report-d_amnt4 = it_report-dmbe2.
          elseif v_days > 120.
            it_report-d_amnt5 = it_report-dmbe2.
          endif.
        endif.
        modify it_report index sy-tabix.
      endloop.
    endform.                    " PROCESS_DATA
    *&      Form  WRITE_REPORT
    Write the Detailed Report Output
    form write_report.
      clear: v_sum1,v_sum2,v_sum3,v_sum4,v_waers,
             v_sum5,v_sum6,v_sum7,v_sum8.
      loop at it_report.
       at new kunnr.
          read table it_report index sy-tabix.
          write: / sy-vline,  2(10) it_report-kunnr,
                12 sy-vline, 13(30) it_report-name1,
                43 sy-vline, 44(3)  it_report-land1,
                47 sy-vline.
       endat.
        if p_rb1 = 'X'.
          select single waers from t001
               into v_waers where bukrs = p_bukrs.
          write:   1 sy-vline, 12 sy-vline,
                  43 sy-vline,
                  47 sy-vline,
                  48(15) it_report-dmbtr currency it_report-waers,
                  63 sy-vline, 64(4) v_waers,
                  68 sy-vline.
        else.
          write:   1 sy-vline, 12 sy-vline,
                  43 sy-vline,
                  47 sy-vline,
                  48(15) it_report-dmbe2 currency it_report-waers,
                  63 sy-vline,64(4) c_doc_waers,
                  68 sy-vline.
        endif.
        write:  69(15) it_report-due_amnt currency it_report-waers,
                84 sy-vline,
                85(15) it_report-d_amnt1 currency it_report-waers,
               100 sy-vline,
               101(15) it_report-d_amnt2 currency it_report-waers,
               116 sy-vline,
               117(15) it_report-d_amnt3 currency it_report-waers,
               132 sy-vline,
               133(15) it_report-d_amnt4 currency it_report-waers,
               148 sy-vline,
               149(15) it_report-d_amnt5 currency it_report-waers,
               164 sy-vline,165(10) it_report-due_date,
               175 sy-vline,176(5)  it_report-zterm,
               181 sy-vline,182(10) it_report-vbeln,
               192 sy-vline,193(10) it_report-belnr,
               203 sy-vline.
        if p_chk1 = 'X'.
          write: 204(16) it_report-wrbtr currency it_report-waers,
               220 sy-vline, 221(4) it_report-waers,
               225 sy-vline.
        endif.
       new-line.
    Totals for end of each Customer
        at end of kunnr.
          if p_chk1 = 'X'.
            write at /1(225) sy-uline.
          else.
            write at /1(203) sy-uline.
          endif.
          sum.
          format color 4.
          if p_rb1 = 'X'.
            write: /1 sy-vline, 2 'Total:'(015),
                 12 sy-vline,
                 13(10) it_report-kunnr,
                 43 sy-vline,47 sy-vline,
                 48(15) it_report-dmbtr currency it_report-waers,
                 63 sy-vline, 64(3) v_waers,
                 68 sy-vline,
                 69(15) it_report-due_amnt currency it_report-waers,
                 84 sy-vline,
                 85(15) it_report-d_amnt1 currency it_report-waers,
                100 sy-vline,
                101(15) it_report-d_amnt2 currency it_report-waers,
                116 sy-vline,
                117(15) it_report-d_amnt3 currency it_report-waers,
                132 sy-vline,
                133(15) it_report-d_amnt4 currency it_report-waers,
                148 sy-vline,
                149(15) it_report-d_amnt5 currency it_report-waers,
                164 sy-vline, 175 sy-vline,
                181 sy-vline, 192 sy-vline,
                203 sy-vline.
            if p_chk1 = 'X'.
              write: 220 sy-vline, 225 sy-vline.
            endif.
          else.
            write: /1 sy-vline, 2 'Total:'(015),
                   12 sy-vline,
                 13(10) it_report-kunnr,
                 43 sy-vline,
                 47 sy-vline,
                 48(15) it_report-dmbe2 currency it_report-waers,
                 63 sy-vline, 64(3) c_doc_waers,
                 68 sy-vline,
                 69(15) it_report-due_amnt currency it_report-waers,
                 84 sy-vline,
                 85(15) it_report-d_amnt1 currency it_report-waers,
                100 sy-vline,
                101(15) it_report-d_amnt2 currency it_report-waers,
                116 sy-vline,
                117(15) it_report-d_amnt3 currency it_report-waers,
                132 sy-vline,
                133(15) it_report-d_amnt4 currency it_report-waers,
                148 sy-vline,
                149(15) it_report-d_amnt5 currency it_report-waers,
                164 sy-vline, 175 sy-vline,
                181 sy-vline, 192 sy-vline,
                203 sy-vline.
            if p_chk1 = 'X'.
              write: 220 sy-vline, 225 sy-vline.
            endif.
          endif.
          format color off.
          if p_chk1 = 'X'.
            write at /1(225) sy-uline.
          else.
            write at /1(203) sy-uline.
          endif.
        endat.
        v_sum1 = v_sum1 + it_report-dmbtr.
        v_sum2 = v_sum2 + it_report-due_amnt.
        v_sum3 = v_sum3 + it_report-d_amnt1.
        v_sum4 = v_sum4 + it_report-d_amnt2.
        v_sum5 = v_sum5 + it_report-d_amnt3.
        v_sum6 = v_sum6 + it_report-d_amnt4.
        v_sum7 = v_sum7 + it_report-d_amnt5.
        v_sum8 = v_sum8 + it_report-dmbe2.
    Hiding the Acc doc no for interactic screen.
        hide it_report-belnr.
        hide it_report-budat.
        clear:it_report-belnr, it_report-budat.
      endloop.
    Grand Totals for all customers
      format color 3.
      write: /1 sy-vline, 2 'Gr.Total'(034),
                 12 sy-vline,13 'As At:'(035),p_date,
                 43 sy-vline,
                 47 sy-vline.
    For Company Code Currency
      if p_rb1 = 'X'.
        write:  48(15) v_sum1 currency it_report-waers,
                63 sy-vline, 64(4) v_waers,
                68 sy-vline.
    For Group Currency (USD)
      else.
        write:   48(15) v_sum8 currency it_report-waers,
                 63 sy-vline, 64(3) c_doc_waers,
                 68 sy-vline.
      endif.
      write:     69(15) v_sum2 currency it_report-waers,
                 84 sy-vline,
                 85(15) v_sum3 currency it_report-waers,
                100 sy-vline,
                101(15) v_sum4 currency it_report-waers,
                116 sy-vline,
                117(15) v_sum5 currency it_report-waers,
                132 sy-vline,
                133(15) v_sum6 currency it_report-waers,
                148 sy-vline,
                149(15) v_sum7 currency it_report-waers,
                164 sy-vline, 175 sy-vline,
                181 sy-vline, 192 sy-vline,
                203 sy-vline.
      if p_chk1 = 'X'.
        write: 220 sy-vline, 225 sy-vline.
      endif.
      format color off.
      if p_chk1 = 'X'.
        write at /1(225) sy-uline.
      else.
        write at /1(203) sy-uline.
      endif.
    endform.                    " WRITE_REPORT
    *&      Form  WRITE_REPORT1
    Write the Summary Report Output
    form write_report1.
      clear: v_sum1,v_sum2,v_sum3,v_sum4,v_waers,
             v_sum5,v_sum6,v_sum7,v_sum8.
      loop at it_report.
        at new kunnr.
          read table it_report index sy-tabix.
          write: / sy-vline,  2(10) it_report-kunnr,
                12 sy-vline, 13(30) it_report-name1,
                43 sy-vline, 44(3)  it_report-land1,
                47 sy-vline.
        endat.
        at end of kunnr.
          sum.
          if p_rb1 = 'X'.
            select single waers from t001
              into v_waers where bukrs = p_bukrs.
            write: 1 sy-vline, 12 sy-vline,
                 43 sy-vline,  47 sy-vline,
                 48(15) it_report-dmbtr currency it_report-waers,
                 63 sy-vline, 64(4) v_waers,
                 68 sy-vline,
                 69(15) it_report-due_amnt currency it_report-waers,
                 84 sy-vline,
                 85(15) it_report-d_amnt1 currency it_report-waers,
                100 sy-vline,
                101(15) it_report-d_amnt2 currency it_report-waers,
                116 sy-vline,
                117(15) it_report-d_amnt3 currency it_report-waers,
                132 sy-vline,
                133(15) it_report-d_amnt4 currency it_report-waers,
                148 sy-vline,
                149(15) it_report-d_amnt5 currency it_report-waers,
                164 sy-vline.
          else.
            write: 1 sy-vline, 12 sy-vline,
                 43 sy-vline,  47 sy-vline,
                 48(15) it_report-dmbe2 currency it_report-waers,
                 63 sy-vline, 64(4) c_doc_waers,
                 68 sy-vline,
                 69(15) it_report-due_amnt currency it_report-waers,
                 84 sy-vline,
                 85(15) it_report-d_amnt1 currency it_report-waers,
                100 sy-vline,
                101(15) it_report-d_amnt2 currency it_report-waers,
                116 sy-vline,
                117(15) it_report-d_amnt3 currency it_report-waers,
                132 sy-vline,
                133(15) it_report-d_amnt4 currency it_report-waers,
                148 sy-vline,
                149(15) it_report-d_amnt5 currency it_report-waers,
                164 sy-vline.
          endif.
          write at /1(164) sy-uline.
        endat.
    Totals
        v_sum1 = v_sum1 + it_report-dmbtr.
        v_sum2 = v_sum2 + it_report-due_amnt.
        v_sum3 = v_sum3 + it_report-d_amnt1.
        v_sum4 = v_sum4 + it_report-d_amnt2.
        v_sum5 = v_sum5 + it_report-d_amnt3.
        v_sum6 = v_sum6 + it_report-d_amnt4.
        v_sum7 = v_sum7 + it_report-d_amnt5.
        v_sum8 = v_sum8 + it_report-dmbe2.
    Hiding the Acc doc no for interactic screen.
        hide it_report-belnr.
        hide it_report-budat.
        clear: it_report-belnr,
               it_report-budat.
      endloop.
    Calculation of Grand Totals
      format color 3.
      write: /1 sy-vline, 2 'Gr.Total'(034),
                 12 sy-vline,13 'As At:'(035),p_date,
                 43 sy-vline,
                 47 sy-vline.
    For Company Code Currency
      if p_rb1 = 'X'.
        write:  48(15) v_sum1 currency it_report-waers,
                63 sy-vline, 64(4) v_waers,
                68 sy-vline.
    For Group Currency (USD)
      else.
        write:   48(15) v_sum8 currency it_report-waers,
                 63 sy-vline, 64(3) c_doc_waers,
                 68 sy-vline.
      endif.
      write:     69(15) v_sum2 currency it_report-waers,
                 84 sy-vline,
                 85(15) v_sum3 currency it_report-waers,
                100 sy-vline,
                101(15) v_sum4 currency it_report-waers,
                116 sy-vline,
                117(15) v_sum5 currency it_report-waers,
                132 sy-vline,
                133(15) v_sum6 currency it_report-waers,
                148 sy-vline,
                149(15) v_sum7 currency it_report-waers,
                164 sy-vline.
      format color off.
      write at /1(164) sy-uline.
    endform.                    " WRITE_REPORT1
    *&      Form  LINE_SEL
    When double clicked on BELNR leave to transaction FB03
    form line_sel.
      data: lv_field(20),
            lv_value(10),
            lv_date(10),
            lv_gjahr like bsad-gjahr.
      get cursor field lv_field value lv_value.
      if lv_field = 'IT_REPORT-BELNR'.
        if not lv_value is initial.
          read current line field value it_report-budat into lv_date.
          lv_gjahr = lv_date+6(4).
          set parameter id 'BUK' field p_bukrs.
          set parameter id 'GJR' field lv_gjahr.
          set parameter id 'BLN' field lv_value.
          call transaction 'FB03' and skip first screen.
        endif.
      endif.
    endform.                    " LINE_SEL
    Regards,
    Anji

  • How to close automatically sales order with open items ?

    Hi,
    There is a request from a client:
    he would like to be able to close the open items of a sales order which are not billed automatically according to a specific calendar. Moreover he would like to specify that ,generally speaking, the customer does not want to be delivered another time if there are leftovers in the sales order.
    I read in other posting that manually you can close open items in a sales order by adding a reason of rejection for the line item. Nevertheless, I do have one question about that. Imagine we only have one line of 100 pieces and we only deviver 90 pieces. When we put a reason of rejection in the sales order item of 100 quantity, what exactly will happen? How the system will know it only has to reject the 10 non delivered pieces and not the 100 pieces mentionned in the line item ? I also read that the price would change to zero but how can this be correct if we have 90 pieces to bill ?
    Thanks a lot for all your answers.
    Stéphanie

    Dear Stephanie,
    the reason for rejection change the status of the item itself to completed and it move the item from "active to be processed" to a simply statistical status.
    In the scenario you mentioned, as the reason for rejection is applied to the full item, you will set the full item as statistical, but your 90 pieces will continue being delivered and even eventually invoiced.
    Some discrepancies you may find only running some statistical reports, where also the net values information would not be in line as per your expectation.
    In order to prevent this discrepancy issue, I would advice you to contact a good abaper and develop a program that may massively rejects open items with not confirmed quantities, creating a new item for the open quantity if the sales line is partially confirmed.
    It means that, in your scenario:
    Order A > Item 1 for 100 pieces
                               > only 90 pieces delivered & invoiced
                               > 10 pieces open
    the result would be the following:
    Order A > Item 1 for 90 pieces
                               > 90 pieces delivered & invoiced
                  > Item 2 for 10 pieces rejected
    In this way you keep under control any report you may generate out of your sales and you can set as statistical items only quantities not processed further.
    I hope this explanation may help you.
    For any additional information on the reason for rejection I would remind you to SAP documentation and if you have the possibility to try to customize ans set your system with reason for rejection in order to discover directly with your eyes how these work.
    Regards,

Maybe you are looking for

  • R3.0 Release and PUSH Capabilities

    It has been several months since I jumped on this discussion grp... so this may have already been addressed? If memory serves me, the new (free) R3.0 release was to provide 3G (2nd gen) users a form of "PUSH" technology which was to accommodate some

  • Exception is not showing in transformation step in BPM after activating

    Hi , I want to cancel the process if any mapping error occur in transformation step for that I designed by below steps. 1.Block step ( mentioned exeption) 2. transformation step ( Inside block mentioned block step exception) 3. exception branc inside

  • I am having a problem creating a CSV file

    I have created CSV files and imported them into Mac's contact book before. For some reason this time its not allowing me to import them because its giving me this message: TEXT FILE IMPORT FAILURE "The selected file does not appear to be a valid comm

  • How to customize automatically generated jnlp file

    hi ! i am using sun application server 9.0. i have written an application client, and deployed it to the server. when i start the client via web-start, the application cannot load all classes, because there are some jars missing. my question: is ther

  • Is the portal "dead"? What comes after EP 6.0? Rumours...

    In the last weeks I have heard quite a few times from other customers and also from more or less "internals" that there will be no new development on the Portal side. I´m aware that EP 6.0 is supported until the end of the maintenance of NW 7.0, I´m