ITPub博客

首页 > 应用开发 > IT综合 > BAdI: Web Item "Individual Document"

BAdI: Web Item "Individual Document"

原创 IT综合 作者:zclouis 时间:2007-09-21 23:28:50 0 删除 编辑

BAdI: Web Item "Individual Document"

Use

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.

Use:

  • Display more properties for the document in the Web Application such as, for example, the last person to change the document and when this change was made.
  • Display the content of the document yourself.
  • Change or create links or pushbuttons for documents in the Web Application.

Standard settings

The BAdI can be used more than once and is not dependent on a filter.

Activities

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:

    1. In the dialog box, enter a name for the implementation of the Add-In and choose Create.
    The system displays the initial screen for creating Business Add-In implementations.
    2. On this screen, enter a short description for you implementation in the Implementation Short Text field.
    3. If you choose the Interface tab, you will notice that the system has filled in the Name of the Implementing Class field automatically, by assigning a class name based on the name of your implementation.
    4. Save your entries and assign the Add-In to a package.
    5. To edit a method, double-click its name.
    6. Enter your implementation code between the method ~. aund endmethod. statements.
    7. Save and activate your code. Navigate back to the Change Implementation screen.
    Note: You can also create an implementation for an Add-In and not activate it until later. If you want to do this, do not carry out the following step:
    8. Choose Activate.
    When the application program is executed, the system carries out the code in the method you wrote.

Example

Again you can find examples in the method documentation for the IF_EX_RSOD_ITEM_DOC interfaces.

Also see:

Methods

Modify (HTML) output

*****************************************************

Modify Output (HTML)

Functionality

You can use this method to change or reformulate for yourself the HTML generated from the "Single Document" item.

Applications:

  • Additional properties of the document, such as Last Changed By or Time of Change can be displayed in the Web application.
  • You can allow the content of the document to be displayed by yourself.
  • You can add links or pushbuttons used to change or display a document to the Web application.

Parameters

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:

  • C_PARAMETER_IS_INPLACE: Indicator: In place or not
  • C_PARAMETER_LINK_TO_BROWSER: Indicator: Links generated to document browser or not
  • C_PARAMETER_DEFAULT_URL: URL for error screen
  • C_PARAMETER_IOBJNM: Characteristic
  • C_PARAMETER_WWW_DOC_TYPE: Document type
  • C_PARAMETER_DOC_CLASS: Parameter document class
  • C_PARAMETER_TARGET_FRAME: Parameter frame (for frameset or IFRAME)
  • C_PARAMETER_TARGET_FRAME_LEVEL: Parameter Frame level (how often in frame. Hierarchy going up)
  • C_PARAMETER_CAPTION: Caption
  • C_PARAMETER_CLOSED: Closed
  • C_PARAMETER_GENERATE_LINKS: Generate links
  • C_PARAMETER_HEIGHT: Height
  • C_PARAMETER_HIDDEN: Hide
  • C_PARAMETER_ITEM_NAME: Render item name
  • C_PARAMETER_WIDTH: Width

I_R_SERVICE: Service class to determine URLs to change or create documents. Methods:

  • GET_URL_CHANGE_DOCUMENT Gets Url to change a document
  • GET_URL_CREATE_DOCUMENT Gets Url to create a document

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).

CONCATENATE 'L_CHANGE_URL

' " >

'alt="Edit Document" title="Edit Document" >'

INTO L_HTML.

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:

  • Document not found
  • Document not unique

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.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7941665/viewspace-970844/,如需转载,请注明出处,否则将追究法律责任。

上一篇: BAdI: Documents
下一篇: BAdI: Web Item
请登录后发表评论 登录
全部评论

注册时间:2011-04-21

  • 博文量
    40
  • 访问量
    126161