FDMEE Jython scripts

I use fdmContext ['PERIODKEY'] to pull in the PeriodKey and she returned to 2013-11-18 (AAAA-MM-JJ), and I would like to change the format of 201311 (YYYYMM).  Something there suggestions on how this can be accomplished using Jython?

Thanks in advance.

Try

import of java

print java.text.SimpleDateFormat("yyyyMM").format (java.util.Date ())

Tags: Business Intelligence

Similar Questions

  • FDMEE Jython Script help

    My load the import data were thrown a curve ball. I used to have a 1 or 2 digits in the card. If it's a digit, I simply added a zero at the beginning (i.e. FillL convert 1 01). But now I have a leader 4 digits and a hyphen. So instead of '1', I have 2500-1, instead of "12", I now 2500-12. I need to remove what is to the right of the dash and then add a zero not significant if it is not already 2 digits. Does anyone know the script that would achieve this?

    Your help is very appreciated.

    FA

    Hello

    You can create this jython script and assign import format:

    def customFill (strField, strRecord):

    return ('0' + strField.split("-") [1]) [-2:]

    This function divides your strField using "-" as the delimiter, then him concatenate '0' with the second element ([1] in the table starts in position 0) and finally to take the last two characters [-2:]

    If you have 1 number after the hyphen you will get 0 x. On the other hand, if you have already a 2-digit, you will get xx

    Hope says.

  • How to assign the value to the variable of project in the Jython script

    Hello

    I want to assign a value to the variable of project in the jython script.
    I tried to assign the following, but it is throwing some errors.

    < @.
    int noOfRecords = 10;
    #var1 = noOfRecords;
    @ >


    Can you please help me in this regard.

    Concerning
    Shyam

    Perfect! Good to know that!

    Please, don't forget to close the thread and assign the status to 'correct' or 'comfortable' to each response that helped you!

    Thank you

    Cezar Santos
    http://odiexeperts.com

  • FDMEE import Jython Script - field Split function

    Hi people,

    I have to admit, this Jython gives me a heavy headache!

    In fact, it's a simple mistake, but I'm fighting around with it for hours now. Maybe one of you guys can help.

    I want to create a Script of Import in FDMEE 11.1.2.3.500.17. The source file (separator: tab) contains a column with the following entries:

    Capture1.JPG

    What I want to achieve at first is to import the figure after the first point. For example, hours - 00275. 3. 4.1 I want to import 3.

    I wrote a script to import, based on an example of written script in FDMEE admin guide (page 273):

    Capture2.JPG

    I assigned this script to the respective column in the Import Format:

    Capture3.JPG

    Seems easy. But for some reason, it does not. The problem is: even the log file is not help, because it seems to be growing constantly when I want to open it (after becoming 30 MB I cancelled). By the way: without this script works import.

    Any ideas? Help is very appreciated!

    See you soon

    Carmonte

    I wasn't talking about the script file extension, as you say is irrelevant, your file name of the script was eGRCcISPA (without the extension) and your function called eGRCsISPA (in the body of the script). They were different and should be the same. They are the same today? Also when you say that this does not work, what do you mean?

    (1) import runs successfully, but represented for that field values are not what you expect the rest of the script is running?

    (2) the mistakes of import process when using that import format?

  • FDMEE mapping &lt; white &gt; does not / Jython Script

    Hi all

    Has anyone got the < white > mapping work?  I put it in my SIMILAR mapping and it does nothing.  Any help would be appreciated.

    As a solution, I tried to add an import script to my base file import format.  I want it all empty fields in PKI to convert in [no PIC].  Keep logs process details (see below) gives me an error.  He doesn't seem to like dealing with NULL values.  Here is my script to import of Jython:

    def OracleEBS_ICPNone (strField, strrecord):

    If strfield is not nothing and len (strfield) > 0:

    return "[ICP None]"

    Another thing:

    return strfield

    Error log:

    2014-06-03 14:57:18, 892 [AIF] DEBUG: 105039:EPMERPI - error expression evaluation: OracleEBS_ICPNone (", 725, 100151_C, 000, 16434308.16')

    result: null

    2014-06-03 14:57:18, ERROR 894 [AIF]: 105039:EPMERPI - 105042:EPMERPI - error evaluating script.

    null

    THX,

    Mike

    How are your values of source?

    does not refer to NULL.

    This will work only if the value of your source has a blank space.

    So if you have a map as --> [no PIC]

    and your source is an empty string... it won't

    It won't work if it has a white space (' ')

    For you the script:

    def OracleEBS_ICPNone (strField, strrecord):

    If strfield is not nothing and len (strfield) > 0:

    return "[ICP None]"

    Another thing:

    return strfield

    Jython is case-sensitive: strField <> strfield

    If you want to capture values empty source in PKI:

    def OracleEBS_ICPNone (strField, strRecord):

    # You can cut your source, remove the whitespace on the left/right and then check if the length is zero

    If len (strField.strip () == 0:

    return "[ICP None]"

    Another thing:

    return strField

  • How to use a SELECT QUERY using fdmAPI.executeDML in the Jython Script FDMEE?

    Hello

    Is just the way we use DELETE and INSERT statement using fdmAPI.executeDML, possible to run a SELECT statement and get the result in the variables?

    I want to refrain from using import java.sql and enter the connection information in a script. I would rather use SELECT directly if possible. I want to read the TDATASEG. DATAKEY column and use it for some custom in a custom table process

    Thank you!

    Try RS.next instead of RS. Next

  • FDMEE event Script - BefFileImport

    Hi all

    I was looking for to use the feature to change dynamically Import referencing the guide to FDMEE administrator (see below).  However, BefFileImport event script does not seem to be an option in the Script Editor.  I also created a file called BefFileImport.py and she didn't register when I've run a load process.

    Is this an oversight in the Administrator's guide and they forgot to add this to FDMEE or am I missing something?

    THX,

    Mike

    Dynamically change import Formats

    You can use the BefFileImport event to change the format to import for a location dynamically.

    If fdmContext ["LOCNAME'] == 'ITALY ':

    filename = fdmContext ["FILENAME"]

    If filename [: 12] == 'ProductSales:

    fdmAPI.updateImportFormat ("SALESJOURNAL", fdmContext ["LOADID"])

    To answer my own question, it seems that I can dynamically change the Import Format using the BefImport event script.  I believe that the reference to "BefFileImport" in the FDMEE Administrator's guide is a classic obsolete FDM reference... they should refresh that.

    THX,

    Mike

  • Jython script analysis on commas

    I use an import script to import a file with records similar to the one below.

    Entity, CR_Amt, DR_Amt, Custom1, account

    ' 100 ',' 2000 ',' 300 ',' 17,000,000.00 ',.

    '400', '5000', '600', '28,000.00.

    My script is on the DR_Amt and CR_Amt fields is as follows:

    def AMOUNT_CSV (strfield, strrec):

    arrRecords = strrec.split(',')

    strDr = arrRecords [4]

    strCr = arrRecords [5]

    dr_str = strDr.replace('"','')

    Cr_str = strCr.replace('"','')

    If dr_str is None or dr_str == "" or dr_str == 0:

    End_str = floating fenΩtre (Cr_str) *-1

    Another thing:

    End_str = float (dr_str)

    return End_str

    The script seems to work fine except that it scans my fields amount on the comma separator.  For example, the first record will return at 17.00 and the second field will return 28.00.  Is there a way to get around this?

    It seems that regular import module expression or csv import scripts does not work correctly...

    Python/jython is very powerful, you might also have a solution using list function for a list of positions for the character "and then get the amount of CR based on the last two positions.

    def parseDoubleQuotesDRCR (strfield, strrec):

    If strfield is None or strfield.strip () == ' ' or strfield == 0:

    # Sample line-> ""400","5000","600","28,000.00.

    # Get a list of the positions of the characters in double quotation marks

    # Ex: [0, 4, 6, 11, 13, 17, 20, 30]

    listposquotes = [i i, in enumerate (strrec) so ltr ltr == "'"]

    "# Get the position of the first character after the double quotes after the last '.

    # CR is stored between 20 and 30-> strrec [21:30]

    crstart = listposquotes [(len (listposquotes)-2)] # + 1 post 21

    crend = listposquotes [(len (listposquotes)-1)] # 30 Position

    Separator to replace thousands of # to avoid conversion problems

    amount = float (str(strrec[crstart:crend]).replace (',', ")) *-1

    Another thing:

    quantity = float (strfield.replace(',',''))

    return the amount

  • Import of Jython Script if Stmt

    I have a Jython import the script I'm debugging.  I proved that everything works properly until my if stmt.  That's what I want to do... If the DR_str field is null, then returns the CR_str field; otherwise the return DR_str field.

    This script in its current state will import all records where DR_str is not null.  He will ignore the fields where the DR_Str is null

    def AMOUNT_CSV_12 (strfield, strrec):

    arrRecords = strrec.split(',')

    DR_str = arrRecords [12]

    CR_str = arrRecords [13]

    If DR_str is None or DR_str == "or DR_str == 0:

    End_str = float (CR_str)

    Another thing:

    End_str = float (DR_str)

    return End_str

    Hi 898555,

    The return statement is indented in this clause else for now so it'll never return a value for End_str, when the else clause works. This cut from the version of your function to the return in four spaces returns 9999.0

    def AMOUNT_CSV_12():

    DR_str = 0

    CR_str = 9999

    If DR_str is None or DR_str == "or DR_str == 0:

    End_str = float (CR_str)

    Another thing:

    End_str = float (DR_str)

    return End_str

  • Jython script to remove the quotes

    All,

    I created the following script as an event script before import to remove the quotes around member names in our source file.  Everything seems to work except the last step of deleting and renaming the file (os.remove and os.rename).  I can see the ".out" file and it seems OK, but the original file is still there.  Any help is greatly appreciated.

    If fdmContext ["LOCNAME'] == 'TecLabor_TO_RSA ':

    fdmAPI.logInfo (fdmContext ["LOCNAME"])

    Try:

    filename = fdmContext ["FILENAME"]

    Inbox = fdmContext ["INBOXDIR"]

    #filedir = fdmContext ['FILEDIR']

    fdmAPI.logInfo (filename)

    fdmAPI.logInfo (inbox)

    file = inbox + '\\TecLabor_TO_RSA\\' + filename

    file_out = inbox + "\\TecLabor_TO_RSA\\" + file name ".out".

    #file = inbox '-' + filedir + "\\"+filename. "

    #file_out = inbox + "\" + filedir + "\\"+filename + «.out "»

    fdmAPI.logInfo (file)

    end = open (file, "r")

    who cares = open (file_out, "w")

    for the end line:

    Line = Line.Replace ('"'," ")

    care. Write (Line)

    end. Close()

    care. Close()

    except IOError, err:

    fdmAPI.logError ("My error" + str (err))

    OS. Remove (file)

    OS. Rename (file_out, leader)

    So you're saying that the os.rename and os.remove of commands do not work? If so make sure have included you the following import statement at the top of your script - import bones

  • Jython scripts may rely on values alphanumeric vs. alpha?

    I have a column of data that includes alpha and alpha numeric values of different length and having the prefix "ABC". I want the prefix removed in the case of alpha or alpha numeric values. For numeric values, I want just the right numbers 6 and the following script works:

    def SAP_PC (strField, strRecord): return strField [-6:]

    Digital alpha values can be of any length, and I want the whole chain less the prefix. Does anyone know of a way to do this?

    Thank you

    FA

    You can also used the isalpha function without casting to unicode:

    def SAP_PC (strField, strRecord):

    suffix = strField [3:]

    If suffix.isalpha ():

    return the suffix

    Another thing:

    return strField [-6:]

  • Jython FDMEE script problem

    Hello

    I have a custom jython script to convert table data into a text file. This works for a table. But I tried to use lists and tables so that I can have several files of several tables. This script, by creating multiple files, retrieves only the data of the last file. All other files remain as 0 KB files with no data. I see here only data for CH, AC in the file is a 0 KB file. If I have the list with "AC" Member, then I see data for AC. Can someone let me know what I'm missing here in logic.


    List = ['AC', 'CH']

    Conn = sql. DriverManager.getConnection (strJDBCURL, strUserName, strPassword)
    for the list item [:]:

    Represented = fdmContext ["INBOXDIR"] + "/" + item + "export.txt"
    SRC = open (represented, "w")
    SqlString = conn.createStatement)

    sqlstmt = 'SΘlectionner the SOURCE, TARGET of TEST_' + point + 'EXPORT '.
    result = sqlstring.executeQuery (sqlstmt)

    While (result. Next()):
    SOURCE = result.getString ("SOURCE")
    TARGET = result.getString ("TARGET")

    Print > > src, SOURCE, TARGET

    CBC. Close()
    Conn.Close)

    Hi, I skimmed the code last night and missed the second loop. I think that the problem actually comes from your indentention that is the while loop is not currently incorporated in the for loop runs but after the because the loop is complete, the code must be

    List = ['AC', 'CH']

    Conn = sql. DriverManager.getConnection (strJDBCURL, strUserName, strPassword)
    for the list item [:]:

    Represented = fdmContext ["INBOXDIR"] + "/" + item + "export.txt"
    SRC = open (represented, "w")
    SqlString = conn.createStatement)

    sqlstmt = 'SΘlectionner the SOURCE, TARGET of TEST_' + point + 'EXPORT '.
    result = sqlstring.executeQuery (sqlstmt)

    While (result. Next()):
    SOURCE = result.getString ("SOURCE")
    TARGET = result.getString ("TARGET")
    print > src, SOURCE, TARGET

    CBC. Close()

    Conn.Close)

    Only try.

  • Error: Import module XLRD in a custom script FDMEE

    Hello Experts,

    I'm trying to import a python "xlrd" module in a custom Script FDMEE. But he doesn't always lift error "No Module name xlrd".

    I tried to import the module by changing the path sys:

    Here is the code I tried:

    ===========================================================================================

    import sys

    "custModlePath = r'fdmContext ["INBOXDIR"] +"\\Excel_Sample\\xlrd""

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\."

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out."

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    #data_sheet = book.sheet_by_index (3)

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\mapping.csv",'w")

    #myfile = open('SG\OUT\mapping.txt','w')

    all in start_row_count < end_row_count:

    #print data_sheet.row_values (i)

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =============================================================================================

    ERROR:

    2016-01-27 01:18:11, 294 FATAL [AIF]: error in CommProcess.executeCustomScript

    Traceback (most recent call changed):

    File "< string >", line 191, in executeCustomScript

    File '< string >", line 486, in executeCustomScript

    Folder "< string >", line 528, in executeJythonScript

    File "E:\FDMEE/data/scripts/custom/EXCEL_TO_CSV.py", line 6, < module >

    import xlrd

    ImportError: No module named xlrd

    2016-01-27 01:18:11, 336 DEBUG [AIF]: the connection of fdmAPI was closed.

    ===========================================================================================

    Appreciate your help!

    Thank you

    Ishti

    Hello

    I was able to get it working after some changes.

    Version compatible with Jython 2.5.1 FDMEE xlrd is xlrd 0.7.4

    Xlrd record is required to be placed inside the FDMEE server and the path is required to be updated in the script.

    Below the script just in case someone needs it:

    ===============================================================================================

    import sys

    custModlePath = fdmContext ["INBOXDIR"] + "\\Excel_Sample" # path in which is placed the folder xlrd

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Mapping.xls" # path to the Source file

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\" # path to the .csv file

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (pathout + "mapping.csv", "w" ")

    everything start_row_count<>

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =====================================================================================================

    Thank you

    Ishtique

  • Call the Essbase Calc of custom Script FDMEE script

    Hi Experts,

    In my reuirement, I must run Essbase calc script to export the perticular accounts data and then import these data into FDMEE to load in another planning application.

    I know we can run the Application Esbase calc script fromTarget page and after load. but in my case, executing the script should happen prior to importation.

    Aanybody may suggest an example if I can call the script to calc Essbase to a custom event BefImport script or FDMEE script? an example of the syntax would be useful

    Thank you!

    Hello

    are what version of FDMEE you?

    You have an example document to support FDMEE sample scripts (Doc ID 1613836.1)

    You can have a MAXL command in your batch file to perform the extract

    Example 5

    An example script to calc to perform an Essbase excerpt and then load the file extracted with FDMEE.

    1. Create a batch (.bat) file that performs extract Essbase.
    2. Call the scriptimport BefImport event operating system batch file
      import of subprocesses
      Import shutil
      OS.chdir ("D:\temp\\BatchFiles")
      command = ' D:\temp\BatchFiles\helloworld.bat > helloworld.out '
      p = subprocess. Popen (Command)
      RETCODE = p.wait)
    3. Load using FDMEE HelloWorld.out

    The Jython script can be created in the BefImport Script.

    Then you can have a rule of data loading with a file in it name (Ex: Essbase_Extract_XXXX) where XXXX is that five-year period.

    Your jython script should create this file, so in the case of import, the data is imported

    Keep in mind that it is an output of feature 11.1.2.4 box so if you are in 11.1.2.3.x I wouldn't put a lot of effort in a complex solution

    I hope that this puts you on the right track

  • FDMEE SCRIPT - replacement FDM VB functions with the methods in the API FDMEE

    Hi all


    I'm trying to convert FDM Scripts scripts that would support FDMEE (using Jython as language) and the FDMEE API. However, when I tried it making I came across a few functions in scripts FDM for which I couldn't find replacement functions in FDMEE API.


    How a supposed to change functions VB in FDM as farsTableAppend while it is supported in the FDMEE scripts?

    I generated documentation of the API of the FIA FDMEE - APIs.jar (this jar is supposed to have all the API of FDMEE in there I guess) but I don't see alternative for functions such as farsTableAppend, fExpTRx, PstrClientType, VB, but I can see other methods in the documentation for example, getEPMOracleHome() etc... (All these functions that you can view by using eclipse as editor-in-Chief of Dev FDMEE).


    Is there another method/function in the FDMEE API should I use to replace these functions to support FDMEE?


    I have another question about the AIF file - CUSTOM.jar, what is the purpose of this pot, do we get additional methods in this file


    Please advise...


    Thanks in advance

    Sam

    Hello

    1 API map is not 1 to 1. My suggestion is to define what you want to do and then design your solution in jython (using the api or not). So what you're trying to do exactly?

    For example, you need not PstrClientType more (there is no windows client)

    2 AIF - CUSTOM.jar allows you to enter your custom java classes. then you can use it from your jython scripts.

    Regarrds

Maybe you are looking for

  • Can I restore a note deleted if it appears always in my spotlight search?

    Please be patient with me, I must admit from the outset, I have limited knowledge of IOS and how everything on my duties for the Ipad. Here's my situation. I was editing in a note above in my notes app and somehow one click accidentally deleted all t

  • WRT120N loses network connection

    Hello Right after the little help with my home network. I have an ADSL Dynalink RTA 1320 connected to my WRT120N is connected to my PC which is running Vista. I have a new HP laptop running Windows 7 that is connected wireless to my home network. I h

  • problem of sistem

    Buna am asa o Problema: imi apare Mesaj eroare sistem CIS asta if this is poate facut?

  • Notes not reflecting is not reality

    Don't really know where to post this, so I just write it here... Something is wrong with the side :-) I just got a + 5 for a given answer (my answer was... "I don't understand your question, you can specify?) haha... clearly not the most useful answe

  • Charter has changed its line-up and wmc still uses the old line-up. How long should I wait for a list update also?

    When wmc will update the alignment of st louis Charter cable channels? White takes so long? This has made my usless ceton card. PLEASE update the Charter Charter range St. louis. It makes me upset. I have download the Ford 30 times aday and it still