cancel
Showing results for 
Search instead for 
Did you mean: 

alv-output

Former Member
0 Kudos

hi ,

I need to get the top of page values like

ex: sales doc no: 1233

created on : 12.07.2009

material no: 188222

which i need to pull the data from the table along with this i need to get display the alv.

here i worked on with alv which is working fine.but now i need to add the top of page

values to the list as headerwith out any grids(like horizantal or vertical) and with diffrent

background color up to the visibility of scrren as horizantal and the maximum no of fields

in the header will be '6' (in one under one).

let me know any suggetions on the same will be help full.

In Advance,

Thanks,

Satti.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Satish,

In the WDDOINIT method of the view do something like this using a grid, hope this will solve:

METHOD wddoinit.

* ALV Component usage
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_demo_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

DATA lo_nd_vbak_node TYPE REF TO if_wd_context_node.
DATA lo_el_vbak_node TYPE REF TO if_wd_context_element.
DATA ls_vbak_node TYPE wd_this->element_vbak_node.

Data:  lr_text1 type ref to cl_salv_form_text.
Data:  lr_text2 type ref to cl_salv_form_text.
Data: w_string1 type string.
Data: w_string2 type string.

* TOP_OF_LIST in ALV
  DATA: lo_nd_top_of_list TYPE REF TO if_wd_context_node.

* Declare variable for Layout and Elements
  DATA: lr_grid_top  TYPE REF TO cl_salv_form_layout_grid.

* navigate from <CONTEXT> to <VBAK_NODE> via lead selection
  lo_nd_vbak_node = wd_context->get_child_node( name = wd_this->wdctx_vbak_node ).

* Create Layout
  CREATE OBJECT lr_grid_top.

*" code for your requirment ...................
* retrive the data from the database table
  Select single * from vbak into ls_vbak_node where...  " (give the selection criteria).

CONCATENATE 'Sales doc no :' ls_vbak_node-VBELN into w_string1 SEPARATED BY SPACE..

 lr_text1 = lr_grid_top->create_text(
    row     = 1
    column  = 1
    text    = w_string1 ).

CONCATENATE  'Created on :' ls_vbak_node-ERDAT into w_string2 SEPARATED BY SPACE..

 lr_text2 = lr_grid_top->create_text(
    row     = 2
    column  = 1
*    rowspan =
*    colspan =
    text    =  w_string2 ).

*"............................................................

* navigate from <CONTEXT> to <TOP_OF_LIST> via lead selection
  lo_nd_top_of_list = wd_context->get_child_node( name = wd_this->wdctx_top_of_list ).

* Set Attribute CONTENT of node Top of List
  CALL METHOD lo_nd_top_of_list->set_attribute
    EXPORTING
*     index  = USE_LEAD_SELECTION
      value  = lr_grid_top
      name   = 'CONTENT'.

ENDMETHOD.

With luck,

Pritam.

Former Member
0 Kudos

Hi Pritam,

here in my requirement i had creadted 3nodes in alv, i.e inpu_node,alv_table,header.so in my input_node i have used vbeln as input with search help and select options.now based on that iam getting alv.but i have created one more node called header with reference of vbap.now iam not getting that is there any binding required or what exactly to do.in the earlier i got a link to get header text i implemented it's getting well but i need to ftech the data from vbap with the text like doc no: xxxxx next row i need to get created on : XXXX.

Let me know the suggestions and views to implement.

Inadvance,

Thanks,

satti

Former Member
0 Kudos

Hi Satish,

Instead of using a different node for Header, make use of the node TOP OF LIST and END OF LIST from the Interface Controller, go to the view context, click on the <name of your alv component>_SALV_WD_TABLE.INTERFACECONTROLL & then map this 2 node from interface context to view context. Now i assume after getting the user input vbeln you are using some button to display the data, let say you have created an Onaction event as 'SHOW', now go to the method ONACTIONSHOW in your view, here get the required data that you want to display as header, say:

*Read the user input
...............
.............
* get single attribute
  lo_el_context->get_attribute(
    EXPORTING
      name =  `EBELN`
    IMPORTING
      value = lv_ebeln ).

* Get your ALV table data from database & bind the same with your table node
............................................
...........................................

* Retrieve created by
 SELECT SINGLE
               ernam
    FROM EKKO
    INTO  l_ernam
   WHERE ebeln eq lv_ebeln.

 CONCATENATE  'Created by :' l_ernam  into l_string.

  l_text = l_grid_header->create_text(
    row     = 1
    column  = 1
    text    = l_string ).

* Set Attribute CONTENT of node Top of List
  CALL METHOD lo_nd_top_of_list->set_attribute
    EXPORTING
      value  = l_grid_header
      name   = 'CONTENT'.

With luck,

Pritam.

Former Member
0 Kudos

Hi Pritam,

iam doing the same thing with the diffrent tables but it's not working.

*DATA: lr_node TYPE REF TO if_wd_context_node,

lv_PN_NR TYPE wd_this->element_input_node-draw_no,

lt_qprs TYPE wd_this->elements_alv_table.

lr_node = wd_context->get_child_node( name = wd_this->wdctx_input_node ).

" Read the VBELN value from input field into a local variable lv_vbeln

lr_node->get_attribute( EXPORTING name = 'DRAW_NO'

IMPORTING value = lv_PN_NR ).

" Use the obtained pn_nr value to fetch corresponding qprs details

SELECT * FROM qprs INTO CORRESPONDING FIELDS OF TABLE lt_qprs WHERE PN_NR = lv_PN_NR.

" Check if there are any records in qprs for the entered pn_nr. If yes only then bind to the 2nd table & show ALV

" Or else keep the ALV as hidden & throw an message to the user informing him about the same

IF lt_qprs IS NOT INITIAL.

lr_node->set_attribute( EXPORTING name = 'SHOW_ALV'

value = 'X' ).

lr_node = wd_context->get_child_node( name = wd_this->wdctx_alv_table ).

lr_node->bind_table( lt_qprs ).

ELSE.

" Use your message manager logic to throw a message that no item details exist for this document number!

ENDIF. *

here, iam not having some fields in my table qprs but i would like to get the data from qprn which i have created a node.if the node is not necessary then wat can i do? give me a line of code ........and views.

Thanks,

satti

Former Member
0 Kudos

hello,

this can i achive by this way: i will be designing a node with the fields from qprs and qprn into node alv_table.for this fields i will assign a type with dataelement.now i need to dispaly the alv with based on the input with the header values as mentioned in the earlier posts.

any ideas would be apprciated.....

thanks,

satti

Former Member
0 Kudos

Hi,

Check the below link for top-of-list i ALV .

Hope it is useful.

[http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0ee06d0-d475-2b10-ddad-bc4bf134cfb8&overridelayout=true]

Former Member
0 Kudos

hi,

thanks , iam able to get the text over here by the link which you have given.but i need to get the values which i have mentioned in my earlier thread.these value are coming from the table when the user gives a sales doc no based on that i need to get to be dispalyed the alv along with my header text and the corresponding values.

let me know any valuble suggestions ....

In advance ,

Thanks

Satti