cancel
Showing results for 
Search instead for 
Did you mean: 

FITE_VC_RECEIPTS Dropdown List for Custom Column

kumar_kiran2
Participant
0 Kudos

Dear All,

I Have requirement to add dependent name in Medical Expenses.

I Enhanced this WDI -->  FITE_VC_RECEIPTS( Receipts for Expense Report) in View called RECEIPTS_VIEW.I added New Column and also i added this field in standard structure,  i am able to see my field in Portal. Now the problem is i want that field as drop down, so i made it as a dropdown.

I want to display the values in this drop down.where can i write my code in this standard application.

I checked enhancement but WDDOINIT no enhancement spot there. i try to find the BADI TRIP_WEB_CHECK -> USER_CHECK_LINE_OF_RECEIPTS i put break point it is not triggering i guess this will trigger after enter the values in Portal.

Please help me.

Thanks in Advance.

Thanks,

KKP

Accepted Solutions (1)

Accepted Solutions (1)

manigandan_d2
Explorer
0 Kudos

Dear KKP,

I think you requirement to maintain one new field in UI Table, So please follow the steps for that

  1. you need to maintain an Attribute in the RECEIPTS node for the new field
  2. assign/Map/Bind the attibute to the new UI table collumn as DROPDOWNBYKEY
  3. Write the logic to poulate the value_help to the RECEIPTS node-> Attribute

Based on your logic you are populating the value to the wrong node. please correct accordingly,

then it will work i think,

let me know if you require more information.

Regards,

Mani

kumar_kiran2
Participant
0 Kudos

Thank you Mani,

I will let you know once i change my WDA. Thank you.

Thank,

Kiran

manigandan_d2
Explorer
0 Kudos

If possible, call me....

kumar_kiran2
Participant
0 Kudos

Hi Mani,

Sure can you please mail me your contact number of personnel email id to kiran.bbgm@gmail.com

Thank you,

Answers (4)

Answers (4)

kumar_kiran2
Participant
0 Kudos

Thank you very much all giving big support.

Thread Closed.

Thanks,

KKP

kumar_kiran2
Participant
0 Kudos

Dear Jan/Jetendra/Lukas,

I did as you mentioned, i wrote code in Pre-exit but now i have a problem to find the context node. i wrote code like this

"Reference variables
   data:
         lo_nd_emp_det      type ref to if_wd_context_node,
         lo_nd_emp_det_info type ref to if_wd_context_node_info,
         lo_el_emp_det      type ref to if_wd_context_element.

   types:
         begin of ty_p0021,
         FAMSA TYPE FAMSA,
         FANAM TYPE PAD_VORNA,
         FAVOR TYPE PAD_NACHN,
         end of ty_p0021,
         ty_value_set type wdr_context_attr_value.
   data:
       ls_p0002       type ty_p0021,
       ls_value_set   type ty_value_set.

   data:
         lt_p00021     type standard table of ty_p0021,
         lt_value_set type standard table of ty_value_set.

"Navigate from  to  via lead selection
   lo_nd_emp_det = wd_context->get_child_node( name = wd_this->wdctx_dpname ).


"Get node info
   lo_nd_emp_det_info = lo_nd_dpname->get_node_info( ).
"Select the all employee details
    select FAMSA
           FANAM
           FAVOR
      from pa0021
      into table lt_p00021 WHERE UNAME = sy-uname.


"Put Employee lines into value set
     loop at lt_p00021 into ls_p00021.
       ls_value_set-value = ls_p00021-FAMSA.
       concatenate ls_p00021-FANAM ls_p00021-FAVOR into ls_value_set-text separated by space.
       append ls_value_set to lt_value_set.
       clear  ls_value_set.
     endloop.


" Assign value set
     call method lo_nd_emp_det_info->set_attribute_value_set
       exporting
         name      = 'FANAM'
         value_set = lt_value_set.

The error is

Field "WDCTX_DPNAME" is unknown. It is neither in one of the specified  

Please correct me if i am wrong.

my node is like this,


How to pass the values to FANAM, please help me thanks.

Thanks,

KKP

Former Member
0 Kudos

Hi KKP,

Where did you place the code above? For example componentcontroller or which view?

It looks to me like code is ok (and you have the Web Dynpro Code Wizard?) but error you get is because it can't find the Context node DPNAME.

Please make sure this context node is available in the view/componentcontroller where you have placed this code.

Another thing - in RECEIPTS_VIEW I can see that the context node DPNAME is not derived from componentcontroller (no right facing arrorw). I don't know if that is a mistake or not.

Br Jan

kumar_kiran2
Participant
0 Kudos

