Problem in making logic on basis of posting period

Hi,
I am working on a FI report in which i have to display the data of previous 3 months on the basis of posting period. When i am selecting the data for the 2 and 3 month, i am doing it with the help of storing the value in variable. here is the code:-
SELECT BUKRS
             HKONT
             GJAHR
             BELNR
             BUDAT
             MONAT
             SHKZG
             DMBTR
             GSBER
             FROM BSIS INTO TABLE T_TAB1
  WHERE  HKONT IN PHKONT AND GSBER IN PGSBER AND GJAHR LE PGJAHR
             AND MONAT LE P1AND BUKRS EQ PBUKRS.
Here,P1 is the variable where posting period value is stored and the pgjahr is the variable  which stores the data for the fiscal year.
Regards,
Ricky
Edited by: Rob Burbank on Jul 19, 2010 2:52 PM

Well, you don't have to use it on the selection screen, you only need to build the range if they enter the period - it's far cleaner (in my opinion) than trying to combine 3 sets of GJAHR and MONAT (or at least the low and the high as the bounded range) in a SELECT statement.  There are many period-to-date functions available in the system. 
If the period/fy values are entered:
- Calculate the high period ending date range using LAST_DAY_IN_PERIOD_GET
- Determine the low period/FY values
- Calculate the low period beginning date using FIRST_DAY_IN_PERIOD_GET
- Populate a BUDAT typed range variable with the low/high dates
- Use a SELECT statement that includes WHERE ... budat IN GR_BUDAT
In this case, whether or not the period is entered and the BUDAT range is filled, the SELECT statement stays the same.

