cancel
Showing results for 
Search instead for 
Did you mean: 

Validation on RFX data before upload into CLM System

Former Member
0 Kudos

Hi

I am New to CLM\BeanShell scripting and working on below requriement in CLM.

Uploading the RFx Data into CLM System. Before upload the RFX data into CLM system need to check the Master Agreement existence in CLM system based on the DOCUMENT_ DESCRIPTION column of FCI_CONTRACT table. If the Document Description from the RFx data is matched in CLM system then header and line items should be updated other wise it should create a new Master Agreement.

In SAP standered functionality there is a check on UNIQUE_DOC_NAME for finding the existence of the Master Agreement If Master Agreement presents with the given UniqueDocName then it will update the MA with the changes from RFX data. But in our requirement we need to check on DOCUMENT_ DESCRIPTION because  UNIQUE_DOC_NAME is always empty in RFX data.

I am trying with below two ways

1) Import life cycle --> Process Row Event--> Checking the Master Agreement existence based on the DOCUMENT_DESCRIPTION with the Query IAPI If Master Agreement presents then getting the UNIQUE_DOC_NAME value for the Master Agreement. Passing the same Unique Document Name to the

doc.getFieldMetadata("UNIQUE_DOC_NAME").set(doc, uniqueDocName);

Expected result is It should accept the Unique Document Name and should go to the SAP Standered functionality to update the existing Master Agreement with the changes from the RFX data.

But It is throwing an error This value is already used by another Master Agreement.

2) Import life cycle --> Process Row Event--> Checking the Master Agreement existence based on the DOCUMENT_DESCRIPTION with the Query IAPI If Master Agreement presents then getting the UNIQUE_DOC_NAME value for the Master Agreement and loding the same Master Agreement into the runtime with the below piece of code.

  ContractIBeanHomeIfc contractHome =(ContractIBeanHomeIfc) IBeanHomeLocator.lookup(session, ContractIBeanHomeIfc.sHOME_NAME);
  ContractIBeanIfc contractdoc =(ContractIBeanIfc) contractHome.findForEditByUniqueDocName(uniqueDocName);
  contractHome.upgradeToEdit(contractdoc);
  contractdoc.setDisplayName(doc.getDisplayName());
  contractdoc.setCurrency(doc.getCurrency());
  contractHome.save(contractdoc);
  contractHome.downgradeToView(contractdoc);
  contractHome.cancel(doc);

In above code i have tried with only two columns DisplayName and Currency of RFX data to update. But I have around 40 columns to update. 

Is there any way to achive our requirement instead of setting the 40 columns manually?
Please help me with other possible solutions

Regards,

Ravindra

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ravindra,

You can write script to automate the updation of the fields of Master Agreement by RFx fields value. It can be written the same way you have written. You can use APIs and also queries to copy the fields from respective fields of the other document.

Please let know if it helps and resolve your issue.

Regards,

Kumud

Former Member
0 Kudos

Hi Kumud,

Thanks for your response.

Do you mean to say only with the above way (i mentioned manually getting the RFXdata and setting into Master Agreement with getter and setter methods)? to update the RFX data?

Former Member
0 Kudos

Hi Ravindra,

As much I know answer is yes. You will have getter and setter methods for standard fields which you will use for copying from one document to another . For extension fields used,  you would not have the getter setter methods. you will have to use different ways to implement the updation for custom fields.

Hope this helps,

Regards,

Kumud

Former Member
0 Kudos

Thanks Kumud,

We have non standered fields also  in uploading file(RFX data). If you already worked this kind of requirement can you pls share the procedure how to handle non standered fields.

Regards,

Ravindra

Former Member
0 Kudos

Hi Ravindra,

For custom fields you could use:

As your requirement suggests I am considering RfxDocIBeanIfc as rfx and ContractIBeanIfc as ma.

1. If data type of both extension fields are same

ma.getExtensionField("XXX").set(rfx.getExtensionField("XXX").get());

OR

object abc=// any object value of RFx field

ma.getFieldMetadata("FIELD_ID").set(ma, abc );

here again, data type should be same

If data type is not same and still you have to copy the same value you need to convert the datatype of the object. You could use Class TypeFactory in doing so.

2. You can fetch the value of any field of RFx using query and then set the value in Agreement using getExtensionfield().set() or using metadata as mentioned above.

Hope it would help you.

Regards,

Kumud