Requirement: Create a chip that provides information about the Airplanes.
The information about the airline carrier is available in the table SCARR. We need to create a webdynpro component that supply the information about the carrier and create a CHIP for it.
Procedure:
Step 1: Go to the Tcode SE80 and create a webdynpro component.
Assign the component to the package or save it in the local object.
Step 2: Go to the context tab of the component controller and create a context node for the table structure scarr.
Enter the name for the node and provide the dictionary structure as scarr and click on add attributes from the structure to add attributes.
Select all the attributes and press enter.
Context node will be created as below.
Step 3: Go to the methods tab of the component controller and create a method to fill the context node. Note : Method has to be an Interface method
Create an importing paramter for the method.
Write the following code inside the method.
Code:
DATA LO_ND_CARRIER TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_CARRIER TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_CARRIER TYPE WD_THIS->ELEMENT_CARRIER.
LO_ND_CARRIER = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_CARRIER ).
LO_EL_CARRIER = LO_ND_CARRIER->GET_ELEMENT( ).
SELECT SINGLE * INTO LS_CARRIER
FROM SCARR
WHERE CARRID = IS_CARRIERS-CARRID.
LO_EL_CARRIER->SET_STATIC_ATTRIBUTES(
STATIC_ATTRIBUTES = LS_CARRIER ).
Step 4: Go to the layout tab of the view controller and create the layout to display the airline details.
In the context tab of the view controller Drag and drop the context node from the component controller to view controllers context.
In the layout tab use the code wizard to create the form. Select the form and click on continue.
Specify the context node and press enter.
Arrange the layout and activate the whole component.
Step 5: Right click on the component and create a webdynpro chip for the component.
Usually we used to create an webdynpro application to run the component, instead of creating the webdynpro application we are creating the webdynpro chip which can be integrated in other application using page buider of side panel.
Enter the name for the chip and press enter.
Enter the display name and description for the chip. Remember the display name of the chip. This will be required while adding the chip to side panel.
Create a inport for the webdynpro component.
Select the interface method created and click on enter.
Port will be created as below.
Click on create parameter to create a parameter to the port.
Select the field carrid and press enter.
Click on show tag button to add a tag to the parameter and click on create to create the tag.
Enter the name of the tag as carrid.
Save the webdynpro CHIP.
We have now created the webdynpro chip.
0 Comments:
Post a Comment