cancel
Showing results for 
Search instead for 
Did you mean: 

SDK script to refresh lov's in a universe

Former Member
0 Kudos

Is it possible to refresh .lov file of a universe thru sdk? Do anybody had a script for this? Please advise.

Thank You

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Trishna,

Yes,it is possible to refresh LOV's through SDK's.

You will have to use Report Engine SdK's.

Here is the link where you can find the API Reference and developers guide for XI 3.1

http://www.sdn.sap.com/irj/boc/sdklibrary?rid=/webcontent/uuid/90db428d-71ba-2e10-7eb7-d3286eec5ac0

And here the link for BI 4.0

http://www.sdn.sap.com/irj/boc/sdklibrary

Let me know if you need any furthur assistence.

Regards,

Prithvi

Former Member
0 Kudos

Thank You Prithiv.

I have got below instructions from forms but could not find informaton in the document how to login to Desiger and find particular Unvierse,refresh and exprot it.

Any help is appreciated.

Log into Business Objects using Designer.Application.Logon.

Open the universe to refresh using

Designer.Application.Universes.OpenFromEnterprise

Loop through all of the objects in the Universe and use the

ListOfValues.Refresh() method to refresh the list of values.

After this has run, use SaveAs to save your universe since changes are

made.

Close the universe using Close()

Export the universe using Designer.Application.Universes.Export().

Former Member
0 Kudos

Thanks Prithvi. I will go thru the document.

Former Member
0 Kudos

Prithvi,

I found sample code for refreshing report lovs. I did not see any sample code dealing with Universe. Any suggestions on how to proceed on refreshing object LOV's in a Universe?

Thanks

Trishna

%

/** Schedule Webi report with prompts.

  • Description: Schedule a Webi report to run now, after specifying prompt values.

*/

%>

<%@ page import = "com.businessobjects.rebean.wi.*,

com.businessobjects.sdk.ceutils.prompts.PromptsUtil,

com.businessobjects.sdk.plugin.desktop.webi.IWebi,

com.businessobjects.sdk.plugin.desktop.webi.IWebiFormatOptions,

com.crystaldecisions.sdk.exception.SDKException,

com.crystaldecisions.sdk.framework.*,

com.crystaldecisions.sdk.occa.infostore.*"

%>

<%@ include file = "logonform.jsp" %>

<%

// Name of sample Webi report to schedule.

String reportName = "BEXI Sample Code Webi with Prompts";

IEnterpriseSession eSession = null;

try{

//============================================================================

// Log on and retrieve report from Enterprise

//============================================================================

LogonForm logonform = new LogonForm(response, request, LogonForm.NONE);

if(logonform.display_if_needed())

return;

eSession = CrystalEnterprise.getSessionMgr().logon(logonform.username,

logonform.password,

logonform.cmsname,

logonform.authType);

IInfoStore iStore

= (IInfoStore) eSession.getService("InfoStore");

ReportEngine reportEngine

= (ReportEngine)eSession.getService("", "WebiReportEngine");

IInfoObjects objs = iStore.query("Select TOP 1 * From CI_INFOOBJECTS Where "

+ " SI_KIND='Webi' And SI_INSTANCE=0 "

+ " And SI_NAME = '" + reportName + "'");

//============================================================================

// Open Webi document, then get and set Prompts collection

//============================================================================

IWebi webi = (IWebi) objs.get(0);

DocumentInstance di = reportEngine.openDocument(webi.getID());

Prompts prompts = di.getPrompts();

for(int i = 0, m = prompts.getCount() ; i < m ; i++) {

Prompt prompt = prompts.getItem(i);

String name = prompt.getName();

if("Enter value(s) for State:".equals(name)) {

Lov lov = prompt.getLOV();

lov.refresh();

Values values = lov.getAllValues();

prompt.enterValues(new ValueFromLov[] { values.getValueFromLov(0),

values.getValueFromLov(1)});

} else if ("Enter Shop Id:".equals(name)) {

prompt.enterValues(new String[] { "261" });

}

}

//===========================================================================

// Copy prompts over to InfoObject

//===========================================================================

PromptsUtil.populateWebiPrompts(prompts, webi);

//===========================================================================

// Schedule Webi report to run once now

//===========================================================================

webi.getWebiFormatOptions().setFormat(IWebiFormatOptions.CeWebiFormat.Webi);

ISchedulingInfo schedInfo = webi.getSchedulingInfo();

schedInfo.setRightNow(true);

schedInfo.setType(CeScheduleType.ONCE);

iStore.schedule(objs);

} finally {

if(eSession != null)

eSession.logoff();

}

%>

Scheduled report.

aasavaribhave
Advisor
Advisor
0 Kudos

you have to use the COM Universe Designer SDK for this purpose, the ListOfValues class has a refresh method for it.

[here|http://help.sap.com/businessobject/product_guides/boexir31SP3/en/bodessdk.zip] is the API reference for COM Universe Designer SDK