Wednesday, August 26, 2015

Maximo .. Update database using Birt report

Sometimes database has to be updated after each report run showing that a report  has been run(example like last run date).

In Birt simple way to achieve this is to execute update query in the 'beforeClose' method of dataset.



var myTxn = MXReportTxnProvider.create("maximoDataSource");


var updateSqlText = new String();

updateSqlText = " update poline set enterdate=SYSDATE  where enterdate is null'";

var apextractStmt = myTxn.createStatement();
apextractStmt.setQuery(updateSqlText);

myTxn.save();





---------------------------------------------------------------------------- All the messagesbelow are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.

SQL Server & Maximo .. How to split GL account in SQL Server

Below query can be used in sql server to split a GL account which has 3 components in to individual components divided by '-' (ex : 100010123-abcd-1234 will be divided into gl1- 100010123, gl2- abcd , gl3 - 1234) .

select gldebitacc,

substring(gldebitacc,0,CHARINDEX('-',gldebitacc)) as gl1,

substring(gldebitacc,CHARINDEX('-',gldebitacc)+1,len(gldebitacc)-(CHARINDEX('-',gldebitacc)+charindex('-', reverse(gldebitacc)))), as gl2,

REVERSE(substring(reverse(gldebitacc),0, charindex('-', reverse(gldebitacc)) )) as gl3

 from

poline


----------------------------------------------------------------------------
All the messagesbelow are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.

Maximo Automation script .. How to find the parent Mbo and set value

Below is the sample code which can be used for finding the parent Mbo (ex invoiceline is parent for invoicecost) and setting values.I am using a attribute launchpoint on child mbo (ex invoicecost) which is called from invoiceline when filling gldebitaccout

from psdi.util.logging import MXLogger
from psdi.util.logging import MXLoggerFactory
from psdi.mbo import MboConstants


parentMbo=mbo.getOwner()
parentMbo.setValue("description","test", MboConstants.NOACCESSCHECK|MboConstants.NOVALIDATION_AND_NOACTION)



----------------------------------------------------------------------------

 All the messagesbelow are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.

Maximo Automation Script .. Split GL account

Below is the script which can be used for splitting the GL account to components

from psdi.mbo import MboConstants
from psdi.mbo import GLFormat
from java import util

 glComp1=mbo.getValue("gldebitacc").split('-')[0]
glComp2=mbo.getValue("gldebitacc").split('-')[1]
glComp3=mbo.getValue("gldebitacc").split('-')[2]

----------------------------------------------------------------------------

All the messagesbelow are just forwarded messages if some one feels hurt about it please add your comments we will remove the post.Host/author is not responsible for these posts.