cancel
Showing results for 
Search instead for 
Did you mean: 

Custom check box added. Need to shift it at Specific position

devrajsinghr
Active Participant
0 Kudos

Hi Friends,

I need a your valuable inputs on the below requirment.

- I have enhanced INCL structure for SC and Cross doc.

- Implemented metadata config

- Enhanced the webdynPro View and bind it with this custom field.

Now I want this field at a spcific position in that view. Any suggesitons?

I have attached the screenshots for the position.

Regards

Dev

Accepted Solutions (0)

Answers (1)

Answers (1)

RicardoRomero_1
Active Contributor
0 Kudos

Hi Devraj,

I can't see the screenshot. But, if you have created an enhancement point in the WD view you can move the field where you want.

You only need to add the attribute to the context using the wizard: Attribute from components of strcuture.
And then add the field manually to the layout.

You can drag and drop the UI Elements to move it to the position you want or use the context menu UP/DOWN.

I did it a lot of times and works fine, if you have any problems let us know.

Regards,

devrajsinghr
Active Participant
0 Kudos

Thanks for your response Ricardo..I tried to move the position manually but it was not at the exact position I am looking for..

Pls find the file

RicardoRomero_1
Active Contributor
0 Kudos

Hi Devraj,

For me it's working fine, please follow these steps:

1- Go to WD /SAPSRM/WDC_DODC_SC_I_BD view V_DODC_SC_I_BD

2- Add your custom field to the context node ITEM_BASIC_DATA using the wizard: "Attribute from components of strcuture"

3- Go to the Layout to the RIGHT CONTAINER and create a label and a check box for your field and do the binding.

    Change the property Layout Data of the label to "MatrixHeadData".

4. Drag and drop the UI elements to the position you want.

Hope this help you.

Regards,

Ricardo.

Former Member
0 Kudos

Hi,

I reckon the new field you have added[ by config ] is in 'LEFT_CONTAINER', so dynamically push the field to 'RIGHT_CONTAINER'  by creating a post exit by Enhancement spot for the method WDDOMODIFYVIEW of view V_DODC_SC_I_BD.

IF first_time = abap_true.

     lo_ref ?= view->get_element( 'LEFT_CONTAINER' ).

     CALL METHOD lo_ref->get_child

           EXPORTING

             id        = 'Custom Field name_attr'

           RECEIVING

             the_child = lr_Field.

      CALL METHOD lo_ref->get_child

           EXPORTING

             id        = 'Custom Field name_label'

           RECEIVING

             the_child = lr_Field_label.

* "      move new field to right side container

       lo_ref2 ?= view->get_element( 'RIGHT_CONTAINER' ).

  " remove the child of field and it's label and  append to right side container.

         CALL METHOD lo_ref->remove_child

           EXPORTING

             id        = field_LABEL'

           RECEIVING

             the_child = .

         CALL METHOD lo_ref->remove_child

           EXPORTING

             id        = 'field_ATTR'

           RECEIVING

             the_child = .

*create a input feild

         lr_capex_ip = cl_wd_input_field=>new_input_field( id = lr_capex2_ip->id view =  view

                       bind_value = 'ITEM.newfield'  ).

*create a input feild lable

         lr_capex_lb = cl_wd_label=>new_label( id = lr_capex2_lb->id label_for = lr_capex_ip->id ).

         cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_capex_lb ).

*         Add label to Container

         lo_ref2->add_child( lr_capex_lb ).

              cl_wd_matrix_data=>new_matrix_data( element = lr_capex_ip ).

*         Add input field to Container

         lo_ref2->add_child( lr_capex_ip ).

" bind the read only context of item

" this will add the new child field  at the bottom of the right side container ,

Check if it is ok that you can push the new field in to CONT_PRICE container .

if you want the new field after node CONT_PRICE ,Positioning of the UI elements is done by changing the element hierarchy..

This is the Information i have which will help you...

RicardoRomero_1
Active Contributor
0 Kudos

Why are you trying to do it by code?

Do it in design time and works fine...

The customizing still working although you add the field manually in the WD. If you have a dynamic class and method assigned to this field in the SPRO is still working...

Former Member
0 Kudos

Ricardo Romero wrote:

Why are you trying to do it by code?

if we are not added the field manually in WD , we need to do it by coding,

{as there won't be a physically exciting child in WD and which is dynamically created from SPRO custom field control}.

I reckon, By using SPRO configuration we can add custom fields to the Shopping cart with out changing the WD/layout,

RicardoRomero_1
Active Contributor
0 Kudos

yes, you can add custom fields to the shopping cart using SPRO without changing the WD/Layout, but  you can't move the field between two standard fields.

once you add the field using SPRO you does not need to move it by code, you can see my screenshot, I added/moved it manually.

I think the easiest way to do it is adding manually the field to the context node and the layout, in fact you already have an enhancement point in the WD... so, why not?

EDIT:  sorry, I didn't realize I wasn't speaking with the author of the thread.