Skip to Content

Target Audience: CRM Consultants


Part 1:


Objective: Need to put the customer fields in ICSS Complaint UI. Already these customer fields are

available in SAP GUI.

!https://weblogs.sdn.sap.com/weblogs/images/251720362/icss3.jpg|height=74|alt=image|width=575|src=https://weblogs.sdn.sap.com/weblogs/images/251720362/icss3.jpg|border=0!

The enhancement in ICSS JAVA Layer includes

  • UI layer
  • Action
  • Business Object and Backend Object implementation
  • Business Object and Backend Object Interface


UI Layer Enhancement:


Implementation:


.icss.intf.businessobject.complaint.Z_ComplaintBO;
import com.sap.icss.impl.businessobject.BusinessObjectManager;
import com.sap.isa.core.UserSessionData;


public class Z_CustomerBusinessObjectManager extends BusinessObjectManager {
public static final String BOM_ID = “Z_CUSTOM-BOM”;
/** Returns the current instance of this BOM out of the UserSessionData. */
public static final Z_CustomerBusinessObjectManager getInstance(UserSessionData session) {
     if (session == null) {
          return null;
     }
     return (Z_CustomerBusinessObjectManager) session.getBOM(BOM_ID);
}
/**

  1. Create a new instance of the object.

*/
public Z_CustomerBusinessObjectManager() { }
/**

  1. Creates a new Z_ExampleBO. If such an object whas already been created,
  2. a reference to the existing instance will be returned.

*/
public Z_ComplaintBO createZ_ComplaintBO(String user, String pwd) {synchronized (this) {
     Z_ComplaintBO bo = (Z_ComplaintBO) createBusinessObject(Z_ComplaintBOImpl.class);
     bo.setUser(user,pwd);
     return bo;
     }
}
/**

  1. Releases the instance of releaseZ_ExampleBO if available.

*/
public void releaseZ_ComplaintBO() {synchronized (this) {
          releaseBusinessObject(Z_ComplaintBOImpl.class);
     }
}
/**

  1. returns the complaint business object
  2. @return ComplaintBO the complaint Business object

*/
public synchronized Z_ComplaintBO getZ_ComplaintBO()
{
     return (Z_ComplaintBO)getBusinessObject(Z_ComplaintBOImpl.class);
}
}
.icss.intf.businessobject.complaint.Z_ComplaintBO;
……


public class Z_ComplaintBOImpl extends ComplaintBOImpl implements Z_ComplaintBO , BackendAware {
     private final String BACKEND_BO_NAME = “Z_COMPLAINT”;
     private BackendObjectManager bem = null;
     private Z_ComplaintBE backend = null;
     private OneOrderData complaintSelected;
     private String userId = “”;
     private String pwd = “”;
     /**
     

  1. Constructor

      */
     public Z_ComplaintBOImpl() { }


     public void setBackendObjectManager(BackendObjectManager bem)
     {
          this.bem = bem;
     }


     private Z_ComplaintBE getBackend() throws BackendException {
          if (backend == null) {
               backend = createBackend();
          }
          return backend;
     }


     private Z_ComplaintBE createBackend()
          throws BackendException {
          Props properties = new Props();
          properties.setProperty(Constants.PROP_USER, this.userId);
          properties.setProperty(Constants.PROP_PASSWD, this.pwd);
          properties.setProperty(this.BE_PROPERTIES_LANGUAGE_PARAM_NAME, this.getLanguage());
          
          try {
          backend = (Z_ComplaintBE)bem.createBackendBusinessObject(BACKEND_BO_NAME, properties);
          }
          catch (BackendException ex) {
               throw ex;
          }
          return backend;
     }


     public OneOrderData create(OneOrderData complaintDataForCreate, String productNo, String serialNo)
          throws IcssException {
          OneOrderData complaintCreateData;
          try {
               Z_ComplaintBE be = getBackend();
               
               complaintCreateData = be.create(complaintDataForCreate, productNo, serialNo);
               if ((complaintCreateData == null) || (complaintCreateData.getHeader().getId() == null) ||


(complaintCreateData.getHeader().getId().equals(“”))) {
                    throw new IcssException(“ComplaintBOImpl:create – Complaint number is empty”);
               }
          }
          catch (IcssException ex) {
               throw ex;
          }
          catch (BackendException ex) {
               throw new IcssException(“ComplaintBOImpl:create – Error in getBackend”);
          }


          return complaintCreateData;
     }


     <xi:include href=”$/modification/bom-config.xml#xpointer(BusinessObjectManagers/*)”/>
     <BusinessObjectManager name=”Z_CUSTOM-BOM”

className=”com.<client>.icss.impl.businessobject.Z_CustomerBusinessObjectManager” />     
</BusinessObjectManagers>
</textarea>

<br>Backendobject-config.xml<br>
<textarea rows=5 cols=80>
<backendobject xmlns:isa=”com.sap.isa.core.config” xmlns:xi=”http://www.w3.org/2001/XInclude

xmlns:xml=”http://www.w3.org/XML/1998/namespace“>
     <configs>
     <!– customer changes in backendobject-config should be done here by extending/overwriting the base configuration–>
          <xi:include href=”$
/modification/backendobject-config.xml#xpointer(backendobject/configs/*)”/>
          

Action


PART 2:


This part describes the enhancements that need to be done on the ABAP layer.

1. Copy the CRM_ICSS_CREATE_COMPLAINT to ZCRM_ICSS_CREATE_COMPLAINT.


image



Add IS_CUSTOMER_H Parameter

In the source code change the API call to accommodate the IS_CUSTOMER_H

2. Copy the CRM_COMPLAINT_API_CREATE to ZCRM_COMPLAINT_API_CREATE.

Add the import parameter

image


Add the below code :


To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply