Skip to Content
0
Former Member
Jun 21, 2007 at 06:45 AM

quetion related to ALVs

14 Views

hello experts,

I created an interactive report...the basic list will display some details of the vendor...the first secondary list will display some detilas of the EKKO table based on LIFNR number...so, my problem is...the vendor number in the table is with two initial zeros (eg.0022234435)...but when i click on the basic list my program is comparing 22234435 with 0022234435 and no data is getting displayed in the secondary list...

so, now tell me how can i overcome this problem?

This is my program...

TABLES:lfa1,ekko.

SELECT-OPTIONS:vno FOR lfa1-lifnr.

DATA:BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr,

name1 LIKE lfa1-name1,

END OF itab.

DATA:BEGIN OF jtab OCCURS 0,

ebeln LIKE ekko-ebeln,

aedat LIKE ekko-aedat,

END OF jtab.

TYPE-POOLS:slis.

DATA:repid LIKE sy-repid.

DATA:f_lfa11 TYPE slis_t_fieldcat_alv,

f_lfa1 TYPE slis_fieldcat_alv,

f_ekko1 TYPE slis_t_fieldcat_alv,

f_ekko TYPE slis_fieldcat_alv.

DATA:i_events TYPE slis_t_event,

s_events TYPE slis_alv_event.

repid = sy-repid.

PERFORM col_head.

START-OF-SELECTION.

SELECT lifnr name1 FROM lfa1 INTO TABLE itab WHERE lifnr IN vno.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

it_fieldcat = f_lfa11

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = 'A'

  • IS_VARIANT =

it_events = i_events

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = itab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

FORM col_head.

f_lfa1-fieldname = 'LIFNR'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'LIFNR'.

APPEND f_lfa1 TO f_lfa11.

CLEAR f_lfa1.

f_lfa1-fieldname = 'NAME1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'NAME1'.

APPEND f_lfa1 TO f_lfa11.

CLEAR f_lfa1.

f_ekko-fieldname = 'EBELN'.

f_ekko-ref_tabname = 'EKKO'.

f_ekko-ref_fieldname = 'EBELN'.

APPEND f_ekko TO f_ekko1.

CLEAR f_ekko.

f_ekko-fieldname = 'AEDAT'.

f_ekko-ref_tabname = 'EKKO'.

f_ekko-ref_fieldname = 'AEDAT'.

APPEND f_ekko TO f_ekko1.

CLEAR f_ekko.

s_events-name = 'USER_COMMAND'.

s_events-form = 'VAL'.

APPEND s_events TO i_events.

ENDFORM. "COL_HEAD

FORM val USING user_command LIKE sy-ucomm

sel TYPE slis_selfield.

DATA:v_lifnr(15) TYPE c.

DATA:v_ebeln(15) TYPE c.

DATA:v_matnr(15) TYPE c.

v_lifnr = sel-value.

SELECT EBELN AEDAT FROM EKKO INTO TABLE jtab WHERE LIFNR = v_lifnr.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

it_fieldcat = f_ekko1

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

it_events = i_events

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = jtab

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "VAL