on 06-02-2011 12:41 PM
Hai all,
I am having an ALV table in which I want to display Requisition number by default using a value which i generated randomly and it is stored in a variable.
While displaying ALV table my req number field should display that value by default when ever user is inserting a row( all the coloumns n my alv are editable.
Is it possible??
Kindly give some suggestions.
Thanks in Advance,
Nalla.B
It is possible, you have to pass your default value to the context node/attribute binded to the ALV data node.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Kris,
I took help from ur link and i declared a global attribute request_number.
and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
DATA bill_details TYPE REF TO zdom_bill_detail.
LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
bill_details ?= <wa_row>-r_value.
IF bill_details->REQ_NUMBER IS INITIAL.
DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
lo_el_bill_detail->set_attribute(
EXPORTING
name = 'REQ_NUMBER'
value = wd_comp_controller->request_number
).
Wen am setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
lo_el_bill_detail->set_attribute(
name = `REQ_NUMBER`
value = wd_comp_controller->request_number ).
Pls give some suggestions,
Thanks in Advance,
Nalla.B
Hi Nalla,
You are inserting one row everytime?? when click on add row button you want to add?
Or you want to display alv with one value by default?
Check this,.. when you are using standard append row in alv, to set defalut value
http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproABAP-ALVControllingStandard+Buttons
Cheers,
Kris.
Edited by: kissnas on Jun 2, 2011 2:01 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.