This Business Add-In (BAdI) can be utilized in the usage of documents on BW objects.
With this BADI you are able to change HTML created from "Individual Document" items or specify it entirely yourself.
The BAdI can be used more than once and is not dependent on a filter.
After you call the IMG activity, the system displays a dialog box where you enter a name for the implementation.
If implementations of this Business Add-In have already been created, the system displays them in a dialog box. You then choose one of them by choosing Create, and continue as follows:
Again you can find examples in the method documentation for the IF_EX_RSOD_ITEM_DOC interfaces.
You can use this method to change or reformulate for yourself the HTML generated from the "Single Document" item.
I_R_PAGE: Reference to the page, that is, to the template of the Web application.
For example, you can use method
I_R_PAGE->GET_TEMPLATE_NAME to get the technical name of the template.
I_R_ITEM: Reference to the Single Document item.
You can use the attribute I_R_ITEM->N_NAME to access the name of the item (as maintained in the Web Application Designer).
You can also use the attribute I_R_ITEM->N_R_ATTRIBUTE to access the attributes of the item. In the following example, the system gets the value of the parameter DOCUMENT_CLASS (Document class):
L_DOCUMENT_CLASS = I_R_ITEM->N_R_ATTRIBUTE->GET( ID = I_R_ITEM->C_PARAMETER_DOC_CLASS ).
Additional properties of the item:
I_R_SERVICE: Service class to determine URLs to change or create documents. Methods:
Example: An HTML fragment is generated in the following code excerpt representing a pushbutton used to changed the current document:
DATA: L_CHANGE_URL TYPE STRING.
DATA: L_HTML TYPE STRING.
L_CHANGE_URL = I_R_SERVICE->GET_URL_CHANGE_DOCUMENT( I_R_DOC = I_R_DOC).
' " >
'alt="Edit Document" title="Edit Document" >'
I_R_DOC: Reference to displayed document.
This parameter is initial unless one or more documents were found.
I_TH_DOC. Table of all found (or suitable) documents.
I_ERROR: An error occured with the selection. The reasons for this error can include:
C_HTML: HTML generated from item as string.
This can be changed or enhanced. For example, you can build an HTML table with 2 rows. You then insert the HTML code generated by the item in the first cell. In the second cell, you add your personal HTML. You then return the entire code in the parameter C_HTML.
来自 “ ITPUB博客 ” ，链接：http://blog.itpub.net/7941665/viewspace-970844/，如需转载，请注明出处，否则将追究法律责任。