FM to get open period based on company code

Could you pls tell me the FM which can get open period based on the company code?
right answer will be rewared for sure.
Sujatha

Hi,
I m not sure. Just check this out.
CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
    EXPORTING
      companycodeid = p_bukrs
      posting_date  = p_bedat
    IMPORTING
      fiscal_year   = gd_fiscalyr
      fiscal_period = gd_fiscalp.
CALL FUNCTION 'DETERMINE_PERIOD'
    EXPORTING
      date                      = p_bedat
*    PERIOD_IN                 = '000'
      version                   = gd_periv
   IMPORTING
      period                    = gd_fiscalp2
      year                      = gd_fiscalyr2
   EXCEPTIONS
      period_in_not_valid       = 1
      period_not_assigned       = 2
      version_undefined         = 3
      OTHERS                    = 4.
check this link.
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
Regards
Vadi
Code Formatted by: Alvaro Tejada Galindo on Jan 4, 2010 5:41 PM

Similar Messages

  • To Get Clander Id based upon company codes....

    hi all,
    i need to get the calender id based upon the company code.. is there any table for that...
    Example:  1000 for US,
                  2000 for CA(canada).
    helpfull answers will be rewarded...
    Regards,
    Murali.

    Hi guys.
    Murali, I apologize for this inconvenient (Im using your post)..but I cant make any post since today (with new sdn version)  
    pd: this is a test to check if I can post in an already created thread.

  • OB52 based on Company Code

    Dear All,
           As we are having several company codes and want users only to be able to open and close periods from transaction code OB52 belonging to their posting period with respect to company codes how can I restrict and allow them open & close periods based on company code repectively. Is there any process this be done.
    I tried with the notes I got from one sap-img link. But it did not work & there something is missing. Kindly if anyone have done this before send be step by step process. Awaiting for you reply...
    regards,
    Raj B...

    How about trying it this way?
    1. Remove access to OB52
    2. Create a maintenance view similar to V_T001B specific for each company.
    3. Create a TCODE for each of these views.
    4. Use this TCODE for authorization assignment.
    This should be simple but your number of views would be increasing with respect to the number of companies.
    ~Eswar

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • While cancelation of migo  i get error posting period 07-08 company code

    while cancelling migo i get error msg posting period 07-08 company code my migo is dated 23.07.2010 pls help

    Hi,
    Please check what fiscal year calculation yu are using in the system ! is it from April to March or from January to december...
    as well check which period open currently in the system OMSY is TCode or MMRV.
    as well please search SDN portal for same kind of questions.
    Regards,
    Ninad Kshirsagar

  • Get pernr based on company code in logical databse

    Hi,
        When using the get pernr event, all the pernrs that I get are in the ascending order  I want them first grouped based on the company code and then on pernr.
    Any suggestions would be appreciated abd suitably rewarded.
    for ex: get pernr.
               write:/ pernr, bukrs.
             end-of-selection.
    result:   00000099 1001
              00000002 1003
    Regards
    Vick
    Message was edited by:
            vick vennav

    for ex: get pernr.
    write:/ pernr, bukrs.
    end-of-selection.
    result: 00000099 1001
    00000002 1003
    We are sending the payroll information to the 3rd party for pay check purposes, at my client side they have inserted a custom include in the standard program and populating the information in a flat file which needs to be sorted first based on company code and then on pernr. If I try to do it later,the code is becoming a mess, so I want to know is there a way to get pernr using logical database whose order is based on company code.
    Regards

  • Get Fiscal Period based on Fiscal Year

    Hello Experts,
    I have one query. I wanted to get fiscal period based on fiscal year entered in selection screen.
    I tried to find the FM for it but didn't get it. Can you suggest me any FM which gives in Fiscal period based on fiscal year in FI?
    Regards,
    Neha

    Hi,
    Check the following link:
    How to get fiscal period based on date and Fiscal year?
    http://www.sapdev.co.uk/fmodules/fms_fiscalyr.htm
    Regards,
    Bhaskar

  • To get Fiscal period based on Fiscal Year

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on Fiscal Year?
    Thanks,
    Arpan

    Hi Anshu,
    Have a good day.
    I need to convert fiscal year(2011) to fiscal period(2011001).
    Fiscal year(key field in data source) mapped to the fiscal period(key field in infoprovider).
    But in the transformation when I have mapped these fields, data is not coming propperly into the infoprovider because in the transformation its not converting fiscal year to fiscal period.
    This is the scenario. Please help.
    Thanks,
    Arpan

  • SRM 7.0 , Get company name based on company code

    Hello friends,
    Is ther any function module or table to read company name based on company code in SRM 7.0 ?
    Kindly let me know your inputs.
    Thanks.
    Preethi.

    Hi,
    To find purchase group.
    BBP_OM_FIND_PURCH_GRPS_BEI
    To fund purchase org.
    BBP_OM_FIND_PURCH_ORGS_BEI
    To find company.
    BBP_OM_FIND_COMPANIES
    Regards,
    Pedro Marques

  • Gl a/c short and long text based on company code

    Hello Friends,
    In table skat the gl account description is given based on chart of accounts but what if i want the description based on company code.
    I want the table where i can get the gl account description based on company code??
    Pls suggest.
    Regards,
    Sunny

    Hi,
    you can look at the database view for requirement
    GL_ACCT_CC_TEXT
    regards\
    Mahesh

  • Need to download the data from BSEG based on company code and fiscal year

    Hi All,
              Please suggest me the solution to download the data from BSEG based on company code and fiscal year. As data in BSEG for the fiscal year2009  is 27 lakhs (= 2.7 million) for the specified company code.
    <removed>
    Thanks & Regards,
    Koti
    Edited by: Thomas Zloch on Mar 26, 2010 4:28 PM - please use English metrics only!

    May I ask what you mean by solution?  You can download from SE11, but where are you going to store 2.7 million rows and what tool are you going to use to store it?
    You probably need a (small) program that extracts what you want, then opens a dataset in an appropiate server-system folder, and transfers the data rows to the dataset as fixed-length or tab-delimited file.  It's been done many times, so suggest that you search.

  • Shopping cart default delivery address based on company code

    Hi All,
    As a standard behaviour of SRM, currently delivery address in shopping cart is defaulted from attribute (ADDR_SHIPT). But in our case we use cross company purchasing where requisitioners buy for different company codes.
    Some times, they forgot to change the default dlivery address and shopping carts are getting created with wrong delivery address.
    Is there any way, the we can default the delivery address based on company code selected by the user instead of defaulting from user attribute?
    Suggestions would be greatly appreciated.
    Regards,
    Krish

    Hi Krish,
    Am looking for a same solution but instead of delivery address, we are looking for change in invoice recipient address
    ADDR_BILLT. For this i have identifed a FM: BBP_GET_BILL_TO_PARTY from which system pulls the defaulted attribute of user profile. Now we are in a change of pulling the attribute defaulted to the company code entered in SC rather than the user's defaulted ADDR_BILLT.
    Similarly i guess for your issue you can use the FM: BBP_GET_ORG_SHIPTO_ADDR implementing a enhancement in DOC CHANGE BADI
    Regards,
    Nihar

  • Assign posting period variants to company code

    Hi
    can anyone let me know how to assign company code to Posting period variants.
    cheers

    hi
    The path depends on the version ur using for
    SAP 4.6- 4.7
    Define Variants for Open Posting Periods
    Define Variants for Open Posting Periods
    IMG -> Financial Accounting -> Financial Accounting Global Settings -> Document -> Posting Periods -> Define Variants for Open Posting Periods            t code OBBO
    Allocate Posting Period Variant to Company Code
    IMG -> Financial Accounting -> Financial Accounting Global Settings -> Document -> Posting Periods -> Assign Variants to Company Code
    t code OBBP
    In Ecc 6.0
    Financial Accounting (NEW) -->Financial Accounting Global Settings (New) >Ledgers Fiscal Year and Posting Periods>Posting Periods-->  Define Variants for Open Posting Period
    Financial Accounting (NEW) -->Financial Accounting Global Settings (New) >Ledgers Fiscal Year and Posting Periods>Posting Periods-->  Assign Variants to Company Code
    hope this helps
    Anil

  • SKF transactional values based on company code

    Can anybody let me know the logic how we can seggregate transactional value passed to statistical key figure based on company code or is there anytable where we can direclty find SKF transactions involved based on company code ?
    Need to upload SKF transactional figures from one SAP system to another.Hence require process for extraction and uploading of the same

    Hi Amogh
    Hope you are looking for actual SKF quantities posted. kindly check s_alr_87013611 CC report, I think on the lower part this comes. This time I am not in front of system so you please check.
    Regards
    Rajneesh

  • Decimal places adjustment based on company code or currency

    Hi experts,
        my requirement is i have to adjust the decimal places in amount fields of internal table based on company code or currency given by user.
    suppose for example in my internal tables having 5 amount fields like 1.50 1.234 1.45 1.34, 1.67  for  company code is in01
    the same values for VN01 should be like this
    150 1234 145 134  167  ....
    can any body plz tell me any functional module is there to covert or abapcode?
    Thanks in advance,
    veena.

    That code is a bad idea.  Why would you hard-code that type of action for currency/amount handling?
    @poster: If the output is based on the local currency defined for the specified company code or one specified by the user, then use it.  SAP handles amount output automatically with a currency specification because the currency definition identifies where/how the decimal is output. 
    Just use WRITE as Florian indicated but  use the CURRENCY extension instead of DECIMALS.  You can do this dynamically based on the company code easily...
    A simple 3 line program shows you how this works:
    PARAMETERS: p_wrbtr type wrbtr.
    write:/ p_wrbtr CURRENCY 'USD'.
    write:/ p_wrbtr CURRENCY 'JPY'.
    Edited by: Brad Bohn on May 12, 2011 1:07 PM

Maybe you are looking for

  • ABAP Proxy viewing of historical web service posts - XML files

    Hi there I have developed a web service that posts via an ABAP proxy.  The webservice posts successfully.  Where do I see the historical XML files of the posts of my executed webservices? Kind Regards Gustav Coleske

  • RMAN-05001 auxiliary .... conflicts with a file used by the target database

    I can´t recreate my physical standby. It worked in the past. Now I reinstalled the 3 standbyclients. Copied the spfile from the primary - modified the entries and did a rman backup. But when issuing the duplicate database command - it comes up with t

  • Send and recieving emails

    Are there some VI's that give the posibility to send and reciev emails?

  • Screen sharing the iPhone on PC

    I've seen related topics on this forum, but the question does not seem to be answered, unless I missed it in the list. I get applications coded quickly for PoC purposes or Demo purposes on my iPhone. But the problem is I cannot do a good demo of this

  • Artifacts in Canvas Window!

    I just upgraded from 4.5 and have begun working on a project that was initially edited in 4.5. However, whenever there is lots of motion within the frame I am seeing vertical lines through the entire Canvas window almost like streaks through the imag