Ansicht
Dokumentation

/IPRO/MGT_BADI_SRCH - Search Text

/IPRO/MGT_BADI_SRCH - Search Text

PERFORM Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Implement this Business Add-In to provide methods for searching substrings inside a full text.

The Business Add-In consists of the methods described below, which can be used instead of the standard algorithm.

This method is used to return the plain text of a clause/element from its full text.

The following import parameters are provided:

  • IV_FULLTEXT
    Full text of the clause/element in the raw format.
  • IV_FORMAT
    Format of the text (PDF, HTML).
  • IV_ENCODING
    Encoding of the clause/element text.

The following export parameters must be provided by your coding:

  • RV_STRING
    Plain text of the clause/element of the full text.

This method is used to search a substring inside the raw text of a clause/element.

The following import parameters are provided:

  • IV_FULLTEXT
    Full text of the clause/element in the raw format.
  • IV_SUBSTRING
    String to be searched for (plain string).
  • IV_FORMAT
    Format of the text (PDF, HTML).
  • IV_ENCODING
    Encoding of the clause/element text.
  • IV_IGNORE_CASE
    Indicator that specifies whether the search should be case-sensitive ('') or not ('X'). The default value is 'X'.

The following export parameters must be provided by your coding:

RV_CODE
Indicator that specifies whether the substring is found ('X') or not in the full text.

This method is used to search a substring inside the full text of a clause/element.

The following import parameters are provided:

  • IV_FULLTEXT
    Full text of the clause/element as a string.
  • IV_SUBSTRING
    String to be searched for (plain string).
  • IV_IGNORE_CASE
    Indicator that specifies whether the search should be case-sensitive ('') or not ('X'). The default value is 'X'.

The following export parameters must be provided by your coding:

RV_CODE

Indicator that specifies whether the substring is found ('X') or not in the full text.

After calling up the IMG activity, a dialog box appears, in which you can enter a name for the implementation.

If you have already made other implementations for this BAdI, another dialog box appears, in which the existing implementations are displayed. In this case, choose Create, and proceed as follows:

1. In the dialog box, enter a name for the BAdI implementation in the Implementation field, and choose Create.

The screen for creating BAdI implementations is now displayed.

2. Enter a short text for the implementation in the Short text for implementation field.

3. From the tab index, choose Interface.

The Name of implemented class field is already filled on the tab page, as a class name was automatically assigned to the implementation when you named it.

4. Save your entries, and assign the implementation to a development class.

5. Place the cursor on the method, and double-click to enter method processing.

6. Enter the coding for the implementation between the statements method ~ and endmethod.

7. Save and implement your coding. Return to the Edit Implementation screen.

8. Save the entries on the Edit Implementation screen.

Note: You can also create an implementation, and then activate it at a later time. In such a case, end the processing stage at this point.

9. Choose Activate.

The coding you stored in the methods will be run when the application program is executed.

By default, method GET_PLAIN_TEXT only processes text in HTM or HTML format. It assumes that the full text should be an HTML text in raw format and strip all tags before translating some special characters (for example CR/LF to '', " to '"', etc.) and returning the rest of text. Method SEARCH also processes format 'HTM' or 'HTML' only. It translates the raw string into string with the given encoding and performs a simple match among it with the relevant substring, without regarding any HTML tags inside the full text. Method SEARCH2 is similar, except that the step to translate from raw string to string is not included here.

For more information on using Business Add-Ins, see the SAP Library under Basis Components → ABAP Workbench (BC-DWB) → Changing the SAP Standard (BC) → Business Add-Ins.






PERFORM Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 5014 Date: 20240329 Time: 074801     sap01-206 ( 73 ms )