cancel
Showing results for 
Search instead for 
Did you mean: 

Exploring a option within CLM via Scripting

Former Member
0 Kudos

Hi,

I am working on a requirement within CLM wherby I have to generate a CSV from a script. Is this possible through scripting ?

I am even considering a workaround of generating the CSV via a scheduled report but it would be great if this could be done via scripting.

Any pointers would be appreciated.

Thanks,

Arijeet

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arijeet it is possible through script . You can create a tool bar script and write all the fields and line items details into the CSV file which can later be picked up by another system

Let me know in more details what all fields you are looking to write into the csv

Regards,

Piyush Srivastava

Former Member
0 Kudos

Hi Piyush,

Can you send me a kind of sample script which does the same.

I have never tried this before so not sure how to add data to a csv file.

My email id is arijeetbhattacharya@gmail.com in case you want to mail me the code.

I am basically trying to populate the csv with certain header details and extension fileds and storing it in a folder where PI can access it.

PI will then update these details in the corresponding Central Contract in SRM.

Thanks,

Arijeet

Former Member
0 Kudos

Hi Arijeet ,

Below is the sample code , you can fetch more fields as required as per the methods given in the RG. 

import java.io.*;

import java.util.Date;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import com.frictionless.api.doc.collaboration.*;

import com.frictionless.api.doccommon.masterdata.*;

import com.frictionless.api.doccommon.doc.contract.*;

import com.frictionless.api.common.log.*;

import com.frictionless.api.common.*;

import com.frictionless.api.common.exception.*;

import com.frictionless.api.contracts.*;

import com.frictionless.api.ibean.*;

import com.frictionless.api.ibean.IBeanIfc.*;

import com.frictionless.api.contracts.LineItemIBeanIfc.*;

import com.frictionless.api.usermgmt.masterdata.*;

import com.frictionless.api.ibean.SubordinateCollectionIfc.*;

import com.frictionless.api.doccommon.masterdata.purchasing.*;

import com.frictionless.api.common.platform.IapiAccountLocator;

DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");

Date date = new Date();

File file = new File("D://FTPHOME//sourcing//"+doc.getDisplayName()+dateFormat.format(date)+".csv");

output = new BufferedWriter(new FileWriter(file));

FIELDB = doc.getStatusRef().getDisplayName() ;

FIELDB = FIELDB + ","+doc.getDisplayName();

FIELDB = FIELDB + ","+doc.getDocumentDescription();

FIELDB = FIELDB + ","+(doc.getCompanyRef().getDisplayName());

FIELDB = FIELDB + ","+doc.getOrganizationalUnitRef();

output.write(FIELDB);

output.close();

Do use proper Exception handling . Hope this might help

Regards

Piyush Srivastava