on 10-11-2009 6:44 AM
hi
thanks for the reply.
the requirement is like this. once i enter the details in the selection screen and execute i need to see the results in an ALV. once the results are displyed in the ALV i need to have a checkbox at the left side of each entry. i will select some of the entries and click on some button on the ALV table, this should create another ALV table below the first ALV table. in this table also we will have checkboxes before each entry. once user selects some entries and click on some buttom n the second ALV table , another ALV should be displyed below the second ALV table.
is there any blog or thread where i can get some coding or guidance for this kind of requirement?
thanks
hi experts,
Any suggestions/ help on this?
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Now totally there are 4 ALV right as per your requirement.
First create the compoent usages for these ALVs. Refer to basic tutorials for ALV.
Now, design the nodes for the respective nodes in the component controller and map them to the respective views.
Create 3 views, for Input, Main, Detail views. Under each Transparant container create view container UI elemnet.
Create compoenent usage for the Main table in MAIN view, 3 other ALVs for the DETAIL view.
Also map the respective DATA nodes of the ALV to the respective nodes.
For each node create a CHKBOX type char1.
Now,
Get the data based on the inout fields and fill the table & bind this to the MAIN node of the ALV.
Now for creating checkboxes an for ALV refer this link.
Implement the ONCLICK action for all those ALVs.
Get the tbale entires based on the CHECKED(X) records.
Create the 2 context attributes for the visibility (wdui_visibility) and bind the VISIBILE propety of the TCO to the last 2 ALVs.
Hope it is clear till now. Please let me know once you are done till this.
Regards,
Lekha.
hi Lekha,
i developed the program as u suggested. i need some help here. i have added the checkboxes at each line. now lets i have added some button in the tool bar of ALV and i select some 3 entries in teh alv and click on the button. i need to read those entries which are selected by me in the action handler method of the button. how do i do this?
thanks
Hi,
Please refer this link for my reply's -
How to read those entries. You can write the code in that button handler(create a method for this).
Create a event handler for button for that ALV under methods tab (FUNCTIONS).
Get the function Id(button Id) and call the respective method.
In the methods tab of that view - create
ON_FUNCTION Event Handler ON_FUNCTION INTERFACECONTROLLER ALV1
Now in this handler -
if r_param->id eq 'SAVE'. "if buttn id is SAVE
wd_this->check_data( ). "Create a method and write the code in this method
endif.
Also, hope you have bound the visible proerpty of the TCO(transparent container) based on the
entries in 1st table, get the table data for 2nd table. If entries found for 2nd table set the visibility of the 2nd TCO.
Is this clear.
Regards,
Lekha.
Edited by: Lekha on Oct 13, 2009 11:41 AM
Hi,
Use this code -
DATA lv_r_helper_class TYPE REF TO if_wd_select_options.
lv_r_helper_class = lo_interfacecontroller->init_selection_screen(
).
lv_r_helper_class->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
Refer these links for variants -
Regards,
Lekha.
Edited by: Lekha on Oct 18, 2009 9:31 AM
hi Lekha,
I need to your expertise again.
in the selection screen i have sales order fied ( VBELN ). i want to add a F4 help to this field. if you go to va03 and press F1 on the sales order field -> go to technical information, u will find that VMVA collective search help assigned to the field. I want to assign this searh help to my field on the selection screen. i tried exploring the method "add_selection_field" and its various parameters but to no avail.
thanks
Hi,
Do you want to color a row that is checked Is that so.
Refer this wiki -
http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPWebDynproALV-ChangeCellColourbasedonContent
This wiki will color for single cell, you can apply the same for all columns.
Regards,
Lekha.
Edited by: Lekha on Oct 23, 2009 12:07 PM
hi lekha,
regarding the variant creation for ABAP webdynpro reports, i came across a blog series where the variant cration functionality was built.
in this blog series author had explained for a simple scenario with two fields on the selection screen. what i would like to know from you is, is it possible to make this functionality generic. i mean develop a component which will be used by other WD components to achieve the variant creation functionality. if so, can you give me some guidance on how to start this?
thanks
Hi,
You mean to say, you want to have this new functionality as a component usage in others so that other applications can also
use the same.
I guess, you can do.
But, you need to have a clear understanding on the current functionality then you need to deisgn the tables to
store the component names, variant Id etc....as the scope is wide.
The new component should have all the inputs that are required to ahcieve the functionality so that the calling component
passes the required information/data.
design a custom class and have all the methods with the respective coding and call this method in the new component.
Regards,
Lekha.
hi Lekha,
I will definitely work on this. one of the thing i am worried about is how to call the views from used component in the current component. my scenario would some thing like this
component A will have a selection screen with some fields and will have two buttons "save variant" and "get variant".
component B ( which will be the generic component) will have two views one for "saving variants" and another one for "searching the variants". the first view will have two buttons "OK" and "CANCEL". the second view contains "search" and "apply" button.
when i click on "save variant" button in component A, it shud call view "save variant of component B ( as a pop up / in a new window), if the user clicks on "OK" or "CANCEL" it shud go back to view of component A. similarly if user clicks on "get variant" button, it shud call " searching the variant" view in a new pop up / window and user searches for variant and clicks on "apply" , those values should come back to component A view.
how do i call the views in pop up window and also the fields in the selection screen might vary from component to component so my method for saving variants in component B shud have a generic type as import parameter ( i am not able to put it in correct words, hopu u understand what i am trying to say).
thanks
Hi,
Please refer these threads for calling view of a component usage -
In the current component, create 2 alv usages and create 2 windows(Sub) inaddtion to current component window(MAIN).
In this case, Sub1 will have the 1st view of the comp B, Sub2 will have the 2nd view of CompB ie embed the view in view container.
For Popup -
When you have a used component, in the code wizard there is a option to open a popup for component usage.Try to use that option.
SAVE variant button, using the popup for component usage option call the SUB1, similarly with other button also.
Hope this is clear till this part.
I guess you need to have some custom tables for this to save variant so that it is easy for you to get the same.
how do i call the views in pop up window and also the fields in the selection screen might vary from component to component so my method for saving variants in component B shud have a generic type as import parameter ( i am not able to put it in correct words, hopu u understand what i am trying to say).
One thing you do, In the comp B create parameters for that Window so that you can use the same for Application parameters
when you call this CompB then you can pass these values to these parameters which are used in CompB.
In this case, you have to use the URL of application(of comp B) and pass the parameters to this application and open a window
in popup...
Regards,
Lekha.
Edited by: Lekha on Oct 26, 2009 1:38 PM
Hi Lekha,
I am in the process of developing the generic comp for saving variants. i had stuck up at one point. lets say i have comp A with some 10 fields on the selection screen. now i will have a method in comp B
( which is generic comp) which is a interface method, which will have input parameters for component name ( which is using comp B, in this case it is comp A) and view name and also the ids of sel screen fields. once i give these details
to the method of comp B, can i access the values entered on the sel screen of comp A inside this method?
by the way i do not want to define the comp usage of comp A in comp B, as comp B is a generic comp. i have defined the comp usage for comp B in comp A.
thanks
Edited by: sudhakar murthy on Nov 1, 2009 11:52 AM
hi,
What you can do for this is :
Use the concept of Assitance Classes :
Create an common Assistance Class for both the components(C1, C2 ).
Create Attributes/Tables in the assistance class' Attributes Tab and pass the values from C1 into these attributes using :
wd_assist->Att1 = <Value to be passed>
Finally in Component C2, access those attributes and you will have all the relevant values in C2.
For more help on Assistance Class , Refer this SAP online help :
http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm
Standard Component for Assistance Classes : DEMO_COMMON_ASSISTANCE1
See if it helps you.
hi lekha,
i am having a context node in component controller which i have mapped to a view controller. in one of view method based on some logic i am getting the values in an internal table1.
i am taking the values into itab2 and doing some adjustments. now i am binding the itab2 to the context node. now i want to access the itab1 and itab2 in another method of the view.
how can i do that. can i declare some attributes in the view and pass the itab1 itab2 there?
thanks
Hi,
DATA
lt_table TYPE REF TO data,
ls_table TYPE REF TO data.
FIELD-SYMBOLS:
<fs_t_discr_table> TYPE STANDARD TABLE of itab1 structure.
wd_comp_controller->attr = lt_table. "I have data inthis lt_table
assign wd_comp_controller->attr->* to <fs_t_discr_table>.
CREATE DATA ls_table LIKE LINE OF <lv_table>.
Regards,
Lekha.
Edited by: Lekha on Nov 5, 2009 3:28 PM
hi lekha,
FIELD-SYMBOLS:
<fs_t_discr_table> TYPE STANDARD TABLE of itab1 structure.
assign wd_comp_controller->attr->* to <fs_t_discr_table>.
in the above statement ur assining attr to <fs_t_discr_table> right? will that store the data of <fs_t_discr_table> in attr? how do i access attr in antoher view mehotd?
Hi,
DATA
lt_table TYPE REF TO data,
ls_table TYPE REF TO data.
FIELD-SYMBOLS:
<fs_t_discr_table> TYPE STANDARD TABLE of itab1 structure.
wd_comp_controller->attr = lt_table. "I have data inthis lt_table
assign wd_comp_controller->attr->* to <fs_t_discr_table>.
CREATE DATA ls_table LIKE LINE OF <lv_table>.
To read the same global in 2nd view -
DATA
lt_table TYPE REF TO data
FIELD-SYMBOLS :
<lv_table1> TYPE STANDARD TABLE.( you can give the static structure name)
IF wd_comp_controller->attr IS NOT INITIAL.
ASSIGN wd_comp_controller->attr->* TO <lv_table1>.
ENDIF. "if wd_comp_controller->gt_table is not initial.
IF NOT <lv_table1> IS INITIAL.
GET REFERENCE OF <lv_table1> INTO lt_table1.
ENDIF.
READ TABLE <lv_table1> ASSIGNING <fs_table> INDEX lv_index.
IF <fs_table> IS ASSIGNED.
ASSIGN COMPONENT 'UOM' OF STRUCTURE <fs_table> TO <fs_value>.
IF sy-subrc = 0.
lv_old_uom = <fs_value>.
CLEAR <fs_value>.
ENDIF.
endif.
Regards,
Lekha.
hi,
I would again suggest you to make a Structure in SE11 of type t_data.
Also create Table type in SE11 and assign this structure to this.
Finally Declare Attribute in Comp Controller of table type which you have just made and assign values to this attribute using :
wd_comp_controller->Att = itab1.
Similary you can fetch values in view2 using :
itab2 = wd_comp_controller->Att.
hi
i am trying to access an internal table in two methods of the same view. i have declared a attribute in the view attributes. in the second method i am using
itab2 = wd_this->att1
but i am not getting anything into itab2
by the way the second method is a event handler method triggered on "ON_FUNCTION" event of ALV compopnent. does it make any difference
i have declared a attribute in the view attributes.
To Access Atribute in more than one view, you have to declare the same in Component Controller because component controller is accessible to all the views.
So Create Att in Comp Controller so as to access the same in other views.
Wd_comp_controller->Att = itab1. This will set the value of itab1 in attribute Att.
Similarly itab2 = wd_comp_controller->Att will fetch the value
Hi,
You can have this in component controller or view's contoller attributes.
If this variable is in view'controller attribute then it can be accessed any where in any methods in that view,
if it is in component controller then it can be accesses accorss viiews of that component.
Then if it in view's attributes then (you can follow same apprach of declaration as in component controller)
but
WD_THIS is used instead of WD_COMP_CONTROLLER.
Hope this is clear...
Regards,
Lekha.
hi
i have added a buttons on top of ALV using the below code
DATA : lr_buttonui1 type REF TO CL_SALV_WD_FE_BUTTON,
DATA : button2 TYPE REF TO CL_SALV_WD_FUNCTION,
CREATE OBJECT lr_buttonui1.
lr_buttonui1->SET_TEXT( 'show' ).
button2 = l_VALUE->IF_SALV_WD_FUNCTION_SETTINGS~create_function( id
= 'show' ).
button2->SET_EDITOR( lr_buttonui1 ).
button is added to the ALV, but it is not looking like a button . its look like just some text pasted on the top ( i can click that )
i want to look it like normal button that we add in the layout using "button" element. how do i do this.
hi lekha,
i have two view and one window in WD application. I have created navigation links to call the view2 from view1 when user clicks on a button. when i do this second view is appearing on the same window. i want to open the second view as a modal pop up in new window. is this possible to do ?
thanks
Hi,
yes, you can do that...you ahve to create differt window for this and you need to embed the 2nvd view in this window..
You need to create one more application for this new window..
Using the IF_WD_WINDOW_MANAGER you need to use the method create_external_window by passing the URL as second Application name...in teh button handler of the 1st view..
This is the way you can do it..
Do you want these 2views to be as independent sessions..
Regards,
Lekha.
hi lekha,
i have managed to open the views in a new window, without creating application by using the below code
data: l_cmp_api type ref to if_wd_component,
l_window_manager type ref to if_wd_window_manager.
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
if wd_this->r_popup_win is initial.
wd_this->r_popup_win = l_window_manager->create_window(
window_name = 'get_var' ).
button_kind = if_wd_window=>co_buttons_yesnocancel
message_type = if_wd_window=>co_msg_type_question ).
endif.
wd_this->r_popup_win->open( ).
wd_this->r_popup_win->set_close_in_any_case( abap_false ).
i have embeded a view a in the window "get_var". the view will have some input fields and one button. when i enter the vlaues in the input fields and click on the button , i want to go to the main view and access the values entered in the "get_var" window in the main view methods. how do i do this.
thanks
Hi,
For these Input fields, you might have bound them to some attributes right..
Create a node i component controller and place these atttibutes under this node..amp teh same to the other views where ever you want to access the data of that attribute..
Now, In the MAIN view also you have this node rgiht..Just try to read this node for that particular attribute..
As this attribute is already bound to the Input fields created in other view...
This is simpler....
hi lekha,
I am almost done with this, but stuck with little problem. i got the values in the main wdmodify method. the values are stored in
rt_field1 field. this if defined as
rt_fileld1 type range of trg_char10.
i am using the below code to set the values of the selection screen field "field1".
data: lr_data type REF TO data.
get REFERENCE OF rt_field1 INTO lr_data.
wd_this->r_HANDLER->SET_RANGE_TABLE_OF_SEL_FIELD(
exporting I_ID = 'field1'
IT_RANGE_TABLE = lr_data ).
i am getting dump Field symbol has not yet been assigned in the method "ADD_RANGE_TABLE_TO_NODE". am i doing something wrong. how do we populate the selection screen field, once we have the values in range tables.
thanks
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.