Show SQL issue on Posting Date and Aging Date

Hi Folks,
When I am running a report >>> the report pops up with the some parmeters >>
In my scenario u201CAging Dateu201D forumla is calculated as the last day of the every month.
if month (currentdate) = 1 then date((year(CurrentDate)-1),12,31) else
date(year(currentdate),month(CurrentDate),1)-1
Example : if 9( 23 sep 2010 ) = 1 then date ((2010(23 Sep 2010)-1),12,31) else date(2010(23 sep 2010),9( 23 Sep 2010),1)-1.
Issues :
For some reports the Aging Date parameter is poping up but for some of the reports the Aging Date forumla is calculating in the behind based on the u201CPost Dateu201D.
Here is my Record Selection :
(not isnull({CLARITY_TDL.SERV_AREA_ID}) and {CLARITY_TDL.SERV_AREA_ID}
in {?Service Area} or 0 in {?Service Area}) and
(not isnull({CLARITY_DEP.SPECIALTY}) and {CLARITY_DEP.SPECIALTY} in {?Specialty} or {?Specialty} =
"Specialty(s)" or {?Specialty} = "NONE") and
(not isnull({CLARITY_TDL.PERFORMING_PROV_ID}) and {CLARITY_TDL.PERFORMING_PROV_ID} in {?Service Provider} or
{?Service Provider} = "Provider(s)" or {?Service Provider} = "NONE") and
{CLARITY_TDL.POST_DATE} = {@Aging Date}and
[color=darkred]{CLARITY_TDL.DETAIL_TYPE} in [60, 61] and
{CL_EMP_CLARITY.USER_ID} = CurrentCEUserName
Moreover when I check Show SQL for the where clause
CLARITY_TDL"."SERV_AREA_ID" IS NOT NULL AND "CLARITY_TDL"."SERV_AREA_ID"=10 AND "CLARITY_TDL"."POST_DATE">={ts '2010-08-31 00:00:00'} AND "CLARITY_TDL"."POST_DATE"<{ts '2010-09-01 00:00:00'})
AND ("CLARITY_TDL"."DETAIL_TYPE"=60 OR "CLARITY_TDL"."DETAIL_TYPE"=61) AND "CL_EMP_CLARITY"."USER_ID"=''
I donu2019t know why the post date is going in between the date/time ranges. I am scrating my head to understand the things to work. Please help me out.

Not sure what you are trying to do here
(not isnull({CLARITY_TDL.SERV_AREA_ID}) and {CLARITY_TDL.SERV_AREA_ID}
in {?Service Area} or 0 in {?Service Area}) and
(not isnull({CLARITY_DEP.SPECIALTY}) and {CLARITY_DEP.SPECIALTY} in {?Specialty} or {?Specialty} =
"Specialty(s)" or {?Specialty} = "NONE") and
(not isnull({CLARITY_TDL.PERFORMING_PROV_ID}) and {CLARITY_TDL.PERFORMING_PROV_ID} in {?Service Provider} or
{?Service Provider} = "Provider(s)" or {?Service Provider} = "NONE") and
Probably better to right these on these lines
(If {?Service Area} not equals 0 then not isnull({CLARITY_TDL.SERV_AREA_ID}) and {CLARITY_TDL.SERV_AREA_ID}
in {?Service Area}  else true) and
NB Typed not equals as symbols disappear
This means nothing in SQL and will cause whole clause to be evaluated locally and not on database
or {?Specialty} =
"Specialty(s)" or {?Specialty} = "NONE")
I am not sure what you are trying to do so can not offer an alternative.
Ian

