on 01-17-2013 7:50 AM
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
Dear KKP,
I think you requirement to maintain one new field in UI Table, So please follow the steps for that
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mani,
Sure can you please mail me your contact number of personnel email id to kiran.bbgm@gmail.com
Thank you,
Thank you very much all giving big support.
Thread Closed.
Thanks,
KKP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in webdynpro method there instead of enhancement option we have preexits and post exits and overwrite
for enhancemnet in webdynpro go thriugh below link
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
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.