Hi Jan,

Thank you for reply,

I am writing this code in Component controller Pre-Exit.

Yes your wright there is a miss mapping, after re mapping the code is OK but the problem is i can't see the dropdown values in output. in debug mode i am able to see it. Please see the below screen shot.

Field attributes are like below.

Former Member
0 Kudos

I just checked a code example I have. But mine is for dropDownByKey - not dropDownByIndex like yours. It is probably something really simple that is wrong.

I can see that one difference in our code is that you write:

lo_nd_emp_det_info = lo_nd_dpname->get_node_info( ). where I use get_element( ) instead of get_node_info - not sure if that makes a difference.

I can also supply my code but as I said it is for different drop down type?

Br Jan

kumar_kiran2
Participant
0 Kudos

Hi Jan,

Please pass your code i will look and i will try that too but the problem is why it is not showing dropdown arrow in portal? can you please tell me?

Thank you,

sreenu_b2
Explorer
0 Kudos

Hi Kumar,

Change the UI element to Drop Down By Key and check once please

kumar_kiran2
Participant
0 Kudos

Hi

If i change to dropdownby key i am getting dump. Please advice me.

Thank you,

Former Member
0 Kudos

This works for me. If adapt your code to follow the same approach it should work:

   DATA: BEGIN OF L_YTM_COUNTRY_CITY_LINE,

          COUNTRY   TYPE YTM_COUNTRY_CITY-COUNTRY,

          CITY      TYPE YTM_COUNTRY_CITY-CITY,

        END OF L_YTM_COUNTRY_CITY_LINE.


    DATA LI_ITAB LIKE SORTED TABLE OF L_YTM_COUNTRY_CITY_LINE WITH UNIQUE KEY TABLE_LINE.

*   navigate from <CONTEXT> to <GENERAL_DATA> via lead selection

    l_node = wd_context->get_child_node( name = wd_this->wdctx_general_data ).


*   get element via lead selection

    L_EL_GENERAL_DATA = l_node->get_element(  ).

    IF L_EL_GENERAL_DATA IS BOUND.

      "Retrive selected country

      L_EL_GENERAL_DATA->get_attribute(

        EXPORTING

          name =  'COUNTRY'

        IMPORTING

          value = lv_country ).

      select CITY

        from YTM_COUNTRY_CITY

        into corresponding fields of TABLE LI_ITAB

        where COUNTRY EQ lv_country."SELECTED COUNTRY


      LOOP AT LI_ITAB INTO L_YTM_COUNTRY_CITY_LINE.

        L_VALUE-VALUE     = L_YTM_COUNTRY_CITY_LINE-CITY.

        L_VALUE-TEXT      = L_YTM_COUNTRY_CITY_LINE-CITY.

        INSERT L_VALUE into table LI_VALUESET.

        ENDLOOP.


      L_NODE_INFO->SET_ATTRIBUTE_VALUE_SET(

        NAME = 'LOCATION'

        VALUE_SET = LI_VALUESET ).


    ENDIF.

sreenu_b2
Explorer
0 Kudos

Hi ,

CHnage the cardinality to 1:X

Former Member
0 Kudos

Hi KKP,

It sounds like you should be able to achieve this using enhancement. In WDA you get pre- post- and overwrite-exits to do your enhancements - you don't get enhancements spots in the standard method. Is that where you went wrong?

The badi you mention works fine for us and we use exactly that method in our implementation of the BADI but for extra check of receipts.

You might also be able to use BADI TRIP_WEB_CUSTOMIZING. I used it for manipulating the drop down list of expense types visible in portal. But as your field is a new one I'm not sure.

Br Jan

Lukas_Weigelt
Active Contributor
0 Kudos

I checked enhancement but WDDOINIT no enhancement spot there.

You don't need explicit enhancement spots when enhancing WebDynpro ABAP. You can create an explicit post/pre/overwrite exit instead and implement your code there to initially fill your value help.

Since you said you already did an enhancement for the component for means of altering the view, I wager you simply weren't aware how to approach when enhanceing methods example:

Does this help or did I understand incorrectly?

Cheers, Lukas

Former Member
0 Kudos

in webdynpro method there instead of enhancement option we have preexits and post exits and overwrite

for enhancemnet in webdynpro go thriugh below link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/700317da-bd79-2c10-368e-8f18bf5d8...

preexits is use if you want to add some logic and call before original logic

postexits is used when you want to call logic after original logic

overwrite is uesd when you want to overwrite original logic

reward if helpful

kumar_kiran2
Participant
0 Kudos

Thank you all,

I will try and get back to you. Thank you very much.

Thanks,

KKP