Vender quotation statement

Hello Every Body,
            Kindly help me friends.I need help in ALV Report which displays vender quotation statement.
Kindly plz give me reply as early as possible

Hi
Yes, ANGNR will be maintained in EKKO (Header), In item EKPO you can find Quotation dead line (EKPO-AGDAT) and Internal comments on Quotation ( EKPO-AGMEM).
regards
Srinivas

Similar Messages

  • How to create purchase order in CRM

    Hi All,
    Anybody please tell me how to create PO in CRM?
    Regards,
    Anurag

    Hi Anurag,
    In CRM, there are Lead, Opportunity, Inquiry, Quotation and Order.
    While PO is the legal document to confirm to the supplier to buy
    /purchase the goods, it should be recorded under Order document
    in SAP. But some cases where PO document need to be recorded
    separately, I would suggest you can use Quotation state in the
    document.
    Remember that for Quotation and Order have same structures.
    We can configured Quotation and Order in one transaction type.
    Or we can configure it into different transaction type and different
    number ranges.
    Some cases our client need to keep "original PO" in the system.
    In this case it is more make sense to provide two transaction
    types (one for Quotation -> PO, and another one for Order).
    So that client can save original PO at quotation document and
    use it to create follow up Order document.
    Hope this could helps.
    Gun.

  • Select statement to capture the vender address in SMARTFORM ?

    Hi All,
    I need help,i want to Capture the address and have to keep that address in vender address window of the smartform,
    For this I want to show the field form LFA1 that are NAME1,STRAS,ORT01,ORT02,PSTLZ,REGIO.
    I already kept address text for that but it is not collecting full Address and is collecing one field extra like "Republic Of India".
    Please any body send me the Coad for THIS .....
    Advence Thnks.

    Types: begin of TY_LFA1,
         NAME1 type LFA1-NAME1,
    STRAS type LFA1- STRAS,
    ORT01 type LFA1- ORT01,
    ORT02 type LFA1-,
    PSTLZ type LFA1- PSTLZ,
    REGIO type LFA1- REGIO,
         End of TY_LFA1.
    Data: WA_LFA1 type TY_LFA1.
    Parameter: lifnr TYPE lifnr.
    Select NAME1 STRAS ORT01 ORT02 PSTLZ REGIO
    into corresponding fields of WA_LFA1
    from LFA1
    Where Lifnr = Lifnr.
    If you are already getting Lifnr from some where remove the parameter statement and replace the where condition with the corresponding WA holding the lifnr value.
    Now while calling your Smart Function Module.
    add the WA in the Exporting part.
    Eg:
    CALL FUNCTION FM_NAME
    EXPORTING
    wa_lifnr = wa_lifnr.
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.IF SY-SUBRC <> 0.
    Now you will be able to use the Vendor data on the smart form

  • Development of Print Format for Quotation Comparison Statement

    Hi,
    Can any tell me about what are the transtcion and configuration involeved in developement of
    Print format for Quotaiton Comparision.
    Regards
    Anil

    Not sure what you mean by printing quotation comparison, however the following will enable you to configure output for RFQ and rejection letters:
    IMG > Purchasing > Messages > Output Control > Message Types > Define Message Types for Request For Quotation
    First maintain message types for RFQ, there should be 3 already in the standard system, ABSA (Quotation Rejection) MAHN (Reminder) NEU (Inquiry). When you create the RFQ initially, NEU will be determined to output the details of the qutation required. To customise the form:
      - select line for NEU
      - Double click on processing Routines - This will give you a list of the possible output mediums (print, fax etc...), the print programs and print forms available.
      - If you want to customise the form, copy existing (MEDRUCK) to a Z object (ZMEDRUCK) in SE71
      - make any required changes to ZMEDRUCK using transaction SE71. If you are simply changing layout then changing the form will be enough, if you require additional data on the form, additional programming will be required in the print program  (copy SAPFM06P to ZAPFM06P to make changes with SE80). ABAP programming knowledge very useful here or pass to programmer.
      - Update customising previously mentioned to use new form/program
      - Maintain Condition records in transaction MN01 if you require the output to arrive on the RFQ automatically
    The same process can be used for ABSA and MAHN if required. ABSA will only be triggered from Quotation comparison/maintenance if the rejection indicator is checked.

  • Relatório de Venda (Pedido)

    Bom dia,
    Fiz um relatório em Crystal Reports, porém os produtos estão sendo replicados, gostaria que ficasse apenas os produtos do pedido de venda. Segue o Código gerado pelo Crystal abaixo.
    SELECT "OCRD"."CardName", "CRD7"."TaxId0", "CRD7"."TaxId4", "CRD7"."TaxId1", "OCRD"."Phone1", "CRD1"."State", "CRD1"."City", "CRD1"."ZipCode", "CRD1"."Block", "CRD1"."StreetNo", "CRD1"."Street", "ORDR"."TaxDate", "OCTG"."PymntGroup", "RDR1"."ItemCode", "RDR1"."Dscription", "RDR1"."unitMsr", "RDR1"."Quantity", "RDR1"."Price", "ORDR"."DocTotal"
    FROM   (((("SAP"."dbo"."CRD1" "CRD1" INNER JOIN "SAP"."dbo"."OCRD" "OCRD" ON "CRD1"."CardCode"="OCRD"."CardCode") INNER JOIN "SAP"."dbo"."CRD7" "CRD7" ON "CRD1"."CardCode"="CRD7"."CardCode") INNER JOIN "SAP"."dbo"."OCTG" "OCTG" ON "OCRD"."CardCode"="OCTG"."CardCode") INNER JOIN "SAP"."dbo"."ORDR" "ORDR" ON "OCTG"."CardCode"="ORDR"."CardCode") INNER JOIN "SAP"."dbo"."RDR1" "RDR1" ON "ORDR"."CardCode"="RDR1"."CardCode"
    SELECT "OADM"."CompnyName", "OADM"."PrintHeadr", "OADM"."TaxIdNum", "OADM"."CompnyAddr"
    FROM   "SAP"."dbo"."OADM" "OADM"
    Abaixo em anexo a print do relátorio dentro do SAP

    Cristiano, bom dia,
    faça o seguinte teste.
    1) pegue o SQL que postei de pedido de compra no link Pedido de Compra - Impressão
    2) troque todas as tabelas OPOR para ORDR, e todas começando com POR para RDR (exemplo, POR1 para RDR1, POR2 para RDR2.
    Teste executar o SQL, talvez ajude vc.
    Outro detalhe, eu crio o SQL da empresa em um 2o comando no Crystal Reports.
    No meu "comando" está o SQL principal do relatório, já no "DadosEmpresa", está aquele seu último SQL
    E não faço ligações entre eles, o Crystal Reports reclama mas é só seguir em frente.
    Abraço
    Fabio.

  • Text Entry Box--Advanced Actions--Conditional Statement--Double quotes in literal input value

    Hello forums,
    I'm new to the forums (and Captivate in general), but I'm having a real problem carrying out a tutorial design and I think you may be my only hope.  Let me explain what I want to do and the difficulty that I'm having:
    I'm an instruction librarian at a university, and I'm designing an interactive tutorial for English 100 students to complete in order to become familiar with how to search the library catalog.  What I've done is taken a screenshot of the catalog search page, made it the background of a slide in Captivate (vers. 6), and placed a text entry box over the search bar in the screenshot.  The idea is for the students to conduct a simulated search by choosing one of three suggested search string formulations, and depending on the search string they enter, the tutorial will jump to a slide featuring a screenshot of what the actual search results would look like.  The idea is to emphasize the use of keywords over full-sentence phrases, and the use of double quotation marks to enclose multi-word search terms.
    So I've set the action for the TEB to "Execute Advanced Actions" and then created some IF/THEN statements in the "Advanced Actions" pop-up window (with action type set to 'conditional'). The script is such that if the student enters the first search option (how does sleep affect college students) in the TEB, the tutorial jumps to 1 slide, if they enter the second option (college students AND sleep), featuring a Boolean operator (AND), the tutorial jumps to a 2nd slide, and if they enter the third option ("college students" AND sleep) with the double quotes around "college students" and the Boolean operator, the tutorial should jump to a 3rd slide.  This action script works fine for the first two input options, but I can't make it work for the third search option.
    I think that it has something to do with the fact that the third input option features double quote marks, and this seems to throw off the script (I tried a quote-less input value for the third IF/THEN just to make sure that it would work jumping to the 3rd slide and it did), and I'm wondering if anyone has any suggestions as to how I can get around this issue.  Again, I need it to work so that if the student enters "college students" AND sleep, with the quote marks and the Boolean operator, the tutorial will jump to a slide showing the search results if those search terms were used in a real search of the catalog.
    I'd be extremely grateful for any help that anyone here can give me, we've been trying to make our online tutorials more engaging and interactive (and therefore more interesting), and I think this would be a great way to teach students about using quotes in their catalog searches.
    Thank you for your time and consideration.
    Andrew Wilk
    College Library
    UW-Madison

    The tutorial is for a "how to use catalog searching" instruction in an undergraduate library session.  We use boolean operators (AND, OR, NOT) to combine search terms, ex. to search for books about the sleeping habits of college students, I would enter "college students AND sleep."  Because "college students" is a multi-word phrase to describe one concept, I need to put quotation marks around the phrase to prevent the catalog from searching for the individual words separately, so the most correct search becomes ["college students" AND sleep] with quotation marks around only "college students," a user-typed "AND," and the word "sleep" (no q-marks).
    A colleague of mine worked out a pretty cool (if complicated) solution that I'll share if anyone is interested.  Since the q-marks where the problem, we've set it up so that the TEB validates the response for the search string with q-marks around "college students." If they enter it correctly, the tutorial jumps to the corresponding slide. The attempt # is set to 1, and if the user fails to enter the validated phrase (they misspell or use one of the other response options) then the TEB is set to run an Advanced Actions Script in which the other two options are scripted in IF/THEN statements that cause, when the term is entered correctly, the tutorial to jump to their corresponding slides. We've created another tab of IF/THEN statements that say that if the response is NOT equal to one of these response options, then the slide restarts (technically the slide "jumps" back to itself and starts over) and the user gets another chance to start the cycle over again.
    I know this is confusing (I had a really hard time explaining it in words), so if anyone is interested I could make a Jing video when I have some time.
    Thank you for all your suggestions

  • How do I use a variable within a sql statement

    I am trying to use a local variable within an open SQL step but I keep getting an error.
    My sql command looks like this "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  locals.CurrentSerialNo
    If I replace the locals.CurrentSerialNo with an actual value such as below the statement works fine.
    "SELECT BoardDetailID FROM BoardDetails WHERE SerialNumber = " +  " 'ABC001' " 
    Can someone tell me how to correctly format the statement to use a variable?

    Hi,
    Thanks for the reply. I have changed the required variable to a string, but with no success. I have reattached my updated sequence file and an image of the error.
    When looking at the Data operation step I see that the sql statement is missing everything after the last quotation mark.
    Thanks again,
    Stuart
    Attachments:
    Database Test Sequence.seq ‏10 KB
    TestStand error.JPG ‏37 KB

  • Triggering the creation of a quotation from within an Opportunity...

    We have implemented CRM Best Practice (CRM 7) and want to trigger the creation of an ERP quotation from within an Opportunity. Within the customising to assign the ERP order type to the CRM transaction type,
    when input help is pressed, no values are returned. CRM is not seeing the ERP order types.
    I have been informed that this is correct and that we need to create the order in CRM and then forward to ERP. However, this will never do, especially as CRM does not have all the information to successfully raise an order.
    I was wondering if anyone had encountered a similar problem and found a way around it. I'm aware that we can probably use the transaction launcher to create an order in ERP and return to CRM, but how this is triggered is another matter.
    Any advice and suggestions would be very much appreciated.
    Jason

    Thanks to all. We have had a reply back from SAP to say that what we trying to do is not possible. We have CRM 7 and ERP ECC5, however SAP are saying that we need at least 2005 on our ERP system for this functionality to work.
    Basically, when in config we attempting to set up the document types, but none are being displayed.
    SAP connected to our system and after analysis said that the cutsomers ERP system (ECC 5) needs to be upgraded to a minimum of ERP 2005, which I find to be an absolute crazy statement to make. Apparently, according to note 1236015 a minimum of ERP 2005 is required to maintain ERP sales transactions in CRM 7.0's CRM webclient UI.
    They debugged CL_CRM_INTLAY_LORD1_ERPIL
    IF_CRM_ERP_LORD_HELP_VALUES~GET_AUART
    Which seems to call FM SLS_LORD_GET_VALUES_AUART but does not exist in ECC 5.
    When tested in our CRM 7 system (not the clients) we do get a list of doc types appear, but then we are on the latest version of ERP.
    I was wondering whether there was a service patch to ECC 5 which might add the function group SLS_LORD_SHLP and assocaited function modules and includes, together with the class CL_FIELD_CONVERT.  That looks to be everything needed to run in ECC 5 from looking at our ECC 6 system. I'm never sure where ERP 2005 sits, is that a higher than version than ECC 6?.
    Jason

  • How do you create array of enums for transitions in a state machine?

    Hello,
    I am trying to build a state machine, but, I am struggling with understanding the methods for determining which state to transition to next.  In other words, I have several states, but, I don't want to go in any particular sequence.  If I have states numbered 1 through 10, I want to be able to go 1-4-2-5-6-2-6-1-10 etc. in no particular order. I want the transition to the next state  (and actions) to be determined by the streaming data, which can be random and require access to any of my 10 states at any time and in any sequence.
    I saw this picture on the "Application Design Patterns: State Machines" white paper, but, it leaves out some important details.  How does one create the structure in BLUE shown in 3C?  When I try to create this array of enums, all of them are the same. I am not able to make a list of different enum values.  In other words, when I type in "2", then, all the values in the array display as "2."
    There is a nice, simple video example of a state machine for dispensing soda for $0.15, however, this state machine moves in a single sequence, from 5 cents, to 10 cents to dispense; it does NOT illustrate how to select a state "out of order."  I need to understand how a state machine can move from "5 cents" state to dispense directly, with the addition of 10 cents to the "5 cents" state.
    Can anyone suggest a really good tutorial on how to make the selector work in a state machine?  I have been reading some of the available material on ni.com, but, I can't find a good detailed explanation of how to do it.  I remain confused. 
    Or, can you just explain how they created the BLUE array in the attached picture?  Maybe I can figure it out from there.
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    next state.jpg ‏75 KB

    Hi Kathryn,
    Yes, this is EXACTLY what I want to accomplish...
    So it would basically run:
    State 1
    Read input
    Determine next state (say 3)
    State 3
    Read input
    Determine next state
    State
    Read input
    Determine next state
    And so on...
    But, I am quite new to programming Labview state machines, and can't figure out how to even start when the sequence of states is random instead of fixed!!! I can do 1,2,3,4, like the vending machine VI example, but,  not 1,3,2,2,2,5,2,1 etc. based on external input.  Is there some simple example case I can study?  I can't believe I am inventing this for the first time.
    "select the state to run" 
    But, HOW do I do this???????   This is exactly the question I am asking...how is this done?  Please see the attached 3-state system....how do I hook this up????  I am totally lost here...can you help me understand how to wire this thing??  In this simpe RED/GREEN/BLUE case, my input is just the number a user would input on the front panel....  Apparently, there are two files necessary... a vi and .ctl???  What  is .ctl?
    Thanks,
    Dave
    Attachments:
    forum nov 12 red green blue.vi ‏7 KB
    forum nov 12 red green blue.ctl ‏5 KB

  • Tax Amount in Quotation

    Hi Experts,
    I want to print Tax amount at row level in Sales Quotation.
    The problem is that when I am taking Indian Currency then the variable no. of Tax Amount is 103 when I am changing the cuurency to USD then it becomes variable no. 104 .
    which variable can I use so that it may print the correct amount no matter what currency I use.
    Regrds
    Amit

    Hi Amit,
    You can create formular fields to allow both varibles print out based on the currency you are using.
    Check this thread for how to do:
    Re: conditional statement in QLD
    If you still unclear, keep posting
    Thanks,
    Gordon

  • SSMS 2012:XQuery-doing "Retriving Job Candidates with the query Method" in AdventuresWorks 2012. Unclosed quotation mark after string '//*:Name.First?

    Hi all,
    From Page 354 of the the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles (published by apress), I copied the following code (Listing 12-9 Retrieving Job Candidates with the query Method):
    --Coles12_9.sql // saved in C:/Documemnts/SQL Server Management Studio
    -- Coles Listing 12-9 Retrieving Job Candidates with the query Method
    -- Doing XQuery and the xml Data Type in AdvantureWorks
    -- 17 March 2015 1105 AM
    USE AdventureWorks;
    GO
    SELECT Resume.query
    N'//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    I executed this set of Listing 12-9 code in my SQL Server 2012 Management Studio and I got the following error messages:
    Msg 105, Level 15, State 1, Line 4
    Unclosed quotation mark after the character string '//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    Msg 102, Level 15, State 1, Line 4
    Incorrect syntax near '//*:Name.First,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level
    FROM HumanResources.JobCandidate;
    I am not able to figure out why I got the error messages.  Please kindly help and advise me how to correct this set of sql codes.
    Thanks in advance,
    Scott Chang

    Hi Scott,
    I don't have that book at hand, but your problem is the "Unclosed quotationmark after the character string",as the error message shows. You have to enclose the 'XQUERY' string quotation in the
    query().
    SELECT jobcandidateid, Resume.query
    N'//*:resume,
    //*:Name.Middle,
    //*:Name.Last,
    //*:Edu.Level' --enclose the quotation here
    FROM HumanResources.JobCandidate;
    For XQUERY learning, here is a good
    link.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Merge Statement in ABAP

    Dear Gurrus,
    i am having a trouble in using oracle merge statement in abap, the moment i use where clause in the bottom it  gives me an oracle error
    EXEC SQL.
      MERGE INTO SAP_GL_ACCOUNT@GETZDB a
      USING SKA1 b
        ON (A.gl_code= B.SAKNR)
      WHEN MATCHED THEN
        UPDATE SET a.posting_block =  B.XSPEB,
                   a.locked        =  B.XSPEA,
                   A.BALANCE_SHEET =  B.XBILK
         WHEN NOT MATCHED THEN
           insert   (gl_code,
                     DESCRIPTION,
                     posting_block,
                     locked,
                     balance_sheet)
          VALUES (b.SAKNR,'shadab',B.XSPEB,B.XSPEA,B.XBILK)
          where b. mandt = 950      I am talking about this line
             ENDEXEC.
    the Moment  i include WHERE clause in the botton before ENDEXEC it generates as error
    " Database error text........: "ORA-00904: "A3"."MANDT": invalid  identifier#ORA-02063: preceding line from GETZDB".
    although its a basic feature of Oracle to inclue where clauses in insert or update in merge, but here it is generating an error.

    Hello Shadab,
    As per my understanding of this oracle native sql code.
    everything is fine except the use of direct value i.e 950 .
    System is not able to process this value .
    This normally happens even in normal abap sql statements also.
    The better solution could be to declare a variable with the
    same data type as "mandt" and then pass this "950" value into that
    variable and then use this variable in the where clause instead of directly
    passing the value.
    i.e data:l_var type mandt vlaue '950'.
    The other option could be to use the same hard coded
    value but use this value in the where clause in quotations i.e.,
    '950' instead of 950.
    I hope this would solve your purpose, If not please reply me back.
    thanks,
    M.Naveen Kumar.

  • Refining AT NEW statements

    I've been assigned to make some modification to an incomplete program written by another ABAPer. I have managed to fulfill most of what is required by the specification document, however, i'm having difficulty with a particular AT NEW statement that will WRITE a new PR Doc Type whenever the next line of output belongs to a different PR Doc Type than the previous line.
    Currently, the PR Doc Type is always being written at each new line, no matter whether the current like is the same or different from the previous line's PR Doc Type.
    Could you guys have a look what i have done so far?
    NOTE: The original coding that i removed from the program were not deleted, i just * it
    REPORT ZRMME006 NO STANDARD PAGE HEADING
                    MESSAGE-ID 38
                    LINE-SIZE 255
                    LINE-COUNT 65.
    TABLES: EBAN,        "Purchase Requisition
            EBKN,        "Purchase Requisition Account Assignment
            EKKO,        "Purchasing Document Header
            EKPO,        "Purchasing Document Item
            EKBE,        "History of Purchasing Document
            EKET,        "Scheduling Agreement Delivery Schedules
            CDPOS,       "Change document items
            CDHDR,       "Change document header
            PRPS,        "WBS (Work Breakdown Structure) Element Master Data
            T161T.       "Text for Purchasing Document Types
    *    DATA DECLARATION
    DATA: BEGIN OF T_PR OCCURS 0,
            KNTTP        LIKE EBAN-KNTTP,      "Account assignment category
            KOSTL        LIKE EBKN-KOSTL,      "Cost center
            POSID        LIKE PRPS-POSID,      "Project code name
            PS_PSP_PNR   LIKE EBKN-PS_PSP_PNR, "WBS element
            ERNAM        LIKE EBAN-ERNAM,      "User ID
            BANFN        LIKE EBAN-BANFN,      "PR number
            BNFPO        LIKE EBAN-BNFPO,      "PR item number
            MATNR        LIKE EBAN-MATNR,      "Material number
            TXZ01        LIKE EBAN-TXZ01,      "Material description
            BSART        LIKE EBAN-BSART,      "PR document type
            BATXT        LIKE T161T-BATXT,     "Desc of purchasing doc type
            EBELN        LIKE EBAN-EBELN,      "PO number - eban
            EKKO_EBELN   LIKE EKKO-EBELN,      "PO number - ekko
            EKET_EBELN   LIKE EKET-EBELN,      "PO number - eket
            EBELP        LIKE EBAN-EBELP,      "PO item number - eban
            EKPO_EBELP   LIKE EKPO-EBELP,      "PO item number - ekpo
            EKET_EBELP   LIKE EKET-EBELP,      "PO item number - eket
            BADAT        LIKE EBAN-BADAT,      "PR creation date
            CHANGENR_PR  LIKE CDPOS-CHANGENR,  "PR changenr
            UDATE_PR     LIKE CDHDR-UDATE,     "PR approval date
            ANFNR        LIKE EKPO-ANFNR,      "RFQ number
            ANFPS        LIKE EKPO-ANFPS,      "RFQ item number
            CHANGENR_RFQ LIKE CDPOS-CHANGENR,  "RFQ changenr
            UDATE_RFQ    LIKE CDHDR-UDATE,     "RFQ maintained date
            AEDAT        LIKE EKPO-AEDAT,      "PO creation date
            EINDT        LIKE EKET-EINDT,      "PO required (dev date)
            CHANGENR_PO  LIKE CDPOS-CHANGENR,  "PO changenr
            UDATE_PO     LIKE CDHDR-UDATE,     "PO approval date
            DATVR_PO     LIKE NAST-DATVR,      "PO printed date
            CPUDT        LIKE EKBE-CPUDT,      "GRN delivered date
            FRGZU        LIKE EBAN-FRGZU,      "Release status
            EKKO_FRGZU   LIKE EKKO-FRGZU,      "Release status
            RFQ_AEDAT    LIKE EKPO-AEDAT,      "RFQ creation date
            VSTAT        LIKE NAST-VSTAT,      "Processing status of message
            EKGRP        LIKE EBAN-EKGRP,      "Purchasing group
          END OF T_PR.
    DATA: BEGIN OF T_DATE OCCURS 0,
            CPUDT LIKE EKBE-CPUDT,
            EBELN LIKE EKKO-EBELN,
            EBELP LIKE EKPO-EBELP,
          END OF T_DATE.
    DATA: BEGIN OF T_PUR OCCURS 0.
          INCLUDE STRUCTURE T_PR.
    DATA: END OF T_PUR.
    DATA: V_PRDAY(10)  TYPE C,           "PR days
          V_RFQDAY(10) TYPE C,           "RFQ days
          V_PODAY(10)  TYPE C,           "PO days
          V_GRNDAY(10) TYPE C,           "GRN days
          V_STADAY     TYPE I,           "Standard days
          V_ACTDAY     TYPE I,           "Actual days
          V_VARDAY(10) TYPE C,           "Variance
          V_RELPR      TYPE I,           "Release pr days
          V_RELPO      TYPE I,           "Release po days
          V_PRTEMP(10),
          V_RFQTEMP(10),
          V_POTEMP(10),
          V_GRNTEMP(10),
          V_FLAG(1)    TYPE C,
          V_FLAG2(1)   TYPE C,
          V_FLAG3(1)   TYPE C,
          V_COUNT      TYPE I,
          V_COUNT_MOD  TYPE I,
          V_SDATE      LIKE SY-DATUM,
          V_EDATE      LIKE SY-DATUM,
          V_LEN        TYPE I,
          V_LEN2       TYPE I.
    DATA: CHECK(1) TYPE C.                                       "DEVK951017
    * selection screen                                                     *
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_WERKS  FOR EBAN-WERKS DEFAULT '6001' to '6002', "Plant
                    S_EKORG  FOR EBAN-EKORG DEFAULT '6001' NO INTERVALS,
                    "Purch Org
                    S_BSART  FOR EBAN-BSART,
                    "PR type
                    S_BANFN  FOR EBAN-BANFN,
                    "PR number
                    S_BADAT  FOR EBAN-BADAT.
                    "PR date
    SELECTION-SCREEN END OF BLOCK BLK1.
    SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS: S_KOSTL  FOR EBKN-KOSTL,                   "Cost ctr
                    S_PS_PNR FOR EBKN-PS_PSP_PNR NO-DISPLAY,   "Project code
                    S_ERNAM  FOR EBAN-ERNAM.                   "User ID
    PARAMETERS:     P_ASSET AS CHECKBOX DEFAULT 'X',  "Acct Assign - A
                    P_KOSTL AS CHECKBOX DEFAULT 'X',  "Acct Assign - K
                    P_ERNAM AS CHECKBOX DEFAULT 'X',  "Acct Assign - Z
                    P_BSI AS CHECKBOX DEFAULT 'X',    "Acct Assign - H
                    P_MOI AS CHECKBOX DEFAULT 'X',    "Acct Assign - F
                    P_STA AS CHECKBOX DEFAULT 'X'.    "Acct Assign - <blank>
    SELECTION-SCREEN END OF BLOCK BLK2.
    SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME TITLE TEXT-003.
    PARAMETERS:     P_CON RADIOBUTTON GROUP PGRP,               "Overseas
                    P_LCL RADIOBUTTON GROUP PGRP,               "Local
                    P_ALL RADIOBUTTON GROUP PGRP DEFAULT 'X'.   "All
    SELECTION-SCREEN END OF BLOCK BLK3.
    *--> range of knttp that the report will only select
    RANGES: S_KNTTP FOR EBAN-KNTTP,
    *--> range of tcode that approval obtained from
            S_TCODE FOR CDHDR-TCODE.
    TOP-OF-PAGE.
    *  perform write_rpttop using sy-title v_sdate v_edate.      "DEVK951017
    *PERFORM WRITE_RPTTOP USING SY-TITLE S_BADAT-LOW S_BADAT-
    *HIGH."DEVK951017
    *    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM INITIALISATION.
      IF P_ASSET IS INITIAL AND
         P_KOSTL IS INITIAL AND
         P_ERNAM IS INITIAL AND
         P_BSI IS INITIAL AND
         P_MOI IS INITIAL AND
         P_STA IS INITIAL.
        MESSAGE S000 WITH TEXT-E02.
        EXIT.
      ELSE.
        PERFORM SELECT_DATA.
        IF V_FLAG NE 'X'.
          PERFORM WRITE_REPORT.
    *      PERFORM GET_TPAGENO.
    *      PERFORM WRITE_RPTEND.
        ELSE.
          MESSAGE S000 WITH TEXT-E01.
        ENDIF.
      ENDIF.
    *&      Form  SELECT_DATA
    FORM SELECT_DATA.
    IF P_CON EQ 'X'.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL AND
              EKGRP = 'OVS' AND
              EKGRP = 'CON'.
    ELSEIF P_LCL EQ 'X'.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL AND
              EKGRP = 'LCL'.
    ELSE.
      SELECT X~KNTTP Y~KOSTL X~ERNAM X~BANFN X~BNFPO X~MATNR
             X~TXZ01 X~BSART X~EBELN X~EBELP X~BADAT X~FRGZU
        FROM ( EBAN AS X
                 INNER JOIN EBKN AS Y
                   ON X~BANFN EQ Y~BANFN AND
                      X~BNFPO EQ Y~BNFPO )
      APPENDING CORRESPONDING FIELDS OF TABLE T_PR
        WHERE X~BANFN IN S_BANFN AND
              X~LOEKZ EQ '' AND
              X~KNTTP IN S_KNTTP AND
              X~WERKS IN S_WERKS AND
              X~BADAT IN S_BADAT AND
              X~ERNAM IN S_ERNAM AND
              X~BSART IN S_BSART AND
              X~EKORG IN S_EKORG AND
              Y~KOSTL IN S_KOSTL.
    ENDIF.
    *  SELECT * FROM ZEPURDAY INTO T_PRDAY.
    *  APPEND T_PRDAY.
    *  ENDSELECT.
      READ TABLE T_PR INDEX 1.
      IF SY-SUBRC NE 0.
        V_FLAG = 'X'.
      ENDIF.
    ENDFORM.                    " SELECT_DATA
    *&      Form  WRITE_REPORT
    FORM WRITE_REPORT.
    DATA: V_ERNAM LIKE EBKN-ERNAM,
          V_KOSTL LIKE EBKN-KOSTL.
    *--> get from and to date for report header
      PERFORM GET_TITLE_DATE.
    *--> get header and line item data
      PERFORM GET_HEADER_ITEM.
    *--> check data entries of table zepurday.
    *  PERFORM CHECK_TZEPURDAY.
    *--> identify sort key for sorting
      PERFORM SORT.
      CLEAR T_PUR.
      LOOP AT T_PUR.
    *--> get further data from tables against t_pr
        PERFORM PROCESS_DATA.
    *--> get standard day
        PERFORM GET_STAND_DAY.
    *--> get latest grn date
        PERFORM GET_LATEST_GRNDATE.
    *--> get actual day = GRN date - PR creation date
        PERFORM GET_ACT_DAY.
    *--> get variance days = Standard days - Actual days
        PERFORM GET_VAR_DAY.
        V_COUNT = V_COUNT + 1.
        MOVE: T_PUR-ERNAM TO V_ERNAM,
              T_PUR-KOSTL TO V_KOSTL.
        AT NEW KNTTP.
          IF V_FLAG3 NE 'X'.
    *        NEW-PAGE.
          ENDIF.
          V_FLAG3 = 'X'.
          SKIP 1.
         WRITE:/2 'Account Assignment:', 22(10) T_PUR-KNTTP COLOR COL_GROUP.
        ENDAT.
    *--> This is the part i am having trouble <--*
    IF T_PUR-KNTTP EQ 'Z' OR
       T_PUR-KNTTP EQ 'A' OR
       T_PUR-KNTTP EQ 'K' OR
       T_PUR-KNTTP EQ 'H' OR
       T_PUR-KNTTP EQ 'F'.
    AT NEW BSART.
        SELECT SINGLE * FROM T161T
        WHERE SPRAS = 'EN' AND
              BSART = T_PUR-BSART AND
              BSTYP = 'B'.
        T_PUR-BATXT = T161T-BATXT.
      IF V_FLAG3 NE 'X'.
      ENDIF.
      V_FLAG3 = 'X'.
      WRITE:/2 'PR Doc Type Desc:',
             22(3) T_PUR-BSART COLOR COL_GROUP.
      WRITE: 26 T_PUR-BATXT NO-GAP COLOR COL_GROUP.
      PERFORM WRITE_HEADER.
    ENDAT.
    ELSE.
      AT NEW BSART.
        SELECT SINGLE * FROM T161T
        WHERE SPRAS = 'EN' AND
              BSART = T_PUR-BSART AND
              BSTYP = 'B'.
        T_PUR-BATXT = T161T-BATXT.
      IF V_FLAG3 NE 'X'.
      ENDIF.
      V_FLAG3 = 'X'.
      WRITE:/2 'PR Doc Type Desc:',
             22(3) T_PUR-BSART COLOR COL_GROUP.
      WRITE: 26 T_PUR-BATXT NO-GAP COLOR COL_GROUP.
      PERFORM WRITE_HEADER.
    ENDAT.
    ENDIF.
    *    IF T_PUR-KNTTP EQ 'Z'.
    *      AT NEW ERNAM.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *         WRITE:/2 'User ID:', 22(10) V_ERNAM COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ELSEIF T_PUR-KNTTP EQ 'A' OR T_PUR-KNTTP EQ 'K'.
    *      AT NEW KOSTL.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *         WRITE:/2 'Cost Center:', 22(10) V_KOSTL COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ELSEIF T_PUR-KNTTP EQ 'P'.
    *      AT NEW POSID.
    *        IF SY-LINNO >= 60.
    *          NEW-PAGE.
    *        ENDIF.
    *     WRITE:/2 'Project Code:', 22(10) T_PUR-POSID COLOR COL_GROUP.
    *          PERFORM WRITE_HEADER. "write contents header
    *      ENDAT.
    *    ENDIF.
    *--> write report details
        IF SY-LINNO >= 60.
          ULINE (255).
          NEW-PAGE.
          PERFORM WRITE_HEADER.
        ENDIF.
          PERFORM INVERT_LINE_ITEMS_COLOR.
          PERFORM WRITE_DETAILS.
    *--> display data ordered by User ID/Cost Center/Project ID.
        IF T_PUR-KNTTP EQ 'Z'.
          AT END OF ERNAM.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'A' OR T_PUR-KNTTP EQ 'K'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
        ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'H'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ 'F'.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ELSEIF T_PUR-KNTTP EQ ' '.
          AT END OF KOSTL.
            ULINE (236).
            SKIP 1.
            FORMAT COLOR COL_BACKGROUND INTENSIFIED.
            CLEAR: V_COUNT_MOD, V_COUNT.
          ENDAT.
        ENDIF.
      CLEAR: V_PRDAY,
             V_PRTEMP,
             V_RFQDAY,
             V_RFQTEMP,
             V_PODAY,
             V_POTEMP,
             V_GRNDAY,
             V_GRNTEMP,
             V_ACTDAY,
             V_STADAY,
             V_RELPR,
             V_RELPO,
             V_FLAG3.
      ENDLOOP.
    ENDFORM.                    " WRITE_REPORT
    *&    FORM INITIALISATION
    *&      Initialize value for s_knttp                                   *
    FORM INITIALISATION.
    S_KNTTP-SIGN = 'I'.
    S_KNTTP-OPTION = 'EQ'.
    *--> BUDGETED ASSET
    IF P_ASSET = 'X'.
      S_KNTTP-LOW = 'A'.
      APPEND S_KNTTP.
    ENDIF.
    *--> COST CENTER
    IF P_KOSTL = 'X'.
      S_KNTTP-LOW = 'K'.
      APPEND S_KNTTP.
    ENDIF.
    *--> Project
    *IF P_PCODE = 'X'.
    *  S_KNTTP-LOW = 'P'.
    *  APPEND S_KNTTP.f
    *ENDIF.
    *--> NON-BUDGETED ASSET
    IF P_ERNAM = 'X'.
      S_KNTTP-LOW = 'Z'.
      APPEND S_KNTTP.
    ENDIF.
    *--> BALANCE SHEET ITEM
    IF P_BSI = 'X'.
      S_KNTTP-LOW = 'H'.
      APPEND S_KNTTP.
    ENDIF.
    *--> MO ITEM
    IF P_MOI = 'X'.
      S_KNTTP-LOW = 'F'.
      APPEND S_KNTTP.
    ENDIF.
    *--> STANDARD
    IF P_STA = 'X'.
      S_KNTTP-LOW = ' '.
      APPEND S_KNTTP.
    ENDIF.
    S_TCODE-SIGN = 'I'.
    S_TCODE-OPTION = 'EQ'.
    S_TCODE-LOW = 'ZME55'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME54'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME28'.
      APPEND S_TCODE.
    S_TCODE-LOW = 'ME47'.
      APPEND S_TCODE.
    ENDFORM.
    *&    FORM SORT
    FORM SORT.
    CLEAR T_PUR.
    LOOP AT T_PUR.
      IF T_PUR-KNTTP EQ 'A' OR
         T_PUR-KNTTP EQ 'K' OR
         T_PUR-KNTTP EQ 'Z' OR
         T_PUR-KNTTP EQ 'H' OR
         T_PUR-KNTTP EQ 'F' OR
         T_PUR-KNTTP EQ ' '.
        SORT T_PUR BY BSART EBELN EBELP.
        EXIT.
      ENDIF.
    ENDLOOP.
    ENDFORM.
    *&    FORM PROCESS_DATA
    FORM PROCESS_DATA.
    DATA: V_TABKEY  LIKE CDPOS-TABKEY,
          V_TABKEY2 LIKE CDPOS-TABKEY,
          V_TABKEY3 LIKE CDPOS-TABKEY.
      CONCATENATE SY-MANDT T_PUR-BANFN T_PUR-BNFPO INTO V_TABKEY.
      CONCATENATE SY-MANDT T_PUR-EBELN INTO V_TABKEY2.
      CONCATENATE SY-MANDT T_PUR-ANFNR T_PUR-EKPO_EBELP INTO V_TABKEY3.
    *--> get po history data
      REFRESH T_DATE.
      SELECT CPUDT EBELN EBELP
        INTO CORRESPONDING FIELDS OF T_DATE
        FROM EKBE
        WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP
          AND BEWTP EQ 'E' AND BWART EQ '101'.
      APPEND T_DATE.
      ENDSELECT.
    *-->get scheduling agreement delivery schedules data
      SELECT EINDT INTO T_PUR-EINDT FROM EKET
        WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP.
      MODIFY T_PUR TRANSPORTING EINDT
             WHERE EBELN EQ T_PUR-EBELN AND EBELP EQ T_PUR-EBELP.
      ENDSELECT.
    *--> PR approval date
      SELECT CHANGENR INTO T_PUR-CHANGENR_PR
             FROM CDPOS
             WHERE OBJECTCLAS EQ 'BANF' AND OBJECTID EQ T_PUR-BANFN
               AND TABNAME EQ 'EBAN' AND TABKEY EQ V_TABKEY
               AND FNAME EQ 'FRGKZ' AND CHNGIND EQ 'U'
               AND VALUE_NEW EQ '2'.
      MODIFY T_PUR TRANSPORTING CHANGENR_PR WHERE BANFN EQ T_PUR-BANFN.
      ENDSELECT.
      SELECT UDATE INTO T_PUR-UDATE_PR
             FROM CDHDR
             WHERE OBJECTCLAS EQ 'BANF' AND OBJECTID EQ T_PUR-BANFN
             AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
             AND CHANGENR EQ T_PUR-CHANGENR_PR.
      MODIFY T_PUR TRANSPORTING UDATE_PR WHERE BANFN EQ T_PUR-BANFN.
      ENDSELECT.
    *--> PO approval date
      SELECT CHANGENR INTO T_PUR-CHANGENR_PO
             FROM CDPOS
             WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-EBELN
               AND TABNAME EQ 'EKKO' AND TABKEY EQ V_TABKEY2
               AND FNAME EQ 'FRGKE' AND CHNGIND EQ 'U'
               AND VALUE_NEW EQ 'A'.
      MODIFY T_PUR TRANSPORTING CHANGENR_PO WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
      SELECT UDATE INTO T_PUR-UDATE_PO
             FROM CDHDR
             WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-EBELN
             AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
             AND CHANGENR EQ T_PUR-CHANGENR_PO.
      MODIFY T_PUR TRANSPORTING UDATE_PO WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
    *--> PO printed date
      SELECT DATVR VSTAT INTO (T_PUR-DATVR_PO, T_PUR-VSTAT)
             FROM NAST
             WHERE KAPPL EQ 'EF' AND OBJKY EQ T_PUR-EBELN.
    *           and vstat eq '1'.
      MODIFY T_PUR TRANSPORTING DATVR_PO VSTAT
                                         WHERE EBELN EQ T_PUR-EBELN.
      ENDSELECT.
    *--> RFQ maintained date
      IF NOT T_PUR-ANFNR IS INITIAL.
        SELECT CHANGENR INTO T_PUR-CHANGENR_RFQ
               FROM CDPOS
               WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-ANFNR
                 AND TABNAME EQ 'EKPO' AND TABKEY EQ V_TABKEY3
                 AND FNAME EQ 'NETPR' AND CHNGIND EQ 'U'.
        MODIFY T_PUR TRANSPORTING CHANGENR_RFQ WHERE ANFNR EQ T_PUR-ANFNR.
        ENDSELECT.
        SELECT UDATE INTO T_PUR-UDATE_RFQ
               FROM CDHDR
               WHERE OBJECTCLAS EQ 'EINKBELEG' AND OBJECTID EQ T_PUR-ANFNR
                 AND TCODE IN S_TCODE AND CHANGE_IND EQ 'U'
                 AND CHANGENR EQ T_PUR-CHANGENR_RFQ.
        MODIFY T_PUR TRANSPORTING UDATE_RFQ WHERE ANFNR EQ T_PUR-ANFNR.
        ENDSELECT.
      ELSE.
        T_PUR-UDATE_RFQ = '00000000'.
      ENDIF.
    *--> get RFQ creation date
      SELECT AEDAT INTO T_PUR-RFQ_AEDAT FROM EKPO
        WHERE EBELN EQ T_PUR-ANFNR.
      MODIFY T_PUR TRANSPORTING RFQ_AEDAT.
      ENDSELECT.
    *--> PR Days = PR release date - PR creation date
      IF T_PUR-UDATE_PR IS INITIAL OR T_PUR-BADAT IS INITIAL.
        V_PRDAY = '0'.
      ELSE.
    *    v_prday = t_pur-udate_pr - t_pur-badat.
    *    v_prtemp = t_pur-udate_pr - t_pur-badat.               " DEVK951017
        PERFORM CALC_ACT_WORKDAY                                 "DEVK951017
               USING T_PUR-BADAT T_PUR-UDATE_PR V_PRTEMP.        "DEVK951017
        PERFORM CONVERT_NEG_TO_BRACKET USING V_PRTEMP
                                       CHANGING V_PRDAY.
      ENDIF.
    *--> RFQ Days = RFQ quotation date - PR release date
    * if t_pur-rfq_aedat is initial or t_pur-udate_pr is initial."DEVK951017
      IF T_PUR-UDATE_RFQ IS INITIAL OR T_PUR-UDATE_PR IS INITIAL."DEVK951017
       V_RFQDAY = '0'.
      ELSE.
    *    v_rfqday = t_pur-rfq_aedat - t_pur-udate_pr.
    *    v_rfqtemp = t_pur-rfq_aedat - t_pur-udate_pr.           "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-UDATE_RFQ V_RFQTEMP.      "DEVK951017
    PERFORM CONVERT_NEG_TO_BRACKET USING V_RFQTEMP
                                       CHANGING V_RFQDAY.
      ENDIF.
    *--> PO days
    *--> RFQ number not exist (PO Days = PO printed date - PR released date)
      IF T_PUR-ANFNR IS INITIAL.
    *    if t_pur-datvr_po is initial or t_pur-udate_pr is initial.
    *      v_poday = '0'.u
    *    else.
          IF T_PUR-VSTAT = 1.
            IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
              V_PODAY = '0'.
            ELSE.
    *          v_poday = t_pur-datvr_po - t_pur-udate_pr.
    *         v_potemp = t_pur-datvr_po - t_pur-udate_pr.        "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-DATVR_PO V_POTEMP.        "DEVK951017
              PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                             CHANGING V_PODAY.
            ENDIF.
          ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
            IF T_PUR-AEDAT IS INITIAL OR T_PUR-UDATE_PR IS INITIAL.
              V_PODAY = '0'.
            ELSE.
    *          v_poday = t_pur-aedat - t_pur-udate_pr.
    *          v_potemp = t_pur-aedat - t_pur-udate_pr.          "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-UDATE_PR T_PUR-AEDAT V_POTEMP.           "DEVK951017
              PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                             CHANGING V_PODAY.
            ENDIF.
          ELSEIF T_PUR-VSTAT IS INITIAL.
            V_PODAY = '0'.
          ENDIF.
    *    endif.
      ELSE.
    *--> RFQ number exist (PO Days = PO printed date - Quotation date)
    *    if t_pur-datvr_po is initial or t_pur-rfq_aedat is initial.
    *      v_poday = '0'.
    *    else.
        IF T_PUR-VSTAT = 1.
          IF T_PUR-DATVR_PO IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
            V_PODAY = '0'.
          ELSE.
    *        v_poday = t_pur-datvr_po - t_pur-rfq_aedat.
    *       v_potemp = t_pur-datvr_po - t_pur-rfq_aedat.         "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-RFQ_AEDAT T_PUR-DATVR_PO V_POTEMP.       "DEVK951017
            PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                           CHANGING V_PODAY.
          ENDIF.
        ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
          IF T_PUR-AEDAT IS INITIAL OR T_PUR-RFQ_AEDAT IS INITIAL.
            V_PODAY = '0'.
          ELSE.
    *        v_poday = t_pur-aedat - t_pur-rfq_aedat.
    *        v_potemp = t_pur-aedat - t_pur-rfq_aedat.           "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-RFQ_AEDAT T_PUR-AEDAT V_POTEMP.          "DEVK951017
            PERFORM CONVERT_NEG_TO_BRACKET USING V_POTEMP
                                           CHANGING V_PODAY.
          ENDIF.
        ELSEIF T_PUR-VSTAT IS INITIAL.
          V_PODAY = '0'.
        ENDIF.
      ENDIF.
      CLEAR: V_TABKEY,
             V_TABKEY2,
             V_TABKEY3.
    ENDFORM.
    *&    FORM WRITE_HEADER
    FORM WRITE_HEADER.
      ULINE (255).
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE:/    '|', 9   'PR',
             21  '|', 48  'Material',
             83  '|', 92  'PO',
             103 '|', 107 'Purchase Requisition',
             131 '|', 143 'RFQ',
             159 '|', 176 'Purchase Order',
             209 '|', 210 'S',
             211 '|', 217 'GRN',
             228 '|', 229 'Standard',
             237 '|', 238 'Actual',
             244 '|', 255 '|'.
      ULINE (228).
      FORMAT COLOR OFF.
      WRITE: 237 '|', 244 '|', 255 '|'.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      WRITE:/    '|', 2   'Number',
             12  '|', 13  'Item No.',
             21  '|', 22  'Number',
             41  '|', 42  'Description',
             83  '|', 84  'Number',
             94  '|', 95  'Item No.',
             103 '|', 104 'Created',
             114 '|', 115 'Released',
             125 '|', 126 'Days',
             131 '|', 132 'Created',
             142 '|', 143 'Maintained',
             153 '|', 154 'Days',
             159 '|', 160 'Created',
             170 '|', 171 'Required',
             181 '|', 182 'Approved',
             192 '|', 193 'Printed',
             203 '|', 204 'Days',
             209 '|',
             211 '|', 212 'Delivered',
             222 '|', 223 'Days',
             228 '|', 229 'Days',
             237 '|', 238 'Days',
             244 '|', 245 'Variance',
             255 '|'.
      FORMAT COLOR OFF.
      ULINE (255).
    ENDFORM.                    " WRITE_HEADER
    *&      Form  INVERT_LINE_ITEMS_COLOR
    FORM INVERT_LINE_ITEMS_COLOR.
      V_COUNT_MOD = V_COUNT MOD 2.
      IF V_COUNT_MOD EQ '0'.
        FORMAT COLOR COL_KEY INTENSIFIED OFF.
      ELSE.
        FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
      ENDIF.
    ENDFORM.                    " INVERT_LINE_ITEMS_COLOR
    *&      Form  GET_TITLE_DATE
    FORM GET_TITLE_DATE.
      IF NOT S_BADAT-LOW IS INITIAL AND NOT S_BADAT-HIGH IS INITIAL.
        V_SDATE = S_BADAT-LOW.
        V_EDATE = S_BADAT-HIGH.
      ELSE.
        SORT T_PR BY BADAT ASCENDING.
        READ TABLE T_PR INDEX 1.
        V_SDATE = T_PR-BADAT.
        SORT T_PR BY BADAT DESCENDING.
        READ TABLE T_PR INDEX 1.
        V_EDATE = T_PR-BADAT.
      ENDIF.
    ENDFORM.                    " GET_TITLE_DATE
    *&      Form  GET_LATEST_GRNDATE
    FORM GET_LATEST_GRNDATE.
    DATA: D_LINES TYPE I.
      CLEAR T_DATE.
      DESCRIBE TABLE T_DATE LINES D_LINES.
      IF D_LINES GT 0.
        SORT T_DATE BY CPUDT EBELN EBELP DESCENDING.
        READ TABLE T_DATE WITH KEY EBELN = T_PUR-EBELN.
        IF SY-SUBRC = 0.
          READ TABLE T_DATE INDEX 1.
          MOVE: T_DATE-CPUDT TO T_PUR-CPUDT.
          MODIFY T_PUR TRANSPORTING CPUDT
                 WHERE EBELN = T_PUR-EBELN AND EBELP = T_PUR-EBELP.
        ENDIF.
      ENDIF.
    *--> GRN Days = GRN date - PO printed date
      IF T_PUR-VSTAT = 1.
        IF T_PUR-CPUDT IS INITIAL OR T_PUR-DATVR_PO IS INITIAL.
          V_GRNDAY = '0'.
        ELSE.
    *    v_grnday = t_pur-cpudt - t_pur-datvr_po.
    *    v_grntemp = t_pur-cpudt - t_pur-datvr_po.               "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-DATVR_PO T_PUR-CPUDT V_GRNTEMP.          "DEVK951017
          PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                         CHANGING V_GRNDAY.
        ENDIF.
      ELSEIF T_PUR-VSTAT = 2 OR T_PUR-VSTAT = 0.
        IF T_PUR-CPUDT IS INITIAL OR T_PUR-AEDAT IS INITIAL.
          V_GRNDAY = '0'.
        ELSE.
    *    v_grnday = t_pur-cpudt - t_pur-datvr_po.
    *     v_grntemp = t_pur-cpudt - v_grntemp.                   "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-AEDAT T_PUR-CPUDT V_GRNTEMP.             "DEVK951017
          PERFORM CONVERT_NEG_TO_BRACKET USING V_GRNTEMP
                                         CHANGING V_GRNDAY.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_LATEST_GRNDATE
    *&      Form  GET_HEADER_ITEM
    FORM GET_HEADER_ITEM.
    DATA: V_OBJNR   LIKE PRPS-OBJNR,
          V_TEMP(4) TYPE C.
      clear t_pr.
      loop at t_pr.
        SELECT EBELN EBELP FROM EKET
               INTO (EKET-EBELN, EKET-EBELP)
               WHERE BANFN EQ T_PR-BANFN AND BNFPO EQ T_PR-BNFPO.
          SELECT EBELN FRGZU FROM EKKO
                 INTO (EKKO-EBELN, EKKO-FRGZU)
                 WHERE EBELN EQ EKET-EBELN.
            SELECT EBELP ANFNR ANFPS AEDAT FROM EKPO
                   INTO (EKPO-EBELP, EKPO-ANFNR, EKPO-ANFPS, EKPO-AEDAT)
                   WHERE EBELN EQ EKET-EBELN AND EBELP EQ EKET-EBELP
                   AND BSTYP EQ 'F'.
              MOVE-CORRESPONDING T_PR TO T_PUR.
              MOVE: EKET-EBELN TO T_PUR-EKET_EBELN,
                    EKET-EBELP TO T_PUR-EKET_EBELP,
                    EKKO-EBELN TO T_PUR-EKKO_EBELN,
                    EKKO-FRGZU TO T_PUR-EKKO_FRGZU,
                    EKPO-EBELP TO T_PUR-EKPO_EBELP,
                    EKPO-ANFNR TO T_PUR-ANFNR,
                    EKPO-ANFPS TO T_PUR-ANFPS,
                    EKPO-AEDAT TO T_PUR-AEDAT.
              V_FLAG2 = 'Y'.
              APPEND T_PUR.
            ENDSELECT.
          ENDSELECT.
        ENDSELECT.
      IF V_FLAG2 NE 'Y'.
        MOVE-CORRESPONDING T_PR TO T_PUR.
        APPEND T_PUR.
      ENDIF.
    *--> get project code name
      CONCATENATE 'PR' T_PR-PS_PSP_PNR INTO V_OBJNR.
      SELECT SINGLE POSID INTO T_PR-POSID FROM PRPS WHERE OBJNR EQ V_OBJNR.
      SPLIT T_PR-POSID AT '/' INTO T_PUR-POSID V_TEMP.
      MODIFY T_PUR TRANSPORTING POSID WHERE PS_PSP_PNR EQ T_PR-PS_PSP_PNR.
    CLEAR V_FLAG2.
      ENDLOOP.
    ENDFORM.                    " GET_HEADER_ITEM
    *&      Form  WRITE_DETAILS
    FORM WRITE_DETAILS.
      WRITE:/   '|', 2   T_PUR-BANFN,                "PR no
             12 '|', 13  T_PUR-BNFPO,                "item no
             41 '|', 42  T_PUR-TXZ01,                "mat description
            103 '|', 104 T_PUR-BADAT,                "PR creation date
            125 '|', 126 V_PRDAY LEFT-JUSTIFIED,     "PR days
            131 '|',
            153 '|', 154 V_RFQDAY LEFT-JUSTIFIED,    "RFQ days
            203 '|', 204 V_PODAY LEFT-JUSTIFIED,     "PO days
            209 '|', 210 T_PUR-VSTAT,
            222 '|', 223 V_GRNDAY LEFT-JUSTIFIED,    "GRN days
            228 '|', 229 V_STADAY LEFT-JUSTIFIED,    "Standard days
            237 '|', 238 V_ACTDAY LEFT-JUSTIFIED,    "Actual days
            244 '|', 245 V_VARDAY LEFT-JUSTIFIED,    "Variance days
            255 '|'.
      IF T_PUR-MATNR IS INITIAL.
        WRITE: 21 '|', 22 '-'.
      ELSE.
        WRITE: 21 '|', 22  T_PUR-MATNR.              "mat no
      ENDIF.
      IF T_PUR-EKKO_EBELN IS INITIAL.
        WRITE: 83 '|', 84 '-'.
      ELSE.
        WRITE: 83 '|', 84  T_PUR-EKKO_EBELN.         "PO number
      ENDIF.
      IF T_PUR-EKPO_EBELP EQ '00000' OR T_PUR-EKPO_EBELP IS INITIAL.
        WRITE: 94 '|', 95 '-'.
      ELSE.
        WRITE: 94 '|', 95  T_PUR-EKPO_EBELP.         "PO item no
      ENDIF.
      IF T_PUR-UDATE_PR EQ '00000000'.
        WRITE:  114 '|', 115 '-'.
      ELSE.
        WRITE: 114 '|', 115 T_PUR-UDATE_PR.          "PR released date
      ENDIF.
      IF T_PUR-RFQ_AEDAT EQ '00000000'.
        WRITE: 132 '-', 142 '|'.
      ELSE.
        WRITE: 132 T_PUR-RFQ_AEDAT, 142 '|'.  "RFQ creation date
      ENDIF.
      IF T_PUR-UDATE_RFQ EQ '00000000'.
        WRITE: 143 '-'.
      ELSE.
        WRITE: 143 T_PUR-UDATE_RFQ.           "RFQ maintained date
      ENDIF.
      IF T_PUR-AEDAT EQ '00000000'.
        WRITE: 159 '|', 160 '-'.
      ELSE.
        WRITE: 159 '|', 160 T_PUR-AEDAT.      "PO creation date
      ENDIF.
      IF T_PUR-EINDT EQ '00000000'.
        WRITE: 170 '|', 171 '-'.
      ELSE.
        WRITE: 170 '|', 171 T_PUR-EINDT.       "PO required date
      ENDIF.
      IF T_PUR-UDATE_PO EQ '00000000'.
        WRITE: 181 '|', 182 '-'.
      ELSE.
        WRITE: 181 '|', 182 T_PUR-UDATE_PO.    "PO released date
      ENDIF.
      IF T_PUR-VSTAT = 1.
    *    if t_pur-datvr_po eq '00000000'.
    *      write: 192 '|', 193 '-'.
    *    else.
          WRITE: 192 '|', 193 T_PUR-DATVR_PO.    "PO printed date
    *    endif.
    *  elseif t_pur-vstat = 2 or t_pur-vstat = 0.                "DEVK951017
       ELSEIF T_PUR-VSTAT = 2.                                   "DEVK951017
        WRITE: 192 '|', 193 T_PUR-AEDAT.         "PO creation date
       ELSEIF T_PUR-VSTAT = 0.                                   "DEVK951017
        WRITE: 192 '|', 193 '-'.     "PO printed date not shown  "DEVK951017
      ENDIF.
      IF T_PUR-CPUDT EQ '00000000'.
        WRITE: 211 '|', 212 '-'.
      ELSE.
        WRITE: 211 '|', 212 T_PUR-CPUDT.        "GRN delivered date
      ENDIF.
    ENDFORM.                    " WRITE_DETAILS
    *&      Form  CHECK_TZEPURDAY
    FORM CHECK_TZEPURDAY.
    *  CLEAR T_PRDAY.
    *  READ TABLE T_PRDAY INDEX 1.
    *  IF SY-SUBRC NE 0.
    *    FORMAT COLOR COL_NEGATIVE ON.
    *    WRITE:/ '*** No Table Entries Found in Table ZEPURDAY ***'.
    *    FORMAT COLOR OFF.
    *  ENDIF.
    ENDFORM.                    " CHECK_TZEPURDAY
    *&      Form  GET_STAND_DAY
    FORM GET_STAND_DAY.
    *--> PR release days
    *  CLEAR T_PRDAY.
    *  READ TABLE T_PRDAY WITH KEY PR_TYPE = T_PUR-BSART.
    *  IF SY-SUBRC EQ 0.
    *    CLEAR V_LEN.
    *    CONDENSE T_PUR-FRGZU.
    *    V_LEN = STRLEN( T_PUR-FRGZU ).
    *    IF V_LEN EQ 0.
    *      V_RELPR = 0.
    *    ELSEIF V_LEN EQ '1'.
    *      V_RELPR = T_PRDAY-PR_RE1.
    *    ELSEIF V_LEN EQ '2'.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2.
    *    ELSEIF V_LEN EQ '3'.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2 + T_PRDAY-PR_RE3.
    *    ELSE.
    *      V_RELPR = T_PRDAY-PR_RE1 + T_PRDAY-PR_RE2 +
    *                T_PRDAY-PR_RE3 + T_PRDAY-PR_RE4.
    *    ENDIF.
    *--> PO release days
    *    CLEAR V_LEN2.
    *    CONDENSE T_PUR-EKKO_FRGZU.
    *    V_LEN2 = STRLEN( T_PUR-EKKO_FRGZU ).
    *    IF V_LEN2 EQ 0.
    *      V_RELPO = 0.
    *    ELSEIF V_LEN2 EQ '1'.
    *      V_RELPO = T_PRDAY-PO_RE1.
    *    ELSEIF V_LEN2 EQ '2'.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2.
    *    ELSEIF V_LEN2 EQ '3'.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2 + T_PRDAY-PO_RE3.
    *    ELSE.
    *      V_RELPO = T_PRDAY-PO_RE1 + T_PRDAY-PO_RE2 +
    *                T_PRDAY-PO_RE3 + T_PRDAY-PO_RE4.
    *    ENDIF.
    CHECK = ' '.                                                 "DEVK951017
    IF NOT ( T_PUR-EKKO_EBELN IS INITIAL ) AND                   "DEVK951017
       T_PUR-ANFNR IS INITIAL AND T_PUR-KNTTP = 'P'.
       PERFORM CHECK_RFQ.                                        "DEVK951017
    **   IF CHECK = 'X'.
    **      V_STADAY = T_PRDAY-PR_CRT + V_RELPR + T_PRDAY-PO_CRT +
    *"DEVK951017
    **      V_RELPO + T_PRDAY-PO_PRN + T_PRDAY-GRN_CRT.
    **   ENDIF.
    *ELSE.
    **--> Standard Days
    *    V_STADAY = T_PRDAY-PR_CRT + V_RELPR + T_PRDAY-RFQ_CRT +
    *               T_PRDAY-RFQ_MAN + T_PRDAY-PO_CRT +
    *               V_RELPO + T_PRDAY-PO_PRN + T_PRDAY-GRN_CRT.
    **              + t_prday-pay_crt + t_prday-inv_crt.
    "DEVK951017
    *ENDIF.
      ENDIF.                                                     "DEVK951017
    ENDFORM.                    " GET_STAND_DAY
    *&      Form  GET_ACT_DAY
    FORM GET_ACT_DAY.
    DATA: V_CPUDT LIKE SY-DATUM.
    *  IF T_PUR-CPUDT IS INITIAL OR T_PUR-BADAT IS INITIAL.
    *    V_ACTDAY = '0'.
    *  ELSE.
    *    V_ACTDAY = T_PUR-CPUDT - T_PUR-BADAT.
    *  ENDIF.
      V_CPUDT = SY-DATUM.
      IF T_PUR-CPUDT IS INITIAL.
    *   v_actday = v_cpudt - t_pur-badat.                        "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-BADAT V_CPUDT V_ACTDAY.
      ELSEIF T_PUR-BADAT IS INITIAL.
        V_ACTDAY = '0'.
      ELSE.
    *   v_actday = t_pur-cpudt - t_pur-badat.                    "DEVK951017
    PERFORM CALC_ACT_WORKDAY                                     "DEVK951017
            USING T_PUR-BADAT T_PUR-CPUDT V_ACTDAY.
      ENDIF.
    ENDFORM.                    " GET_ACT_DAY
    *&      Form  GET_VAR_DAY
    FORM GET_VAR_DAY.
    DATA: V_TEMP2(8).
      V_TEMP2 = V_STADAY - V_ACTDAY.
      PERFORM CONVERT_NEG_TO_BRACKET USING V_TEMP2
                                     CHANGING V_VARDAY.
    ENDFORM.                    " GET_VAR_DAY
    *&      Form  CONVERT_NEG_TO_BRACKET
    FORM CONVERT_NEG_TO_BRACKET USING    P_V_TEMP
                                CHANGING P_V_DAY.
      SEARCH P_V_TEMP FOR '-'.
      IF SY-SUBRC = 0.
        SHIFT P_V_TEMP RIGHT BY 1 PLACES.
        SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.
        CONCATENATE '(' P_V_TEMP ')' INTO P_V_DAY.
      ELSE.
        SHIFT P_V_TEMP LEFT DELETING LEADING SPACE.
        MOVE P_V_TEMP TO P_V_DAY.
      ENDIF.
    ENDFORM.                    " CONVERT_NEG_TO_BRACKET
    *&      Form  CALC_ACT_WORKDAY                            -DEVK951017
    *      -->lowdt  -Low Date                                             *
    *      -->Highdt -High Date                                            *
    *      -->days   -Total Days                                           *
    FORM CALC_ACT_WORKDAY USING LOWDT HIGHDT DAYS.
      DATA: DAT LIKE SY-DATUM.
      DAYS = 0.
      DAT = LOWDT.
      DO.
    CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
         EXPORTING
              DATE                       = DAT
              FACTORY_CALENDAR_ID        = 'MY'
              MESSAGE_TYPE               = 'I'
         EXCEPTIONS
              DATE_AFTER_RANGE           = 1
              DATE_BEFORE_RANGE          = 2
              DATE_INVALID               = 3
              DATE_NO_WORKINGDAY         = 4
              FACTORY_CALENDAR_NOT_FOUND = 5
              MESSAGE_TYPE_INVALID       = 6
              OTHERS                     = 7.
        IF SY-SUBRC = 0.
          DAYS = DAYS + 1.
        ENDIF.
        DAT = DAT + 1.
        IF DAT GE HIGHDT.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " CALC_ACT_WORKDAY
    *&      Form  CHECK_RFQ
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM CHECK_RFQ.
    DATA: KONNR LIKE EKPO-KONNR,
          AEDAT LIKE EKKO-AEDAT.
    SELECT SINGLE P~KONNR K~AEDAT INTO (KONNR, AEDAT)
    FROM EKPO AS P INNER JOIN EKKO AS K
    ON P~EBELN = K~EBELN WHERE P~EBELN = T_PUR-EKKO_EBELN
    AND P~EBELP = T_PUR-EKPO_EBELP AND K~BSTYP = 'K'
    AND P~KONNR = K~KONNR.
    IF SY-SUBRC = 0.
    IF AEDAT < T_PUR-BADAT.
      CHECK = 'X'.
    ENDIF.
    ENDIF.
    ENDFORM.                    " CHECK_RFQ
    By the way, it's my first time trying to modify other people's codes, is there a proper way to do this. I find it more difficult to modify people's code than to write my own. Perhaps you guys could give me some advice, so i'll know what to do when i'm assigned to do it again next time?

    Even though you think AT NEW will work on just the field that you mentioned, it is not. Your field BSART is about 6th or 7th field in your internal table. So any change in any of the field values before BSART will trigger this AT NEW BSART code.
    You have to declare your own variables to keep track of the current value of BSART and previous value of the same. Also, remember that it may not have been sorted by BSART. So your logic may not work and if you change the sort, then your previous AT NEW may not work. So be sure of what you want to do there.
    Srinivas

  • How to allow user to enter a string including one quotation mark

    I'm not sure anyone here has talked it before.
    I'm quite confused, and hope someone could help me.
    I have a SQL script which has a field for user entering some comments in command-line.
    Whenever I tried to enter something like " it's not bad" in a statement like:
    select '&&COMMENTS' from dual;
    I got an error message like:
    select upper('it's not bad') from dual)
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    I've tried some other ways such as using INSTR first, but all failed. :(
    Could anyone please give me some suggestion?
    Thanks a lot.

    Thank you for your response.
    It is the good way.
    But I'm afraid that I didn't talk about it clearly.
    I just wonder if there is a way for the user to enter the quotation only once, then I write some codes for the procession.
    Otherwise I've got to keep reminding them to enter it twice. :(

  • Firefox Health Report Vital Stats shows bookmarks 14, but Raw Data shows bookmarks 7917. How can I make Firefox Health Report Vital Stats show bookmarks 7917?

    All data in the about:healthreport Firefox Health Report page is accurate except for the persistently inaccurate bookmarks count in the Vital Stats section of the page, which counts only 14 bookmarks and fails to count the other 7903 bookmarks.
    The about:healthreport Firefox Health Report Vital Stats section shows bookmarks 14.
    The about:healthreport Firefox Health Report Raw Data page shows bookmarks 7917.
    The Firefox/Bookmarks/Show All Bookmarks/Library window shows 7910 items.
    How can I make the about:healthreport Firefox Health Report Vital Stats section correctly and accurately show "bookmarks 7917" instead of incorrectly and erroneously showing "bookmarks 14"?
    Platform: FF 36.0.4, Mac OS X 10.8.5
    Platform: FF 31.5.2 ESR, Mac OS X 10.8.5
    The following steps reveal the issue:
    (1) In the Firefox Navigation Bar, type "about:healthreport" (without the quotation marks) to open the Firefox Health Report page.
    (2) On the left side of the Firefox Health Report page, in the Vital Stats section, the following data appears: bookmarks 14. This is false data because the browser actually has 7917 bookmarks, not 14 bookmarks. All other data in the Firefox Health Report page is accurate.
    (3) In the Firefox Health Report page, click the Raw Data link to reveal all Raw Data.
    (4) Page Down approximately 10 pages to the following specific Raw Data:
    "2015-03-22": {
    "org.mozilla.addons.counts": {
    "_v": 2,
    "extension": 28,
    "plugin": 6,
    "theme": 1
    "org.mozilla.healthreport.submissions": {
    "_v": 2,
    "continuationUploadAttempt": 1,
    "firstDocumentUploadAttempt": 1,
    "uploadSuccess": 1,
    "uploadTransportFailure": 1
    "org.mozilla.places.places": {
    "_v": 1,
    "bookmarks": 7917,
    "pages": 4293
    5) The preceding Raw Data correctly indicates the following data: "bookmarks": 7917,
    6) Open the Firefox/Bookmarks/Show All Bookmarks/Library window.
    7) In the Library window sidebar, select the entry "All Bookmarks".
    8) In the Library window Search Bookmarks search bar, type the colon punctuation mark " : " (without the quotation marks) to reveal the entire list of all items (bookmarks) in the Library window.
    9) In the Library window, select any one of the items (bookmarks) in the list of items.
    10) Press the <command> <A> keys to select and highlight automatically all items in the items (bookmarks) list, and Firefox automatically will begin the process of counting all items (bookmarks) in the items list.
    11) After a counting interval of several seconds, the count of the total number of items (bookmarks) that are present in the items list appears near the bottom-center of the Library window: 7910 items.
    12) I installed the "Places Maintenance" add-on, selected the "All" preference, and executed the add-on, but it did not correct the issue.
    13) The about:healthreport Firefox Health Report Vital Stats section counts only 14 bookmarks and fails to count the remaining 7903 bookmarks.
    Note --
    On the support.mozilla.org/en-US/questions site, after selecting ASK A QUESTION and writing this question, I attempted to upload image files with the question, but I am unable to upload a JPG (97 KB) image file or a PNG (307 KB) image file because the "Add Images Browse" function appears to be broken.
    Each time I click the "Add images: Browse" button, select one of the image files, and click "Open" to upload the image file, a spinning gear appears in a square beneath "Uploaded images:", and the spinning gear continues to spin without stopping. The image file does not upload.
    While the gear is spinning, the message "Uploading <filename>.jpg" or "Uploading <filename>.png" remains constantly visible beneath the square that contains the spinning gear.
    I think the gear would have continued to spin for eternity if I had not reloaded the page after the gear had been spinning for a full 7 minutes.
    The image files would not upload.

    It could be the work of one of your add-ons.
    Type '''about:addons'''<enter> in the address bar to open your Add-ons Manager.
    Hot key; '''<Control>''(Mac:<Command>)''<Shift> A)'''
    In the Add-ons Manager, on the left, select '''Extensions.'''
    Disable a few add-ons, then '''Restart Firefox.'''
    Some added toolbar and anti-virus add-ons are known to cause
    Firefox issues. '''Disable All of them.'''
    If the problem continues, disable some more (restarting FF). Continue until
    the problem is gone. After, you know what group is causing the issue.
    Re-enable the last group '''ONE AT A TIME''' (restarting FF) until the problem returns.
    Once you think you found the problem, disable that and re-enable all the
    others, then restart again. Let us know who the suspect is detective.

Maybe you are looking for