Similar Messages

  • Issue regarding posting period and due date and document date

    Dear Sir,
    when i am creating sales order/purchase order and in posting date /delivery date/document date 
    how it is allowing me to add the marketing document of date before 3 months. i have checked the box on document setting
    block allow posting date.
    please help me how to block the before and after posting date
    thanks
    Aditee

    Hi,
    I don't have $38.10.number in my query. Where did you get this field?
    please follow below steps:
    1. Run above query in generator. Sure it gives an error message and ignore this message.
    2. save it under query manager
    3. Assign this FMS at AP invoice posting date and set auto refresh when customer vendor refer is changed.
    Thanks & Regards,
    Nagarajan

  • Goods Receipt and Goods Issue - Posting Date and Document Date Problem

    Hi All,
    I was using SDK to build own add on to insert Posting Date and Document Date under Inventory> Inventory Transactions> Goods Receipt and  Inventory> Inventory Transactions> Goods Issue, but the UI Screen Posting Date and Document Date shown current date.
    My SAP Business One version was 2007A SP00 PL42 and alreadly upgrade to SP05.
    End up result still the same.
    Is there someone can help me?
    Thanks you.
    Best Regards,
    danny

    Hi there,
    I already solve it by myself.
    Actually is i call the initialization twice:
    Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry)
    Thats what make this problem happened.
    Sorry.
    Best Regards,
    danny

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)

    Dear Experts,
    i am getting the below error when i was giving * (Star) to view all the items in DB
    [Microsoft][SQL Server Native Client 11.0][SQL Server]The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.  'Items' (OITM) (OITM)
    As i was searching individually it is working fine
    can any one help me how to find this..
    Regards,
    Meghanath.S

    Dear Nithi Anandham,
    i am not having any query while finding all the items in item master data i am giving find mode and in item code i was trying to type *(Star) and enter while typing enter the above issue i was facing..
    Regards,
    Meghanath

  • Invoice verification Invoice date,Posting date and Baseline Date

    Hi Sap Gurus
    Pls Tell Me in detail what Dates should be entered at MIRO transaction,
    Invoice date,Posting date and Baseline Date
    i presumed that the date on the Invoice slip will be Invoice date,
    But in the Invoice the Date is very long back, say a month Older,
    the month of Posting as Posting date, but any posting Date made in MIRO will be Paid after 2 or 3 months so in this case what should be the Posting date.
    at Base line date in the present company Senario the Discount on Vendor payment is literally valid for all the time , say
    In Invoice if the condition is 10% discount if paid in 30 days is given.
    but in actual sense the Vendor is paid 10% less even if he is paid after 4 or 6 months also, so in this case what should be the Entry in Baseline date
    another senario is the vendor has sent only one Invoice for 2 POs how can this be accomadated in SAP
    Pls suggest its Urgent,
    Age may have a Bar, But Points No Bar
    Thanks and Regards
    Sathish

    Hi
    LIV is nothing but You are getting Invoice from the Vendor for your PO   and GR.....and you are checking the Invoice for Price, Qty,Amount etc. by refering the PO  and posting the Invoice...
    Invoice Date : 
               The date of Vendor' Invoice...ie) Date at which the vendor Raised the invoice for his supply against your PO...
    Posting Date :
       The Date at which you actually Verifying Vendor's Invoice and doing the Posting...
    base line date :
        Generally the Posting Date...
    The Imp. of Baseline date is for eg)
    If in the Payment Terms if some conditions are maintained like say
    10% Discount for Payment With in 30 days, if
    PO created on 01.11.2007.
    GR done at 10.11.2007.
    Invoice slip Received at 30.11.2007 but having the Date on it as 20.11.2007...
    So as per your terms you will get 10% Discount if you make the payment on or  20.12.07....
    Here if you keep  inv. Date: 20.11.2007  and Posting Date : 30.11.2007  and Baseline Date as  30.11.2007 ( you cannot maintain baseline date earlier than  Posting date)....even though as per terms the you are  eligible for discount if you make the payment on or before 20.11.2007.....as per the system you are still eligible to get the Discount if you make payment on or 30.12.2007( since you have maintained baseline date as 30.11.2007)...
    this way Baseline date is Importane...
    Generally we use to maintain always Posting Date as Baseline date....
    It is advantageous..
    Reward if useful
    regards
    S.Baskaran

  • Difference between doc date,posting date and invoice date

    hi bw guys
    can someone give a brief on the difference between doc date,posting date and invoice date.and the invidual definitions
    thank you

    Hi,
    Posting Date: Date which is used when entering the document in Financial Accounting or Controlling. The posting date can differ from both the entry date and the doc date.
    Document Date: The document date is the date on which the original document was issued. Ex: Inv date, Bill date etc.,
    Invoice Date : Usually the date when goods are shipped. Payment dates are set relative to the invoice date.
    -Vikram

  • Regarding Goods issue date and order date.

    Hi All,
    Could you please tell me from where we can fetch Goods issue date and Order date.
    Waiting for your reply.

    Preeti,
    Goods issue date/order date of what ?
    Goods can be issued in a number of ways, in reference to many types of documents.  In each case, the GI date and order date are found in different places.
    Please elaborate your request.
    Best Regards,
    DB49

  • Sql query to seperate character and number data in a column

    Hi,
    We have a test table on 10.2.0.4 db as below;
    10:44:34 TEST:WAULT > desc t;
    Name Null? Type
    EMP VARCHAR2(10)
    10:43:18 TEST:WAULT > select * from t;
    EMP
    JOHN
    7281
    TOM
    7852145
    BNPPARIBAS
    9862354
    Mindcraft
    875
    INFINITY
    78998775
    01234
    EMP
    0
    -123
    -856359
    SCOTT
    -657
    16 rows selected.
    The question is; we need to segregate the character data and numerical data in the EMP field, using sql query.
    Plz suggest as to how we can achieve this.
    Also, plz suggest how the use of reqexp can be made in this to achieve the same.
    Thanks,
    Rahul

    >
    Hi,
    EMP
    JOHN
    7281
    TOM
    7852145
    The question is; we need to segregate the character data and numerical data in the EMP field, using sql query.
    Plz suggest as to how we can achieve this.Check out the CAST function
    http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/functions015.htm
    However, I would have to ask why on earth you're doing this - it would, IMHO, be
    much better to redesign your app. It looks like you have an EAV problem
    (AKA MUCK or OTLT) Google Joe Celko and these terms.
    Paul...
    Rahul

  • Post date and due date

    Hi all,
    can any  tell me what you mean by 'posting date' and 'net due date' and' clearing date'?
    what is the difference between them?
    Table is-BSID
    BUDAT-posting date
    ZFBDT-Baseline date for due date calculation
    AUGDT-clearing date.
    thank u
    sunny.

    BUDAT-posting date
    -> to determine the book-period (bkpf-monat)
    ZFBDT-Baseline date for due date calculation
    -> determine date when an obligation becomes due
    due date = zfbdt + bsik-zbd1t (or ZBD2t or ZBD3t)
    AUGDT-clearing date
    -> date when open-item becomes a cleared item
    by payment or reversal or...
    A.

  • Posting Date and Billing Date.

    Hi Experts,
    I am working on an IS-U project at the moment.
    Could anyone please let me know what is the difference between Posting Date and Billing Date?
    Thanks in Advance.
    Regards,
    Chandu.

    Hi,
    <b>Posting Date:</b> The date on which a transaction in SAP will be posted to the appropriate accounts. SAP will default this field to be the current date, but changes are allowed. For items to be posted in a future or past period, you must enter the posting date.
    <b>Billing Date:</b> Billing date from - Date the billing began and Billing Date To - The default is the last date of the current month.
    Hope this helps.
    PB

  • Posting Date, Document Date and Due Date as same

    Hi All
    I would like to make Posing date , Document Date and Due date as same
    The movement i enter Posting date it should automatically carry the same value to Due date and Document date field . How can i make it
    Regards
    Rashid

    Dear Gordon
    Thanks, it is working for Marketing documents,
    I would like to have the same for JE and JV
    Regards
    Rashid

  • MIRO - Posting Date and Document Date

    Dear Gurus,
    I have a query regarding Posting date and Document Date of Invoice Document.
    I want to keep and restrict user to keep Posting Date and Document date same (current date) and want to restrict user from changing posting date, as i want to kep posting date and document date as same. Please suggest if there is any exit or any control i can implement in order to achieve this.
    thanks & regards,
    Prashant Rathore.

    Hi
    You can create a new Screen / transcation variant, in which the posting date and document date will have displau as field status.
    Regards

  • Regarding : Material document data and PO data do not match (Plant)

    Hi Gurus,
    Please go through this BAPI program.
    While uploading it is giving an error ' Material document data and PO data do not match (Plant) '.
    Please help regarding this issue.For all Other moment types it is working fine except this 351 moment type.
    dATA: i_excel TYPE truxs_t_text_data. "work table for excel upload
    DATA: BEGIN OF it_itab OCCURS 100,
          docdate(10),
          postdate(10),
          mvt_type(3), "Movement Type
          plant(4), "Plant
          lgort(4),
          pur_doc(10), "Purchase Document No
          po_item(3), "Purchase Document Item No
          material(18), "Material Number
         delnote(16),
          erfmg(13),
          uom(3),
         lfmng(13), "Quantity
          batch(10) TYPE c,
          vfdat TYPE vfdat,
          END OF it_itab.
    DATA: it_goodsmvt_head TYPE TABLE OF bapi2017_gm_head_01      INITIAL SIZE 100,
          it_goodsmvt_code TYPE TABLE OF bapi2017_gm_code         INITIAL SIZE 100,
          it_goodsmvt_item TYPE TABLE OF bapi2017_gm_item_create  INITIAL SIZE 100.
    DATA: wa_goodsmvt_head LIKE LINE OF it_goodsmvt_head,
          wa_goodsmvt_code LIKE LINE OF it_goodsmvt_code,
          wa_goodsmvt_item LIKE LINE OF it_goodsmvt_item.
    DATA: w_mat_doc  TYPE bapi2017_gm_head_ret-mat_doc,
          w_year     TYPE bapi2017_gm_head_ret-doc_year.
    DATA: BEGIN OF it_errmsg_goodsmvt OCCURS 10.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF it_errmsg_goodsmvt.
    DATA : obj_type LIKE bapiache09-obj_type,
           obj_key  LIKE bapiache09-obj_key,
           obj_sys  LIKE bapiache09-obj_sys.
    DATA: v_date1 TYPE sy-datum.
    DATA: v_date2 TYPE sy-datum.
    DATA: w_lines TYPE i.
    DATA: errflag.
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-100.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    SELECTION-SCREEN END OF BLOCK bk1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    Start-of-selection processing
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = i_excel
          i_filename           = p_file
        TABLES
          i_tab_converted_data = it_itab[]
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT it_itab.
        REFRESH it_goodsmvt_head.
        REFRESH it_goodsmvt_item.
        CONCATENATE it_itab-docdate6(4) it_itab-docdate3(2) it_itab-docdate+0(2) INTO v_date1.
        CONCATENATE it_itab-postdate6(4) it_itab-postdate3(2) it_itab-postdate+0(2) INTO v_date2.
        wa_goodsmvt_head-pstng_date = v_date2.
        wa_goodsmvt_head-doc_date   = v_date1.
       wa_goodsmvt_head-ref_doc_no = it_itab-delnote.
    wa_goodsmvt_head-pr_uname   = sy-uname.
        APPEND wa_goodsmvt_head TO it_goodsmvt_head.
    Maintain it_goodsmvt_code
        wa_goodsmvt_code-gm_code    = '04'.
    Maintain it_goodsmvt_item
    *LOOP AT it_itab.
    IF wa_goodsmvt_item-po_number IS INITIAL.
        wa_goodsmvt_item-po_number    = it_itab-pur_doc.
        wa_goodsmvt_item-move_type    = it_itab-mvt_type.
        wa_goodsmvt_item-MOVE_PLANT      = it_itab-plant.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = it_itab-material
          IMPORTING
            output = it_itab-material.
        wa_goodsmvt_item-material     = it_itab-material.
        wa_goodsmvt_item-stge_loc     = it_itab-lgort.
        wa_goodsmvt_item-po_item      = it_itab-po_item.
        wa_goodsmvt_item-entry_qnt    = it_itab-erfmg.
        wa_goodsmvt_item-ENTRY_UOM_ISO    = it_itab-uom.
       wa_goodsmvt_item-po_pr_qnt    = it_itab-lfmng.
        wa_goodsmvt_item-batch        = it_itab-batch.
        wa_goodsmvt_item-expirydate   = it_itab-vfdat.
       wa_goodsmvt_item-NO_MORE_GR   = 'X'.
        wa_goodsmvt_item-mvt_ind      = 'B'.
        APPEND wa_goodsmvt_item TO it_goodsmvt_item.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header  = wa_goodsmvt_head
            goodsmvt_code    = wa_goodsmvt_code
          IMPORTING
            materialdocument = w_mat_doc
          TABLES
            goodsmvt_item    = it_goodsmvt_item
            return           = it_errmsg_goodsmvt.
    Process of commit work
        IF it_goodsmvt_head[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_head LINES w_lines.
        ENDIF.
        IF it_goodsmvt_item[] IS NOT INITIAL.
          DESCRIBE TABLE it_goodsmvt_item LINES w_lines.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              wait = 'X'.
        IMPORTING
        RETURN        =
          CLEAR errflag.
          READ TABLE it_errmsg_goodsmvt INDEX 1.
          IF it_errmsg_goodsmvt-type EQ 'E'.
            WRITE:/'Error in function', it_errmsg_goodsmvt-message.
            errflag = 'X'.
          ELSE.
            WRITE:/ it_errmsg_goodsmvt-message.
          ENDIF.
          IF errflag IS INITIAL.
            COMMIT WORK AND WAIT.
            IF sy-subrc NE 0.
              WRITE:/ 'Error in updating'.
              EXIT.
            ELSE.
              WRITE:/ 'Material Document created successfully and the Document Number for the Material',
                      wa_goodsmvt_item-material,'is:', w_mat_doc, w_year.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDLOOP.

    Hey,
    Just wanted to post that in my case this was the error of MVT_IND field in item table. When I made it from 'B' to blank then it worked.
    Mine is solved....
    Thanks

  • Req. delivery date and Delivery date should be same in a sales order

    Hi experts,
    We need a customization for getting Requested delivery date, Material Availability date and Delivery date should be same.
    Example if I keep request delivery date as 12/12/2012, system should consider same dates for MAD and Delivery and confirm the requested quantity.
    How to achieve this customization..
    Thanks,
    Bala.

    system should consider same dates for MAD and Delivery and confirm the requested quantity
    What you are going to achieve by this?  Hope you know the concept of MAD and confirmed quantity fields.  Let us assume, if stock is not there for a material for which sale order is created, can you let me know, you want the system still to confirm the quantity? You can post the goods issue only if system confirms the quantity in schedule line which is possible, only if stock is made available.  If client asks something which is not possible in SAP, think in a logical way how SAP works and convince them accordingly. 
    G. Lakshmipathi

  • Modelling Time Dimension with Fact Table containing Start Date and End Date

    Hi Gurus,
    I have a time dimension with Year till Date. I have a fact table which consists of Start Date, End Date, Person ID, Department ID.
    How do i design Time dimension with fact table the below scenario
    In the dashboard i have start Month and End month as prompts.
    In the report i need to display Count(Person ID) > Start Date and < End Date along the trend.
    For instance, i have selected Jan-2009 as start date and Apr-2009 as End Date, then i need to display Count(Person ID) of Jan-2009, Feb2009, Mar-2009 andApr-2009.
    I Can not connect Time dimension with only Start Date or only with End Date to get the trend along the months.
    Please advice on the issue which i am having.

    Hi,
    Thanks for the response, Infact i tried using Complex join in physical layer. I have considered Time table joined with Fact table, and used >= and took and alias of the Time table and joined fact table using <=. When coming to BMM, i am not knowing how do i design this as if i merge the both the time dimensiona and its alias into single table, values will not be correct and if i make them as seperate columns. i can not show the trend as both are different columns.
    Can you please let know where i am going wrong.
    Thanks

Maybe you are looking for

  • Putting Category Counts in a Tool Tip on a Line Chart -SQL Server 2008 R2

    I have a line chart report that shows the total number of tickets processed each month. Within the same recordset is the data of who processed the ticket.  So I want to add in the ToolTip on the Datapoints the number of tickets processed  by each per

  • Filter off all the unwanted org elements from the selection screens

    Hello all, The client does not want to see  SAP predelivered organization elements in the production system. Is there a way to achieve this globally, by some kind of filter applicable to selection screens of all transactions? Just to be clear-  i do

  • Video driver for IBM 300GL?

    Hi, I need to install Solaris 8 on an IBM 300GL. I have tried a few of the S3 and Number Nine drivers (these seem to get PnP'd under NT/2000) with no success. Can anyone suggest a generic driver that should work on the 300GL? Thanks, JB

  • How to make Different Price for same product in one Sale Order

    How can i customizing my system? I need to sale for different price same product A in one sale order. And price condition type cant be manually. i can separate them by position. for ex. in first position: product A is one price and in 2nd product A w

  • Solaris 9 Oracle 9i (Audit Information)

    Hi Guys. Where can I view the audited information. I have set the audit_trail=true. Thanx.