cancel
Showing results for 
Search instead for 
Did you mean: 

How to add Custom Fields in Web Dynpro

Former Member
0 Kudos

Hi Friends,

In APO side there is a transaction -> /n/sca/ich_rr_na

Whenever you call this transaction automatically an internet browser starts.

I have to add 2 custom fileds in this screen.

I have found out that in the backend the Webdynpro Component used for this is -> /SCF/UIWD.

The View which is responsible for loading the screen is -> "MAIN" which contains one ViewContainerUIElement (Say, X).

Now X itself contains 4 ViewContainerUIElements (Say, X1,X2,X3,X4).

I am concerned about X2 only.

But X2 internally points to another component -> /SCF/BSP2WD

This component has a TransparentContainer(Say, Y) to load the screen.

Hence, according to my understanding, the screen wihich is getting populated in the browser is due to Y.

If it were a static screen (having say N no. of fields), I could have added another 2 fileds by following the method of ENHANCEMENT. But this is not the case.

My qus. is in this scenario how to add Custom fields in Y so that it will be reflected in the browser and do some coding for that.

Regards,

Debi

Accepted Solutions (1)

Accepted Solutions (1)

former_member1151507
Participant
0 Kudos

Hi Debi,

In /SCF/BSP2WD component, in the Trnasparent Container (Y) are all the fiedls created dynamically ?? If so, they must have created in WDDOINIT or WDDOMODIFYVIEW.

Here also using Enhancement, we can add the Custom fields in Pre-Exit/Post-Exit.

Regards,

Manogna

Former Member
0 Kudos

Thanks Manogna for your reply.

I think the UI elements are generated at run time Because in the layout tab i can find a TransparentContainer and in the Context tab i can find 4 context nodes but none of the context node is binded to the TransparentContainer.

Is there any other way of finding wheather the TransparentContainer is binded to any variable or internal table ?

Please correct me if i am wrong.

Regards,

Debi

former_member1151507
Participant
0 Kudos

Hi Debi,

We do not bind any context node to the Transparent Container. If you are unable to find any UI elemnts in the Layout, then the UI elements must have created dynamically. If so, please check WDDOINIT or WDDOMODIFYVIEW methods for the related code.

Regards,

Manogna

Former Member
0 Kudos

Thanks for your valuable information.

I should mention that due to some technical problem, i am unable to find the "Layout Preview". When i click "Show/Hide Layout Preview" button, the error tells that "If you do not yet have a user ID, contact your system administrator".

In the method "WDDOMODIFYVIEW", the screen is getting loaded at run time.

Regards

Debi

Sharathmg
Active Contributor
0 Kudos

In the WDMODIFYVIEW method of the view, check the code.

In the code, they would obtain reference to the transperant container. Then build individual element and add the elements to the transperant container.

Try to go through and understand the flow.

Then, you need to build your UI element int he same manner and add it to the transperant container.

Try to maintain the same procedure to build and add Ui elements to the transperant container.

Regards,

Sharath

former_member1151507
Participant
0 Kudos

Here is some sample code:

da

lo_container ?= view->get_element( 'CONT2_TC' ).

former_member1151507
Participant
0 Kudos

Here is some sample code to add a TextView UI element:

data lo_container TYPE REF TO cl_wd_uielement_container.

data lo_txt_vw TYPE REF TO cl_wd_text_view.

lo_container ?= view->get_element( 'CONT_TC' ).

lo_txt_vw = cl_wd_text_view=>new_text_view(

text ='Test'

design = cl_wd_text_view=>e_design-header3

h_align = cl_wd_text_view=>e_h_align-center ).

cl_wd_grid_data=>new_grid_data( element = lo_txt_vw ).

lo_container->add_child( lo_txt_vw ).

Regards,

Manogna

Answers (0)