Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

alv

Former Member
0 Kudos

hi all,

i am new for abap,

in this program when i excute the, datas from ekko table not displayed .how to display the data from ekko table using alv! please help me!!

&----


*& Report ZDR_ALV

*&

&----


*&

*&

&----


REPORT ZDR_ALV1.

tables: ekko,ekpo.

type-pools :slis.

*data: gv_alv type slis_t_fieldcat_alv.

types:begin of stru,

lv_docno type ekko-ebeln,

lv_comcod type ekko-bukrs,

lv_cky type ekko-waers,

lv_ter type ekko-zterm,

lv_tele type ekko-telf1,

end of stru.

data :itab type table of stru,

wa like line of itab.

data gv_alv_ty type slis_t_fieldcat_alv.

data gv_wa like line of gv_alv_ty.

gv_wa-fieldname = 'bukrs '.

gv_wa-row_pos = 10.

append gv_wa to gv_alv_ty.

clear gv_wa.

gv_wa-fieldname = 'ebeln '.

append gv_wa to gv_alv_ty.

clear gv_wa.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

IT_FIELDCAT = gv_alv_ty

TABLES

t_outtab = itab

  • EXCEPTIONS

1 ACCEPTED SOLUTION

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

What is there in itab?

It's empty , you need to fill the internal table first .

Regards,

Sandeep

7 REPLIES 7

Former Member
0 Kudos

Hi,

Where is the select query to fetch the data from EKKO and put it in itab?

Select....

from EKKO

into table itab

where....

if sy-subrc NE 0.

display an errror message

endif.

Also the fieldnames below should be the field names of your internal table ITAB and be in UPPERCASE.

gv_wa-fieldname = 'bukrs '.

gv_wa-row_pos = 10.

append gv_wa to gv_alv_ty.

Regards

Shiva

Former Member
0 Kudos

Hi,

You did not select any data.

Regards

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

What is there in itab?

It's empty , you need to fill the internal table first .

Regards,

Sandeep

Former Member
0 Kudos

The field names in gv_alv_ty and itab should be same.

you are appending BUKRS and EBELN to gv_alv_ty, but those fields are not available in itab structure.

afte correcting the above

you need to write a select statement to populate value to itab.

Regards

Madhan

Former Member
0 Kudos

Hi,

In your code there is no data retrieval statements. No data found in ITAB, how can you print with out any data in internal table.And also when passing

" gv_wa-fieldname = 'bukrs ' " values you should not use small letters.

But BUKRS is not there in your ITAB structure ,you should write

gv_wa-fieldname = 'LV_DOCNO' like this.

First retrieve data from EKKO then try to print you will get it .


SELECT   ebeln
                bukrs
               waers
               zterm
               telf1
  FROM  EKKO
    INTO  table ITAB.

Regards,

Rajitha.

Former Member
0 Kudos

Hi Dharma,

I have changed the code a bit. Try it out

REPORT ZDR_ALV1.

tables :
     ekko,
     ekpo.

type-pools : slis.

types : begin of stru,
        lv_docno   type ekko-ebeln,
        lv_comcod  type ekko-bukrs,
        lv_cky     type ekko-waers,
        lv_tele    type ekko-telf1,
        end of stru.

data : itab type table of stru,
       wa like line of itab.

data gv_alv_ty type slis_t_fieldcat_alv.
data gv_wa like line of gv_alv_ty.

SELECT ebeln
       bukrs
       waers
       telf1
FROM EKKO
INTO TABLE itab
UP TO 10 rows.

gv_wa-fieldname = 'LV_DOCNO'.
gv_wa-seltext_l = 'Doc no'.
append gv_wa to gv_alv_ty.

gv_wa-fieldname = 'LV_COMCOD'.
gv_wa-seltext_l = 'Company code'.
append gv_wa to gv_alv_ty.

gv_wa-fieldname = 'LV_CKY'.
gv_wa-seltext_l = 'Currency'.
append gv_wa to gv_alv_ty.

gv_wa-fieldname = 'LV_TELE'.
gv_wa-seltext_l = 'Tele'.
append gv_wa to gv_alv_ty.



CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = gv_alv_ty
TABLES
t_outtab = itab.

Regards

Former Member
0 Kudos

THANKS TO ALL FOR RESPONSING ME.

I GOT SOLUTION.