Similar Messages

  • Problem in making logic for customer balance report

    Hi,
    I am working on a customer balance report in which i am picking the data from BSAD and BSID tables. I am facing a problem that i am able to calculate the opening balance in it but not able to calculate  closing balance. I am comparing the data with tcode FBL5N for opening and closing  balances for a given date range.  Kindly help me out where i am getting wrong:-
    Here the link to the code :-
    http://docs.google.com/View?id=dfxswwff_11fdktr7ct
    Edited by: nav009 on Feb 6, 2010 9:30 AM

    Hi Nikhil,
    Thanks for you response but i had developed the report and  i am able to pick the correct data but i am facing the problem in displaying the NETAMT which is displaying the data using this formula :-
    1.) NETAMT = NETAMT +  W_TAB1-DR + W_TAB1-CR.
    so that the last value matches with the closing balance.
    When i am using this formula i am not able to display the correct data of deducting or addition of the opening balance in it but the value matches with closing balance .
    2.) NETAMT = NETAMT + W_OPBAL-OPBAL +  W_TAB1-DR + W_TAB1-CR.
    When i am using this formula it is showing the first value correctly but not the last one which will be displayed in the closing balance.
    I want to have desired output to display the first value to be displayed as it is showing in the (2) and last value to be displayed as  it is showing in (1) last value.
    How can i achieve this  functionality? i really want to know...
    Edited by: nav009 on Feb 10, 2010 6:29 AM

  • Posting Period text display

    Hi Gurus,
    I have a report where i have my GL account hierarchy on my rows and my key figure in column. i have posting period on top of my key figure and my client wants to display the report as
    jan, feb, mar etc till dec. the problem is when i run it through posting period it shows me 1, 2, 3 ...12 instead of text.
    my key figure is populating value based on user exit and i cannot use other time fields like fiscal year/period. i cannot create 12 restricted key figures as my key figure is getting value from exit variable.
    how do i change the text display for 1,2,3 .....12 to jan, feb, mar....dec. is there any sap exit text variable?
    please help
    thanks
    surya

    i cannot create 12 restricted key figures as my key figure is getting value from exit variable.
    why cannot u create restricted key figures ?
    i didnot understand this....
    second question - are u maintaining texts of 0FISCPER3
    if yes then enter RSD1
    enter 0FISCPER3
    edit it
    go to business explorer tab
    over there display as text only and not key
    this way it iwll display just text
    if u rnot maintaitng texts for it
    u have refer above solutions as mentioned by xperts so that u can load texts for 0FISCPER3
    then follow the busines explorer tab changes i suggested...
    if u can create restricted key figure ur problem will solve  easily..

  • Logical data base for license revenue report.

    Hi All,
    My requirement is to create "license revenue report through SAP Query with following fields:
    VBAK:
    Sales Document,Sales Doc type,net value of sales order in document,sales org,distribution channel,division,sales office,business area,customer purchase order number,customer purchase order date,sold to party.
    VBAP:
    Sales document item,target quantity in sales units,target quantity in UOM,usage indicator,billing block for item,business area,plant(own or external),
    origin of bill of material,net price,SD document currency,material pricing pgroup,account assignment group for this material,activity type,personnel number.
    VEDA:
    contracts start date,contract end date,date on which contract is assigned.,installation date,agreement acceptance date
    VBREVK:
    clearing account for accrued revenues,clearing accountkey(offsetting account),total accrued value,currency key,amount in document currency,posting year and posting period.
    VBREVE:
    revenue amount,currency key,accrual period,company code,country of destination,profit center,posting year and posting period,amount in document currency,gl account,account for deferred revenue,account for non billed receivable
    Is there any  standard logical data base which gives all the required fields mentioned above? since i am not SD consultant i am not sure whether i have to take only above tables exactly or not
    there are certain logical databases like SD_ORDER,SD_SALES_DOCUMENT which has tables VBAK,VBAP,VEDA but i am unable to join remaining tables  VBREVE and VBREVK with those logical data bases
    Please provide some valuable suggestions on this.
    Thanks&Regards

    Hi All,
    My requirement is to create "license revenue report through SAP Query with following fields:
    VBAK:
    Sales Document,Sales Doc type,net value of sales order in document,sales org,distribution channel,division,sales office,business area,customer purchase order number,customer purchase order date,sold to party.
    VBAP:
    Sales document item,target quantity in sales units,target quantity in UOM,usage indicator,billing block for item,business area,plant(own or external),
    origin of bill of material,net price,SD document currency,material pricing pgroup,account assignment group for this material,activity type,personnel number.
    VEDA:
    contracts start date,contract end date,date on which contract is assigned.,installation date,agreement acceptance date
    VBREVK:
    clearing account for accrued revenues,clearing accountkey(offsetting account),total accrued value,currency key,amount in document currency,posting year and posting period.
    VBREVE:
    revenue amount,currency key,accrual period,company code,country of destination,profit center,posting year and posting period,amount in document currency,gl account,account for deferred revenue,account for non billed receivable
    Is there any  standard logical data base which gives all the required fields mentioned above? since i am not SD consultant i am not sure whether i have to take only above tables exactly or not
    there are certain logical databases like SD_ORDER,SD_SALES_DOCUMENT which has tables VBAK,VBAP,VEDA but i am unable to join remaining tables  VBREVE and VBREVK with those logical data bases
    Please provide some valuable suggestions on this.
    Thanks&Regards

  • Problem with making a database link.

    Hello All
    I got a problem with making a database link.
    When I execute this query
    CREATE PUBLIC DATABASE LINK DBNAME
    CONNECT TO database IDENTIFIED BY name
    USING 'DBNAME.europe.company.com';
    I am using other names because its private information
    But when I look at the table dba_db_links I see this
    OWNER | DB_LINK | USERNAME |HOST
    PUBLIC| DBNAME.europe.company.com| name| DBNAME.europe.company.com
    So the DB_Link name is changed. And this causes a problem with my asp website. I get the fault message
    ORA-02085: database link DBNAME.europe.company.com connects to DBNAME
    Cause: a database link connected to a database with a different name. The connection is rejected.
    The global_names = true and I prefer to keep it that way.
    So does anyone knows what is wrong about my Query or how I can change the DB_Link name.
    Thanks for the support,
    Remco

    Thanks for the help Mohit
    But thats whats I was doing.
    The query in the first post is the same as what you are posting.
    But by an (for me) unknown reason the database converts DBNAME to DBNAME.europe.company.com

  • Logical Data Base - ADA

    Hi, people,
    I`m using Logical Data Base ADA in my program to generate some files, but when the program is executed in DEV System the files are generated normaly, but in the PRD system don´t work.
    Someone knows if exist same parameter or why  this problem occurs ?
    Tks for all.
    Flavio

    As ADA is a standard logical database, if you don't change this object, there should be no difference, except Authorizations that may differ between development and production systems , check via [SU53|http://www.sdn.sap.com/irj/scn/advancedsearch?query=su53+#sdn_content_category_value_wiki].
    (In AM "Asset Accounting" class, check authorization objects : A_A_VIEW, A_S_ANLKL, A_S_GSBER, A_S_WERK.)
    Regards,
    Raymond

  • Hiding dynamic selections which is default if Logical Data Bases is  used

    Hi All,
       Am making use of PNP logical data base in my report .On the selection screen there is a default icon with text dynamic selections is visible besides the execute icon.Can please anyone tell me how to hide this,i have gone through the DBPNPSEL include but was not able to find the solution for the same.
       Pointers will be appriciated.
    Regards,
    Zareena.

    Create your own report catogory
    Goto --> Attributes --> Report Catogory
    with all the fields that you require
    That will solve your problem

  • Some problems about making USB boot

    Hi AF!
    I'm having really big problems about making a USB Install Key!
    Its a 256mb (I will only use base) But how should I make the partitions??
    After reading another topic - http://bbs.archlinux.org/viewtopic.php?t=18643
    I still having some problems - Normally I would say the whole USB key should be FAT16 - is that correct or how should I make this ????
    Another part is about making the bootloader ?? Should that be Lilo or should I use the mksysconfig. If I use lilo with /sbin/lilo -M /dev/sda - I get the error upon boot - this is not a bootable floppy or disc??
    And if I use mksyslinux?? - well not sure I'm using the correct command - so how do I use this ???
    Thanks
    Peque

    well its been some time since i did this but if memory serves well
    make sure that in /etc/mkinitrd.conf the USB= "   "  <thats blank  not
    USB=1   
    i believe i told mkinitrd to install all the usb modules i needed even then i had to use initrd-full.img
    also i needed mdadm installed
    i ran lilo on my pen  grub just wouldnt work for me it installed but couldnt find what to boot . lilo would boot up on the machine i installed it on but wouldnt boot on ant other machine never did figure that out , my thoughts went else where at that time & havent  gone back to it yet.
    thats what i remember how much pertains to you i dont know hope this helps

  • Regarding problem while assigning logical system

    Hi Friends,
    I had a problem while assigning logical system to the client where in both of my systems are having same client number which belong to 2 different systems.
    while assigning the sender and receiver logical system to the same client i am facing problem stating that an entry has already been made for the same key.
    could any one plz give me a clear idea...while assigning logical systems (cross clients) for 2 different systems having same client number.
    Regards,
    Madhu

    Hello Madhusree,
    I'm running with same problem. I've created two logical systems and assigned them to two different clients. But here pops up the issue while generating partner profiles, throwing error "No active plan version exists". Later when I researched about the issue, I came to know that T77S0 table doesn't have any entries regarding plan versions. Basically, I created two clients by doing "client copy" from source client (800 & 100). And I could see plan version entries in the T77S0 of client 800. So, I thought of assigning just defined logical system to the source client 800 itself. But it throws error saying "entry already exists"; as client (800) is already assigned with other logical system.
    By coming across your post, gives me leap of hope that two logical systems can be assigned to same client. Could you please share me those troubleshooting steps concerning this issue. Points will be awarded.
    Regards, Anil. 

  • I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me?

    I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me? actually, my computer can't start  since three days ago, could it be the same problem?

    Logic is the APPlication (program, app) that you are having the problem with.
    Logic Pro can take advantage of other computers on your local (home or work) network to help it do "heavy lifting" data chores by using Bonjour and a feature called Nodes.   It seems that Logic is attempting to find and connect to another machine on your network.
    Do you have Logic installed on another computer there?  That may be the source of the confilict.
    You might want to post this question in the Logic Pro Community.
    Be sure to indicate the version of Logic Pro that you are using.  I'm sure the folks there can help you out.

  • What is the MAAssetSharing plug in and why is it making logic crash?

    I keep having crashing problems when I load a new instrument. Then logic blames it on the MAAssetSharing plugin but I can't find it on my computer to delete it. What is it for and why is it making logic crash. Thanks in advance

    I don't know what this plug does, but it is inside the Logic.app package, so deleting it would probably break more than it'll fix. There is a whole series of MA-things inside Logic Pro.
    !http://farm3.static.flickr.com/2607/4022260994_2cbb4f50dc.jpg!
    Does this crashing also happen in newly created projects, or just in one?
    Have you tried refreshing the preferences ? (Quit Logic, move the file com.apple.logic.pro.plist from Users/'you'/Library/Preferences to the Desktop, start Logic and see if the problem's gone. If it didn't help, you can quit Logic again and put the old .plist file back. If it did work, in Logic set all the preferences as you want them, check everything still works, then quit Logic and make a copy of the .plist file and keep that in your documents folder. You now have an uncorrupted fresh .plist file with all your personal settings, that you can now use to replace the active file, in case of future trouble.
    If refreshing prefs doesn't help, reinstall just the Logic application. Download & install AppCleaner http://www.pure-mac.com/diag.html#appcleaner and drop the Logic application on it, empty your trash and reinstall Logic.
    regards, Erik.

  • When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging

    Contexts: I am very competent with GFX and have worked on many projects.
    When dragging an image onto a fresh canvas, the resizing feature presnaps the image into the canvas size. I can confirm that this has not happened to me in previous projects. I've also tested this problem by making a new larger document size and dragging in the same render. It snaps again. I don't want to re-size from the canvas dimensions, I want to resize from the render's original dimensions.

    Ap_Compsci_student_13 wrote:
    ok sorry but doesn't sscce say to post the whole code?the first S is Short, and yes, it needs to be all the code needed to illustrate the problem and let use reproduce it. If you were developing a new Web framework, your example might be short, but for a student game it's very long.

  • CNN website problems with Comments section. Scroll and post problems

    CNN website, myself and other firefox users can no longer scroll up and down inside a comment when making a post.
    Often you can not post the comment with the 'post' button unless page is reloaded.
    Problem has been occurring for last week or so.
    I have confirmed that other uses on CNN have same problems with firefox.
    Problem doesn't occur when using I.E.8
    Brgds,
    John

    I have this problem with IE 8. I cannot post comments on CNN.com. I thought CNN.com might have disabled my ability to post comments but am not sure if they have that ability. Thanks for your help!

  • 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

  • My iphone 4S has problem in making and receiving the calls. While making the call , call fails and netwrok disappears. Like wise no voice is heard for incoming calls. This happened after return from the overseas travel.

    My iphone 4S has problem in making and receiving the calls. While making the call , call fails and netwrok disappears. Like wise no voice is heard for incoming calls. This happened after return from the overseas travel.

    Hello SamSax
    Check out the assist page below for troubleshooting call connectivity.
    Calls and connection issues
    http://www.apple.com/support/iphone/assistant/calls/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

Maybe you are looking for