SAP Exit for Current Posting Period

H All,
   I am executing a query and it should always take the Current Fiscal Year & Current period into consideration. I don't see any Standard SAP exit which is provided for this. There is an SAP exit for Fiscal year/Period but I need both of them seperately.   Can anyone please provide a sample code for "Current posting period".
Points will be assigned!
Thanks a lot!

Hi Sia
Here is some cmod code that might help:
These should be run in i-step = 1
DATA: l_period        TYPE t009b-poper,
          l_txt4(4)      TYPE c.
*Variable ZCCCFYEAR that defauts to current Fiscal Year
        WHEN 'ZCCCFYEAR'.
          l_txt4 = syst-datum(4).
          l_period = syst-datum+4(2).
*Handles FiscVarnt, period 6 is end of year so period 7 is new year
          IF l_period > '06'.
            l_txt4 = l_txt4 + 1.
          ENDIF.
          l_s_range-low = l_txt4 .
          l_s_range-high = ''.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
*Variable ZCCPPER that defauts to current Posting Period
Code adds 6 to current year period to be inline with Fiscal Year Variant (ie.per1 = july(7)),
        WHEN 'ZCCPPER'.
          l_period = syst-datum+4(2) + 6.
          IF l_period > 12.
            l_period = l_period - 12.
          ENDIF.
          l_s_range-low = l_period.
          l_s_range-high = ''.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
Hope this helps
Josh

