on 12-09-2009 1:57 PM
Hello,
I need to develop a demo WD ABAP application in the first screen take the sales organization as select option parmaters
In second screen show all sales order items, with in that sales organization in an ALV.how can it be done?
rgds
yashodra
hi ,
read VBELN from VBAK where VKORG is with in sales organization range entered in first screen
// use code wizard (control +f7) to read the context attribute which is binded to sales organization
// suppose u get the value in vkorg
DATA : vbeln type string .
SELECT SINGLE vbeln FROM vbak INTO lv_vbeln
WHERE vkorg = lv_vkorg .
Make a attribute gv_vbeln in ATTRIBUTEu2019s tab of component controller and pass this
Lv_vbeln
wd_comp_controller->gv_vbeln = lv_vbeln
Take parameters from VBAP where VBELN equalls to VBELN of VBAK.
show VBAP entries in second screen in an ALV , using component usage.
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ,
1 create context in ur component controller and a context attribute say attr under it
2 map it to both of ur Main and Second View , just drag and drop the context node to the
Context in both the views
3 read the attribute ( this is binded to ur input field ) in the main view
Go to control wizard ( Control +f7) , select the radio button read context node / attribute
Select the node and read the attribute using get_attribute method
4 now do component usage for ALV
i) In the component controller , create a context node .This context node will be used to generate the ALV grid table. The context attributes inside the context node would refer to the columns in the table .give dictionary structure
ii) Double click on the component and define usage for SALV_WD_TABLE
5 write this piece of code in WD DOINIT of ur 2nd view
DATA :lv_ vbeln1 type string .
Lv_Vbeln1 = wd_comp_controller->gv_vbeln .
Data: itab_vbap type standard table of vbap .
*select data from data base table
select * from vbap
into corresponding fields of table itab_vbap where vbeln EQ lv_vbeln1.
* bind data to context used by ALV
context_node = wd_context->get_child_node ( name = 'ALV_TABLE').
context_node->BIND_table( itab_vbap).
regards,
amit
for component usage
1 in the component B , Double click the component in the object tree and choose the tab Used Components.
2 Define a usage of your component A within this component.
3 Do a mapping between the interface controller of ur MAIN component B & the component controller of
ur SUB component A 4 Before you can call the Interface Controller method of the used component in ur view ,you have to declare that the view controller can use the Interface Controller of the used component. By default only the component controller can access used components directly, view controllers have to specify this explicitly.
5 go to the tab Properties of the B, click the button Create Controller Use and select the INTERFACECONTROLLER of the component A for component use .
6 go to WINDOWS , inside ur View container right clck to select embed view to select the view to be embedded
Refer this article on component usage
Hi,
Create 2 views inside your compoenent and embed them into your window context..
In the compoenent controlelr create a node N_INPUT(1:1)cardianlity and an attribute insdie it of type VKORG(sales org).
Other node N_DATA (0:N) and have the necessary attributes here linke VBELN and other details..(you can add teh attribute of the table in se11 ie...vbak)..
In the properties tab of teh component have an entry for comp usage..
ALV SALV_WD_TABLE
save..
In the component controller's properties tab also...click on create button and add this alv...
do the same in the view's properties also..
Now.
Let me know if you want to have select option or just a drodpown fro VKORG or an Input field with a value help...
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
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.