Skip to Content
avatar image
Former Member

Enhancement Implementation

Dear experts,

have you tried enhancement implementation functionality?

Could you please give me an example of how to use enhancement option BusinessActivityExcludeCodeValues?

/*

  Add your SAP Business ByDesign scripting language implementation for:

  Enhancement Option: BusinessActivityExcludeCodeValues

  Operation: EXCLUDE_CODE_VALUES

  Script file signature

  ----------------------------

  Parameter: InputData of type BadiBusinessActivityExcludeCodeValuesImport

  Returns: BadiBusinessActvitiyExcludeCodeValuesChanging

  Note:

   - To use code completion, press CTRL+J.

*/

import AP.FO.Activity.Global;

var result : BadiBusinessActvitiyExcludeCodeValuesChanging;

return result;

Many thanks

Best regards

Linh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 30, 2015 at 08:44 PM

    Hi Linh

    The Enhancement Option : BusinessActivityExcludeCodeValues is similar to a BADI (exit) if you are familiar with ABAP.

    It will have 2 structures: 1 would be Input ->Data that will be available at runtime for which code can be restricted.

                                            2nd would be Output or Return Structure -> This should contain the filtered list (as per your code logic)

    The coding here is similar to any other ABSL script file.

    Hope this clarifies.

    BR
    Dedeepya

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Linh, Sorry for the delay in responding, hope its not too late for a code-snippet: Here you go -

      var result : BadiOpportunityExcludeCodeValuesChanging;

      var input : BadiOpportunityExcludeCodeValuesImport;

      var bus_types : BadiOpportunityCodeValue; input = InputData; var Oppt_UUID = input.RootObjectNodeReference.UUID; if (!Oppt_UUID.IsInitial()) { var opp_ctxt = Opportunity.Retrieve(Oppt_UUID);

      if ((opp_ctxt.IsSet()) &&

      (opp_ctxt.ProcessingTypeCode == "OPPT") && (opp_ctxt.OriginTypeCode.content == "ZUP"))

      { //var ls_btd = opp_ctxt.BusinessTransactionDocumentReference.GetFirst();

      var lt_bustype = result.BadiOpportunityCodeValue.Where(n => n.ListID == "BusinessType");

      if (lt_bustype.Count() > 0) { result.Clear(); bus_types.Content = "002";

      result.BadiOpportunityCodeValue.Add(bus_types);

      bus_types.Content = "001";

      result.BadiOpportunityCodeValue.Add(bus_types); }

      }

      } return result;

      As you can see from Above the structure "RESULT" contains the filtered list of values. An additional note to this, the RESTRICTCODE Badi works only for STANDARD fields and not for CUSTOM (extended) fields. Hope this clarifies. BR Dedeepya

  • Oct 30, 2015 at 04:51 PM

    Ngoc,

    By this, you can enhance the standard behavior of specific applications of the SAP cloud solution without modifying the standard solution. For example, you can define your own business logicfor determining, validating or mapping data.

    There are single/multiple use enhancements; Singles can be implemented only once in a solution. Multiple use can be implemented more than once in a solution.

    Hope this helps you.

    Regards.

    Alejandro.

    Add comment
    10|10000 characters needed characters exceeded