Skip to Content
avatar image
Former Member

How to obtain the Agreement Document Type,OrgUnit External ID,ApprovalGrp

Hi Experts,

We are working on the SAP Sourcing 5.0. Here we have a contract workflow, which needs to go through some approval phases. The approval is working fine. Its moving from one phase to another phase once we approve the contract. But now the requirement has been changed a bit. The requirement is as following:

1. We have to first figure out the Agreement Document Type.

2. Depending upon the Document Type we have to fetch the organizational unit(External ID).

3. Depending upon the organizational unit we have to get the approval group(External ID) associated with the organization.

Can you please let help us how we will achieve above three functionality .

For the second point i tried the below code,its giving me the Organizational Unit text, but not the External ID for the Organizational Unit.

accHome = IBeanHomeLocator.lookup(session, session.getAccount().getAccountObjectReference());

accBean = accHome.find(session.getAccount().getAccountObjectReference());

org_unit = accBean.getOrganizationalUnit();

log.setLogMessage("--


WF:Organizational Unit: " + org_unit + "--


");

Logger.error(log);

When i tried the below code to get the Organizational Unit External ID, it threw the following exceptions.

busUnitHome = IBeanHomeLocator.lookup(session, doc.getOrganizationalUnitRef());

busUnit = busUnitHome.find(doc.getOrganizationalUnitRef());

log.setLogMessage("--


WF:Organizational Unit: " + busUnit + "--


");

Logger.error(log);

//Get the External ID for the Organizational Unit

log.setLogMessage("--


WF:Organizational Unit: " + busUnit.getExternalId() + "--


");

Logger.error(log);

Error:

Error in method invocation: No args method getOrganizationalUnitRef() not found in class'com.frictionless.api.doccommon.doc.contract.ContractDocumentIBeanImpl' : at Line: 84 : in file: inline evaluation of: ``/* * This script handles the prescript activities for the first Legal Review * . . . '' : doc .getOrganizationalUnitRef ( ).

Error:

No args method getExternalId() not found in class'com.frictionless.common.db.ObjectReference' : at Line: 70 : in file: inline evaluation of: ``/* * This script handles the prescript activities for the first Legal Review * . . . '' : org_unit .getExternalId ( )

This is an high priority issue for us, need urgent help.

Thanks,

Ritik

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 23, 2011 at 08:46 AM

    Hi Mudit,

    Thanks for your timely help.

    Iam working with Ritik on the same code base.Yes we have this Legal group as an extention on the Organization

    Unit.

    regards,

    Priya

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 22, 2011 at 06:40 AM

    Hi

    1. We have to first figure out the Agreement Document Type.

    I am assuming you need to get the display name of the agreement doc type here. Use the below mentioned code:

    DocTypeRef = doc.getDocTypeReference();

    DocTypeHome = IBeanHomeLocator.lookup(session,DocTypeRef );

    DocType = DocTypeHome.find(DocTypeRef);

    DocTypeName = DocType.getDisplayName();

    You can make slight modifications to suit your interest

    2. Depending upon the Document Type we have to fetch the organizational unit(External ID).

    Following is the code to get external Id of organization Unit of current document/ master agreement.

    OrgUnitRef = doc.getOrganizationalUnitRef();

    OrgUnitHome = IBeanHomeLocator.lookup(session,OrgUnitRef );

    OrgUnit = OrgUnitHome.find(OrgUnitRef);

    OrgUnitExtID = OrgUnit.getExternalId();

    Regards

    Mudit Saini

    Add comment
    10|10000 characters needed characters exceeded