How to Determine Quarter based on Fiscal Posting Period

Hi All,
Could you please help me on this issue.
I have a select option SO_PRD FOR S630-SPBUP. I know the logic to determine the fiscal period by using the FM DATE_TO_PERIOD_CONVERT.
Now I will fetch the data from following tables EINE, EINA,S630, T009, A017,  EQUP.
After the fetching my internal tables will be having data on of them is PRICE. Now I want to display the price for each period which I can do easily.  But there is another requirement where I need to calculate the average price for the quarter. For example if I enter 01/2009 to 02/2009. This belongs to 1st quarter and I need to fetch all the data from table based on the periods entered in the selection screen. SO I got the values for 01 & 02. But during quarter price it should also include 03/2009. Is there any FM available to determine the quarter periods based on the fiscal epriod. I do not want to do hard coding for this and system should automatically determine the quarters based on the dates entered in the selection screen.
Thanks & Regards,
Nagaraj Kalbavi

Hi ,
Check this FM
TSTR_PERIODS_QUARTERS
Regards,
Pankaj

Similar Messages

  • How to restrict S_ALR_87003642 - Open and Close Posting Periods entry/updat

    How to restrict S_ALR_87003642 - Open and Close Posting Periods entry/update for certain group of users
    eg. for Subsidiaries to openr/close periods of their own company only.
    Refer to my screen, Company 1010 and 1060 is for Head Office while 1210 is for our Malaysia Company. How to restrict my Malaysia Company user to open and close only for 1210 and cannot perform any change to other Company.

    Hi,
    I guess you can use company code itself. Talk to your basis guy or else if you have some expertise & Authorization try out PFCG.
    Regards
    Santosh Hegde

  • How to determine the contract header's valid period...

    1. How to determine the service contract header's start date, end date, when related muliple items with different start date and end date?
    i.e., what is the different between the header's valid period and item valid period?
    For example:
    Sold to A has 5 items, which has different contract line item start date and end date, e.g.,
    item 2: 2010.9-2011.9
    item 3: 2011.4-2012.4
    As for combined the all item bolonged to sold to A to one contract, so the item should have different contract start date and end date.
    However, how to determine the contract header's start date and end date?
    2. Another question is: When process service contract data migration from legance to CRM, how to design the above scenario logic?
    Thanks in advance,

    Sent again, to wait the answer....

  • How to know technically if an FI posting period is open?

    Hello, i need to know through code if an FI posting period is open?

    Use this FM.
    FI_PERIOD_CHECK.
    You can also get the same from OB52 transaction and T001B table.

  • How to determine output based on the content of purchase order

    Hi Gurus,
    I've a typical requirement at my present project. With vendor X we have punchout catalogs. while creation of shopping cart, we are not allowing the user to mix catalog items and non catalog items into the same shopping cart. Once the shopping cart all shopping carts are automatically coverted into PO.
    Now the challenge we are facing is, if the PO is created based on items from catalog, we want to send such PO via XML interface to the vendor. If the PO is created based of items which are free-form, we want to send such PO via Smartform email attachment.
    As this condition can only be determined at runtime, I'm finding a challenge to configure this. In both PO cases, vendor is same but the content of the PO is different. One contains all items that are catalog based and other contains items which are non catalog.
    Can someone help me find solution for this issue.
    Regards,
    Sam K

    Change Forms for Document Output
    You can use the Business Add-In BBP_OUTPUT_CHANGE_SF to override the Smart Forms that are defined in the activity Define Actions for Document Output.
    This BAdI serves as an alternative to the IMG activity Condition-Dependent Document Output.
    Note that no Smart Forms are used for output via XML.
    Standard settings
    The following parameters are available in the method CHANGE_FORMS. Depending on the input parameters, you can define other Smart Forms to output the document type.
    Importing
    IV_GUID
    Globally Unique Identifier of the document.
    IV_MEDIUM
    Output medium found for this document according to Define Actions for Document Output (print: PRN, fax: FAX, e-mail: MAI, XML: MET).
    IS_PARTNER
    Business partner to whom the document is sent.
    IV_OBJECT_TYPE
    Business transaction type.
    Changing
    CV_SMARTFORM
    Smart Form used to output the document.
    E-mail output
    Smart Form with which the document is added to the e-mail in the form of a PDF attachment.
    Note:
    Note that the BAdI with this parameter overrides the parameter form name (technical name of the Smart Form BBP_PO for example) irrespective of the defined determination technology (SRM: Purchase Order Output Determination, for example).
    CV_SMARTFORM_MAIL
    Smart Form used to define content and layout of the e-mail text in the case of e-mail output.
    CV_SUBJECT_MAIL
    Smart Form that determines the text in the (short description of the e-mail content).
    As an alternative to this BAdI, you can control document output via determination technology.
    For more information, see Condition-Dependent Document Output.
    EXPLORE THIS badi

  • How to Determine Length of variable up to period (.)

    I have  a variable called my_var  in an ABAP and it is passed many #’s  and they may or may not have some text following these #’s --- these #’s can have a  Length of up to 13 and will always have 3 Decimal Places.  I need to find a way to return the length of the # up to the decimal place.
    The # is always first in this variable, it will always have a .000 and it may or may not have text following it.  The only way I can think of doing this is to
    loop through the my_var one character at a time to find the decimal place and to determine the length.    Does anyone have any other ideas?
    Examples:
    my_var = “22.000 ABC”  would return the length of 2
    my_var = “0.000            this is more text” would return the length of 1
    my_var = “1200000.00”  would return the length of 7
    my_var = 87098.000” would return a length of 5
    my_var = “987.000    this is text again” would return a lenth of 3
    Message was edited by: Manish Kumar : Basic programming. Answer can be easily found by searching. Thread locked.

    Hi ,
    try this
    data : var1 type char20 value '222.000ABC'.
    data : part1 type char10,
            part2 type char10.
    data : lv_int type i.
    split var1 at '.' into part1 part2.
    lv_int = strlen( part1 ).
    write : 'length of Interger Before decimal',lv_int.
    Regards
    pavan

  • 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report

    Hi I need a quick help, please resolve my issue in step by step. Report is required to display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report. I have a 0fiscper Fiscal Yr / Period in my datasource and infosource but not 0fiscper3 (posting period)and 0fiscyear (fiscal year). Can any body help me how to add the abap code to convert the 0fiscper Fiscal Yr / Period to display 0fiscper3 (posting period)and 0fiscyear (fiscal year in report or how to add by abap code 0fiscper3 (posting period)and 0fiscyear (fiscal year)in datasource. User will select the value of 0FISCYEAR
    Fiscal year during the execution of report. please help
    will reward all points.
    thanks
    soniya kapoor

    In de update rules from infosource to datatarget you fill the rules like this:
    For 0FISCYEAR:
      result = comm_structure-fiscper(4).
    For 0FISPER3
      result = comm_structure-fiscper+4(3).
    Note that this can also be done by using formula's. If you can't ABAP you may prefer to use formula's.

  • Display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw re

    Hi I need a quick help, please resolve my issue in step by step. Report is required to display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report. I have a  0fiscper Fiscal Yr / Period in my datasource and infosource but not 0fiscper3 (posting period)and 0fiscyear (fiscal year). Can any body help me how to add the abap code to convert the 0fiscper Fiscal Yr / Period to display 0fiscper3 (posting period)and 0fiscyear (fiscal year in report or how to add by abap code 0fiscper3 (posting period)and 0fiscyear (fiscal year)in datasource. User will select the value of 0FISCYEAR
    Fiscal year during the execution of report. please help
    will reward all points.
    thanks
    soniya kapoor

    Hi Soniya,
    Y don't you enhance ur datasource with these fields?
    Anyways the workaround could be add 0FISCPER3 and 0FISCYEAR in ur data target, and write ABAP code for it in transformation.
    Map 0FISCPER with both the fields, and now click rule type of both the fields independently.  Select rule type as routine.
    0FISCPER stores data in format YYYYPPP, so you have to write code accordingly.
    Likie in 0FISCPER3 assign last 3 digits of 0FISCPER to 0FISCPER3 and first 4 to 0FISCYEAR.
    Suppose u have pne temp variable with name fis_yp which stores value of 0FISCYEAR. For getting period from it you have to write:
    period = fis_yp+4(3), ( 3 characters from 4 place)
    and similarly for year,
    year = fis_yp+0(4),  ( 4 charaters from 0 place)
    I hope now u can write code for it easily?
    KJ!!!

  • 0fiscper Fiscal Yr / P required to be converted to 0fiscper3 posting period

    Hi I need a quick help, please resolve my issue in step by step. Report is required to display the 0 fiscper3 (posting period)and 0fiscyear (fiscal year) in bw report. I have a  0fiscper Fiscal Yr / Period in my datasource and infosource but not 0fiscper3 (posting period)and 0fiscyear (fiscal year). Can any body help me how to add the abap code to convert the 0fiscper Fiscal Yr / Period to display 0fiscper3 (posting period)and 0fiscyear (fiscal year in report or how to add by abap code 0fiscper3 (posting period)and 0fiscyear (fiscal year)in datasource. User will select the value of 0FISCYEAR
    Fiscal year during the execution of report. please help
    will reward all points.
    thanks
    soniya kapoor

    In de update rules from infosource to datatarget you fill the rules like this:
    For 0FISCYEAR:
      result = comm_structure-fiscper(4).
    For 0FISPER3
      result = comm_structure-fiscper+4(3).
    Note that this can also be done by using formula's. If you can't ABAP you may prefer to use formula's.

  • Open and Close Posting Periods According to G/L Account Assignment Objects

    Hi,
    Can anybody please explain me how configurations related to " Open and Close Posting Periods According to G/L Account Assignment Objects " works in SAP FICO? I am confused about this config.
    Regards,
    Mandeep

    Hi Mandeep ,
    First i would like to tell about fiscal year
    fiscal year is nothing but a financial year of company in sap . it contain 12 normal periods and 4 special periods.In genaral we will call like month but that is sap that is a period. so 12 period for 12 months ok next special period will use in all companies for audit and tax adjustment purpose of previous year.
    coming to the open and close periods.in sap for security purpose we have to open one period like this month july so i opened july period only we cant post the pervious month (june)and we cant post future month lik in (Auguest)ok
    You can close and open periods by transaction ob52.
    In transaction ob52 there are account types
    + Valid for all account types
    A Assets
    D Customers
    K Vendors
    M Materials
    S G/L accounts
    V Contract accounts
    + means all types. if you want to open vendor then enter period from and to according to your fiscal year.
    you cant adjust items in closed period. if you want to then you have to open the period
    For your information.....
    posting periods also open user level tc S_ALR_87003642.
    customization levael OB52.
    Regards
    Kumar

  • Custom exit variable for fiscal year/period

    Hi BI Experts
    1) In one of the column i just want Budget data to be displayed for the entire year..i.e even if the user enters 005/2006 for fiscal year /period that column should display 001/2006 to 012/2006 Budget.
    I have created a restricted KF for 0AMOUNT restricted by version(for Budget), valuetype (for Budget )
    now how do I assign variable for Fiscal year/period...and the problem is posting period is not populated ...I mean there is no transformation for that...
    Can you share your experience on that ...full points wil be awarded...
    Thanks

    Hi Ajay and Pradhiba
    I am really sorry for assigning you guuys points ...wasa bit busy ...
    The problem is that the year and posting period is not populated...there fore I cannot use those time characteristics...
    Now I have only fiscal year/period populated..now i want
    if the user enters 005/2006 ....i want my first column to calculate the data for 001/2006 to 012/2006 ...thats the req...
    can u share ur ABAP experience in that...
    thanks

  • Wish to include Posting Periods rather than hard coded Dates

    Hi Guys,
    I have this query that I would like to have it look for the financial year based on the posting periods rather than hard code in the year - i.e 2011. The reason being that the financial year is from 1st October to 30th September, so my query below will not give me accurate information when going from December to January as the Year is Hard Coded in currently.
    Does anyone have any ideas how I can achieve this, I must admit to be totaly stuck.
    Kind regards
    Sean
    SELECT P.CardCode,P.CardName,
    (SELECT SUM(Debit) - sum(Credit) FROM JDT1 WHERE ShortName= P.CardCode AND Year(DueDate) = 2011 AND TransType IN ('13','14')) '2011 Sales',
    [1] as 'January',
    [2] as 'February',
    [3] as 'March',
    [4] as 'April',
    [5] as 'May',
    [6] as 'June',
    [7] as 'July',
    [8] as 'August',
    [9] as 'September',
    [10] as 'October',
    [11] as 'November',
    [12] as 'December'
    FROM (SELECT T0.CARDCODE, T0.CARDNAME, (T1.Debit - T1.Credit) AS BAL,
    MONTH(T1.Duedate) as month
    FROM dbo.OCRD T0
    LEFT JOIN dbo.JDT1 T1 ON T1.ShortName = T0.CardCode AND Year(T1.Duedate) = 2011 AND T1.TransType in ('13','14')) S
    PIVOT (SUM(S.BAL) FOR month IN
    ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P

    Hi Sean,
    Even though it is possible to use variable for the report, I would suggest hard coded like this because you have different financial year with calendar year:
    SELECT P.CardCode,P.CardName,
    (SELECT SUM(Debit) - sum(Credit) FROM JDT1 WHERE ShortName= P.CardCode AND DueDate>= '10/01/2010' AND DueDate<= '09/30/2011' AND TransType IN ('13','14')) '2011 Sales',
    [10] as '10-10',
    [11] as '10-11',
    [12] as '10-12',
    [1] as 'January',
    [2] as 'February',
    [3] as 'March',
    [4] as 'April',
    [5] as 'May',
    [6] as 'June',
    [7] as 'July',
    [8] as 'August',
    [9] as 'September'
    FROM (SELECT T0.CARDCODE, T0.CARDNAME, (T1.Debit - T1.Credit) AS BAL,
    MONTH(T1.Duedate) as month
    FROM dbo.OCRD T0
    LEFT JOIN dbo.JDT1 T1 ON T1.ShortName = T0.CardCode AND T1.DueDate>= '10/01/2010' AND T1.DueDate<= '09/30/2011'  AND T1.TransType in ('13','14')) S
    PIVOT (SUM(S.BAL) FOR month IN
    ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
    Thanks,
    Gordon

  • SAP 2007 posting period problem

    Hi , Ask for help please.
    I am trying to add the invoice into system for the customers who have 60 days terms, which leads the due date falls into 2010, however the system pops out error says: invoice is not allowed cause not permission date. Just wonder why, and how can I fix it? The posting period has been set up correctly and have year 2010 . thanks

    Hi ,
    I think you need to extend the due date upto 2010 , since you are in 2009 . Then you should be able to create your document .
    Go to current posting period and extend the due date .
    Hope this helps
    Bishal

  • Posting periods and account segmentation

    the company has several suboffice/division, but they want all under one company in B1. also they receive some of they invoices 2 months lates. Data migration will go back 2 years. So what is best way to set up posting period and account segmentation.

    Hello,
    Take a look at this thread and copied to your notepad :
    Division in SAP Business One
    about how to create suboffice/division.
    The posting period can be created go back more than 1 years from now as long when performing data migration, do not forget to set the current period that match with your data dates. The invoices and other opening balances can be migrated using DTW templates.
    So, I suggest you could create posting period more than 2 years ago in the last time and create 2 segmented accounts consists of sub office and division beside natural account. E.g. :
    12111-01-02 : 12111 is natural account, 01 is suboffice code and 02 is division.
    Rgds,

  • Using Fiscal/Year Period to get last year all months data

    Hi,
    Had a requirement to get Last Years 1-12 months data based on Fiscal/Year Period. So here i am using Fiscal/Year period as my input. Please let me know with code.
    Regards,
    Vishnu

    Hi ,
    Where you want to write code ?
    Well the basic logic will be like :
    TYPES: BEGIN OF ty_range,
    sign TYPE c LENGTH 1,
    option TYPE c LENGTH 2,
    low TYPE c LENGTH 8,
    high TYPE c LENGTH 8,
    END OF ty_range.
    DATA : t_range TYPE TABLE OF ty_range,
    w_range LIKE LINE OF t_range.
    DATA :v_lastyear type c length 4  .
    v_lastyear = sy-datum(4) - 1 .
    w_range-sign = 'I'.
    w_range-option = 'EQ'.
    concatenate  v_lastyear '001'  t into w_range-low.
    concatenate  v_lastyear '012'  t into w_range-high.
    APPEND w_range TO t_range.
    ****it will select data from source package for last one year .Internally year and period store like YYYYPPP  (2011001)
    select  SOURCE_PACKAGE WHERE 0fiscper  IN t_range.
    you can modify selection statement as per your requirement .
    hope this will be helpful .
    Regards,
    Jaya Tiwari

Maybe you are looking for

  • Unable to deploy Web App in Exploded format

    Using WLS 6.1 sp2, I am unable to deploy a web application successfully using the web app "ora" from http://www.thejspbook.com/examples.jspbook.zip. I've moved the /ora directory under the /WEB-INF/applications directory. The error I am getting is: j

  • SQL 2000 Authentication Error

    Post Author: triley142 CA Forum: Authentication Relatively knew at this... Using Crystal Report XI Client, I have developed several reports using dynamic parameters. I develop them logged in to a workstation running Windows XP as a domain admin on a

  • To merge data in 1 internal table

    Hi Abap gurus, I have some probolem during merging data in internal table . I have four inernal tables and I want to merge data in one final internlal table. Is there any way of doing that without using nested loop ? It is urgent .

  • Can anybody out there help shed some light on why no audio output using varispeed tempo only

    Can anybody out there help shed some light on why no audio output using varispeed tempo only? I am using Logic Pro 9 and finding no problems using the tempo and pitch option but when I just want to vari the tempo only I loose all output. This include

  • Flickering after 10.10.3 upgrade

    I use a Mac Mini with two Apple Thunderbolt Displays. After the 10.10.3 upgrade suddenly some random coloured bars started to appear in various random points on one of the two displays. Moving the window where the flickering appears or moving another