Similar Messages

  • Current Posting Period

    Hello,
    Is there a SAP Exit variable that will return values for Current Posting Period (0FISCPER3)?  I dont see one but there are so many maybe i am overlooking it.  Fiscal year period is not an option for me here.
    Thanks,
    TMS

    HI TMS
    I remember i couldnt find one to suit either so i just wrote a customer exit to handle it.
    Here is some code that may help, call this in i_step 1:
      WHEN 'The tech name of your variable'.
              l_period = syst-datum+4(2) + 6.
    *the +6 is for the fiscal variant, my site runs a july-jun variant, so the ōffset is 6
              IF l_period > 12.
                l_period = l_period - 12.
              ENDIF.
    *this handles the year role over, so if you are running more than 12 periods change to *suit
              l_s_range-low = l_period.
              l_s_range-high = ''.
              l_s_range-sign = 'I'.
              l_s_range-opt = 'EQ'.
              APPEND l_s_range TO e_t_range.
    Hope this helps
    Josh

  • Variant setup for SAP standard report SDRRAV01 for dynamic Posting Period

    Can someone please help with the process for setting up a variant for program SDRRAV01 so that we can get the Posting Period To ( Screen field PPOPER_H : T009B-POPER ) and Posting Year To (screen field name PGJAHR_H : T009B-BDATJ ) fields populate the values dynamically to current posting period and posting year.
    Thank you in advance.

    or else write a small program calling this report and passing the period and year to the selection screen using the submit option.
    hope it helps.
    award points if it helps.

  • Reg: Query Problem for New Posting Period

    Hi Xperts,
    While I try to Map the A/P Invoices with their respective Outgoing Payment,
    I used the following Query and it's Query Printlayout
    SELECT T0.DocNum [Payment#], T0.DocDate [Payment Date],
    T0.CardCode, T0.CardName, T1.InvoiceId, T2.DocNum [AP Inv#],
    T2.NumatCard [Bill No.], T2.DocDate [Bill Date], T1.selfInv,
    T1.SumApplied, T1.WtAppld, T0.NoDocsum 
    FROM  [dbo].[OVPM] T0  INNER  JOIN
    [dbo].[VPM2] T1  ON  T1.[DocNum] = T0.DocNum
    INNER  JOIN [dbo].[OPCH] T2  ON  T2.[DocEntry] = T1.DocEntry
    WHERE T0.Cardname='[%0]' and T0.DocDate='[%1]' and
    T0.DocNum='[%2]'
    I got the above query from our Expert Mr.Sambath only.
    Now what is the problem is the query is retrieving the payment details of old Posting Period only and not the current posting period.
    In detail, I used 'Primary' Series for FY08-09, Period indicator 'Default'
    Now I'm using 'Primary1' Series for FY09-10, Period indicator '0910'
    Thanx in adv.
    Regards,
    Bala

    Hi Bala,
    Looking at your query, it is not query issue ,it is your data issue.
    Please check if you have data in  VPM2  table  which is bank transfer payment method
    Thank you
    Bishal
    Edited by: Bishal Adhikari on Apr 9, 2009 8:48 AM

  • Current Posting Periods

    Hi, there is a way, via DI API, to retrive the Current Posting Periods?
    Thank You
    Best Regards
    Marco Trestini

    Hi Edward,
    I'm having a little Problem
    In my instalaion of the SDK in the Samples Directory the last sample i have is noº 22
    So how can i get noº 23
    Thanks for any help you can provied
    Pedro Gomes

  • Error while running a query-Input for variable 'Posting Period is invalid

    Hi All,
    NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
    I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
    Diagnosis
    Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
    System Response
    Procedure
    Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
    Procedure for System Administration

    OK.
    Well, if the variable is not used in any interval selection, then I would say "something happened to it".
    I would make a copy of the query and run it to check if I get the same problem with period 12.
       -> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
    If so, then try removing the variable completely from the query and hardcode restriction to 12.
       -> If problem still persists, I would have to do some thinking.
    If problem is gone, then add the variable again. Check.
       -> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
    If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
    Good luck!
    Jacob
    P.S: what fisc year variant are you using?
    Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM

  • Error that "specify a value for variable posting period (single value entry

    hi
    My query is running testing fine in RSECADMIN under some username..but when i try and open it using analyzer (under same username) it gives me error that "specify a value for variable posting period (single value entry, mandatry)" it does'nt even asks to enter variable values and gives this error message.
    However the same query appears to be working fine under different username.
    plz advise.

    Hi Abhinav,
    Just do one thing compare the Roles of two different users for which Query is getting executed and not.
    Check the Object S_RFC.
    Compare the Objects detail for Both the Users.
    Please Assign points if useful.
    Regards,
    Rajdeep.

  • Stock Report for selected posting period!

    Dear All,
    Is there any standard program on Stock Report for selected posting period, which shows PRODUCT| UNITS| OPE.STOCK| PURCHASE| SALES| CLO.STOCK|
    I want report on this, anybody can help me out on the same. Or is there any standard report.
    Need urgently.
    Thanks & regards,
    Abhay.

    Hi Abhay
    There is no standard report available as format given by you.
    You have to develop a Z Program for the same. We have also developed
    the same requirement.
    Regards
    Harish

  • Creating Planning Layout for GP12N  - Posting Period as columns/rows

    I am trying to create new layouts for GP12N, but do not know how to create the integrated layout with one column or one row for each Posting Period 1 - 12.  I did read that 'Sets' were not allowed.  Can anyone provide the steps necessary to allow Posting Periods as columns or rows?

    Hi,
       a) Remove period from general data selection.
       b) Create 12 columns of the same Key Figure which use the characteristic period and set it as a fixed value

  • How do we know current posting period?

    How do we know current posting period?

    hi,
    try these FM ->
    <b>CKML_F_POSTING_PERIODS_GET
    HR_HCP_GET_POSTING_PERIODS</b>
    rgds
    anver
    pls mark hlpful answers

  • USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT

    Hi,
    Pls advise any USER EXIT FOR CHANGING POSTING DATE IN THE MATERIAL DOCUMENT.
    Regards,

    Hi,
    There is another user exit for updating material document data Upon posting  is MB_CF001
    I hope this will fullfill you.
    Prem

  • Error when using SAP Exit Variable for Current Fiscal Period (0FPER)

    Hi Friendz,
    My requirement is to execute a query for the current fiscal period. I am using the SAP Exit Variable 0FPER.
    I placed this variable on char. Fiscal year/period 0FISCPER.
    When I execute the Query, it is returning the error: No value could be determined for variable ZVBSYCUR; Variables Contain Invalid Values.
    Please give inputs on how to use this variable.
    Regards...
    Ganesh

    Hello Dipika,
    I am also getting the same error.
    ERROR: Variable 0FPER could not be replaced.
    Yesterday we created one customer exit. But this should not affect the SAP Exit right? Till yesterday the 0FPER variable was working fine. I tried re-installing from BI content, but still getting the same error. If anybody has a clue please let me know.
    Thanks,
    Harshal

  • Custome variable exit for fiscal year/period

    Hello BW Gurus,
    Q1[1,2,3] Q2[4,5,6] Q3[7,8,9] Q4[10,11,12] quarterly periods
    I have a custom variable exit as shown for fiscal year period
           IF LOC_VAR_RANGE-LOW+4(3) =< '003'.
              L_S_RANGE-LOW+4(3) = '001'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '003' AND
                                              LOC_VAR_RANGE-LOW+4(3) =<'006'.
              L_S_RANGE-LOW+4(3) = '004'.
           ELSEIF LOC_VAR_RANGE-LOW+4(3) > '006' AND
                                                LOC_VAR_RANGE-LOW+4(3) =< '009'.
              L_S_RANGE-LOW+4(3) = '007'.
           ELSE.
              L_S_RANGE-LOW+4(3) = '010'.
           ENDIF.
    Now this works fine to give me the Current Quarter ....say if user puts 005/2007 i get the data Current quarter as [4+ 5] i.e. April and MAy data. Now for <b>Previous Period</b> I gave an offset as -3 to -1 inorder to get data for Q1[123] but the requirement is changed and I want the same time period i.e. [1+2] and not the entire quarter since the Current Quarter calculates only for 4 and 5.
    I hope u are getting my point....please give your suggestions will reciprocate with lots of points

    Hi gaurav,
    Basically If I am selecting period 005 I am getting the data for 4 and 5 as Current Quarter i.e. April is the starting period of that Q2.
    Similarly the previous Quarter should also give me data for period 1 and period 2.
    Right now the offset I gave is -3 to -1 on my custom variable so i am getting data for the entire previous quarter which is Q1[1,2,3] but in reality i just want data for period 1and period 2.
    Can you please help me in this
    Appreciate your concern
    Thanks

  • Execution of Task for multiple posting period

    Dear Experts,
    As i have seen it is compulsory to punch posting Period value in Permanent Parametere, Is there any possibility to exeucte Task for multiple period at a time.
    Thanks
    Ritesh M

    Yes, there is such a possibility. But it requires EhP2:
    http://help.sap.com/erp2005_ehp_02/helpdata/en/45/2b650d4ad46d95e10000000a114a6b/frameset.htm

  • User or SAP exit for Batch Status during Transfer Order creation

    Hi All,
    I would like to know if there's an user-exit or a SAP-exit available with which we could evaluate the status of a batch during the creation of a Transfer Order.
    When a production order is created, the system creates automatically a transfer requirement with all the components needed for the production. This TR (Transfer requirement) is then converted into a TO (transfer order) with transaction LT04. Here, we want to control that the status of the batches is not restricted. Otherwise, the user shall not be able to save the TO.
    Thanks in advance, I appreciate your feedback!
    SS

    Exit Name Description
    MWM2S001 Exit to Determine 2-Step Picking Characteristic
    MWMBAP01 Enhancement for BAPI WarehouseTransOrder.GetDetail
    MWMBAP02 Enhancement for BAPI WarehouseStock.GetDetail
    MWMD0001 Transfer order print via RLVSDR40
    MWMD0002 Transfer order print as multiple process with RLKOMM40
    MWMIDI07 Enhancement for Output WMPIHU (Create Pick-HU) Inbound
    MWMIDO11 Enhancement for message WMTORD: TO with several items
    MWMIDO12 Enhancement for Output WMPIHU (Pick-HUs) Outbound
    MWMIDO13 Extension for WMMBXY (subsequent tasks after goods movement)
    MWMPP001 Enhancement WM/PP Interface (automatic TR generation)
    MWMRF001 RF: Influence Display of material description
    MWMRF100 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0100)
    MWMRF101 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0101)
    MWMRF102 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0102)
    MWMRF104 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0104)
    MWMRF105 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0105)
    MWMRF106 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0106)
    MWMRF107 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0107)
    MWMRF108 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0108)
    MWMRF151 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0151)
    MWMRF152 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0152)
    MWMRF153 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0153)
    MWMRF170 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0170)
    MWMRF202 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0202)
    MWMRF203 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0203)
    MWMRF204 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0204)
    MWMRF205 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0205)
    MWMRF212 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0212)
    MWMRF213 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0213)
    MWMRF221 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0221)
    MWMRF302 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0302)
    MWMRF303 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0303)
    MWMRF304 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0304)
    MWMRF305 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0305)
    MWMRF312 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0312)
    MWMRF313 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0313)
    MWMRF321 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0321)
    MWMRF400 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0400)
    MWMRF402 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0402)
    MWMRF403 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0403)
    MWMRF404 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0404)
    MWMRF405 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0405)
    MWMRF406 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0406)
    MWMRF410 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0410)
    MWMRF411 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0411
    MWMRF412 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0412)
    MWMRF502 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0502)
    MWMRF503 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0503)
    MWMRF504 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0504)
    MWMRF505 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0505)
    MWMRF600 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0600)
    MWMRF601 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0601)
    MWMRF630 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0630)
    MWMRF631 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0631)
    MWMRF632 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0632)
    MWMRF633 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0633)
    MWMRF634 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0634)
    MWMRF650 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0650)
    MWMRF651 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0651)
    MWMRF700 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0700)
    MWMRF701 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0701)
    MWMRF702 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0700)
    MWMRF703 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0703)
    MWMRF704 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0704)
    MWMRF705 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0705)
    MWMRF760 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0760)
    MWMRF761 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0761)
    MWMRF762 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0762)
    MWMRF763 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0763)
    MWMRF764 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0764)
    MWMRF765 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0765)
    MWMRF766 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0766)
    MWMRF767 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0767)
    MWMRF768 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0768)
    MWMRF769 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0769)
    MWMRF777 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0777)
    MWMRF800 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0800)
    MWMRF801 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0801)
    MWMRF802 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0802)
    MWMRF803 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0803)
    MWMRF804 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0804)
    MWMRF805 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0805)
    MWMRF806 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0806)
    MWMRF807 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0807)
    MWMRF888 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0888)
    MWMRF889 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0202)
    MWMRF998 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0998)
    MWMRF999 ENHANCEMENT FOR USER SCREENS (LOGICAL SCREEN 0999)
    MWMRFCOD Enhancement for function codedisabling
    MWMRFDLV select delivery by user criteria
    MWMRFPRT Enhancement for printing
    MWMRFSSG user exit for sorting TOs in RF system-guided transaction
    MWMRFUP Customer defined general purpose pushbutton called from scr.
    MWMRP001 Cust. Exit for Fixed Bin Replenish.: Delivery Item Selection
    MWMRP002 Cust. Exit for Fixed Bin Replenishment: TR Quantity Distr.
    MWMRP003 Customer Exit for Replenishment using RLLNACH1
    MWMRP004 User Exit for Replenishment using RLLNACH4
    MWMTO001 Enhancements for end of transfer order generation
    MWMTO010 Exit: Calculation of Total Planned TO Processing Time
    MWMTO011 Correction of Planned Processing Time for TO Item
    Hi,
    MWMTO012 Correction of Sorting and Split Transfer Order
    MWMTO013 Stock Removal for Sev. Storage Types as in Stringent FIFO
    MWMTOAU3 Separate selection of posting changes for autom.TO creation
    MWMTR001 Exits at the end of transfer rqmnt creation (IM,PP interf.)
    No of Exits: 104
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Regards,
    Raj.

Maybe you are looking for

  • Where is autodownload link for JRE Version Build 1.5.0_09-b03?

    http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/autodl-files.html I realize I can put the link in object tag so that user can actually go and download the require JRE from the website. But I am not too sure where is the

  • Submit the form as email attachment

    when i submit the form , i want the form to be as a pdf attachement in my mail rather than the default xml type how to do this?

  • I choose an app and put in the password, it comes onto my IPad2 but quickly disappears????

    When I choose an app and install it i put in my password,  The apple appears on my IPad2 and then quickly disappears.  It will not hold the app on the IPad?? Any suggestions?

  • Unable to open Adobe books

    I have 4 books purchased many many years back and the computer I initially had them on long ago died as a XP machine. I can not access any of the 4 that were purchased and Adobe Digital Editions refuses to open and Acrobat will not open indicating DR

  • HT1688 syncing issues with photos

    I am trying to sync but do not want to sync my photos with my phone. In fact I want to delete all photos from my phone because they are wasting memory. How can I delete photos in the "album" area and how can i sync without it uploading all the photos