on 08-03-2010 3:28 PM
Hi all,
I am working on an application, now the requirement is when a user will enter the vendor number and hit enter key from the keyboard (there will not be any button for this) the vendor information should get displayed on the screen such as vendor name and address. For this I have written the following code in the event 'on enter' for the field where user enters th evendor number. My code is grabbing the vendor information and getting it stored in the internal tabke ls_kred but now the problem is I don;t know how can I display this information on the screen.
DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node.
DATA lo_el_t_bseg TYPE REF TO if_wd_context_element.
DATA ls_t_bseg TYPE wd_this->Element_t_bseg.
DATA lv_lifnr TYPE wd_this->Element_t_bseg-lifnr.
data: wa_lifnr type lifnr,
ls_kred type vf_kred.
* navigate from <CONTEXT> to <T_BSEG> via lead selection
lo_nd_t_bseg = wd_context->path_get_node( path = `PRELIMINARY_POSTING.CHANGING.T_BSEG` ).
* @TODO handle non existant child
* IF lo_nd_t_bseg IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_t_bseg = lo_nd_t_bseg->get_element( ).
* alternative access via index
* lo_el_t_bseg = lo_nd_t_bseg->get_element( index = 1 ).
* @TODO handle not set lead selection
IF lo_el_t_bseg IS INITIAL.
ENDIF.
* get single attribute
lo_el_t_bseg->get_attribute(
EXPORTING
name = `LIFNR`
IMPORTING
value = lv_lifnr ).
wa_lifnr = lv_lifnr .
CALL FUNCTION 'FI_VENDOR_DATA'
EXPORTING
I_BUKRS = '001'
I_LIFNR = wa_lifnr
IMPORTING
E_KRED = ls_kred
EXCEPTIONS
VENDOR_MISSING = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please advice.
Thanks,
Rajat Garg
Hi,
There is nothing special to do here.
Assuming you have UI elements to display name and/or address on the screen (let's say as TextViews) and the 'text' property is bound to corresponding attributes in the context, then all you have to do after reading the data is to update the context with data from ls_cred.
Regards,
George
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi George,
This is my forst web dynpro application and I haven't got any training in this as well, so my question sounds little weird than please excuse me. What I have done is I have already done the forst two steps that you mentioned but I am not sure how can i get the last one done "After reading the vendor, just set the value of this attribute to ls_kred-name1"
Any Clue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.