Entering content frameThis graphic is explained in the accompanying text Example: Customer-Specific Input Help for Currencies Locate the document in its SAP Library structure

You want to replace the standard Input Help for currencies with a customer-specific Input Help by hiding a column.

To do this, proceed as follows:

  1. Define a new class ZPicklistCurrency. This class must be implemented by Interface IPicklistCustomer.
  2. Implement method getColumnId in class ZpicklistCurrency. In this method, define field F_CURRENCY as the return value.
  3. Implement method getPicklistValues in class ZPicklistCurrency. Define the customer-specific Input Help in this method.

 

Java Source Code

 

package com.sap.expense.customer.examples;

 

import com.sap.expense.tools.DBHelper;

import com.sap.mycats.basics.tools.badi.*;

import com.sap.mycats.basics.customer.userInterface.IPicklistCustomer;

 

 

/** The following record must be defined in the customer file

* C:\me\wwwroot\te_customer\extensions\ci_records.xml

* <record name="ZPICKLIST_CURRENCY">

* <fields>

* <field name="F_CURRENCY" type="E_F_CURRENCY"/>

* <field name="CURRTXT" type="E_CURRTXT"/>

* <field name="RATE" type="E_RATE"/>

* </fields>

* </record>

*/

public class ZPicklistCurrency implements IPicklistCustomer {

 

public final static String CURRENCY = "F_CURRENCY";

public final static String ZPICKLIST_CURRENCY = "ZPICKLIST_CURRENCY";

 

 

public ITableReadWrite getPicklistValues (char anApplication,IRecordReadOnly aRecord) {

ITableReadWrite picklistCurr;

 

try {

ITableReadOnly sapPicklistTable = new DBHelper().select("TRAVEL_CURRENCIES");

IRecordReadOnly sapPicklistRecord

= new RecordFactory().createRecord("PICKLIST_CURRENCY");

IRecordReadWrite zRecord

= new RecordFactory().createRecord(ZPICKLIST_CURRENCY);

ITableReadWrite zTable

= new TableFactory().createTable(ZPICKLIST_CURRENCY);

int count = sapPicklistTable.getRowCount();

for (int i = 0; i < count; i++) {

sapPicklistRecord = sapPicklistTable.getRecordReadOnly(i);

zRecord.setCorrespondingFields(sapPicklistRecord);

zTable.appendRecord(zRecord);

}

picklistCurr = zTable;

} catch (Exception e) {

e.printStackTrace();

picklistCurr = null;

}

return picklistCurr;

}

 

public String getCoulumnId () {

return CURRENCY;

}

 

public String getColumnTitle () {

return null;

}

}

 

 

 

Leaving content frame