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: 

related to reports

Former Member
0 Kudos
68

hi all,

this is my code...

DATA:BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr,

name1 LIKE lfa1-name1,

END OF itab.

TYPE-POOLS:slis.

DATA:repid LIKE sy-repid.

DATA:f_lfa11 TYPE slis_t_fieldcat_alv,

f_lfa1 TYPE slis_fieldcat_alv.

repid = sy-repid.

PERFORM col_head.

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.

ENDFORM. "COL_HEAD

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 = ' '

  • 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.

so, my problem is....

im not able to print the names of the vendors,

the header im able to print,the numbers of the vendor also getting printed.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
44

Hi Vinil,

Change this code to

f_lfa1-fieldname = 'name1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'name1'.

<b>f_lfa1-fieldname = 'NAME1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'NAME1'.</b>

Reward points if useful.

Regards,

Atish

4 REPLIES 4

Former Member
0 Kudos
44

Hi

Change the code f_lfa1-ref_tabname = 'LFA1'. to

f_lfa1-ref_tabname = 'itab'.

because ur pass values from internal table. Not from Database tables.

Reward me if its useful.

Regards

Ravi

Former Member
0 Kudos
45

Hi Vinil,

Change this code to

f_lfa1-fieldname = 'name1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'name1'.

<b>f_lfa1-fieldname = 'NAME1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-ref_fieldname = 'NAME1'.</b>

Reward points if useful.

Regards,

Atish

Former Member
0 Kudos
44

FORM col_head.

f_lfa1-fieldname = 'LIFNR'.

<b>f_lfa1-ref_tabname = 'ITAB.</b>

f_lfa1-ref_fieldname = 'LIFNR'.

APPEND f_lfa1 TO f_lfa11.

clear f_lfa1.

f_lfa1-fieldname = 'NAME1'.

<b>f_lfa1-ref_tabname = 'ITAB.</b>

f_lfa1-ref_fieldname = 'name1'.

APPEND f_lfa1 TO f_lfa11.

clear f_lfa1.

ENDFORM. "COL_HEAD

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 = ' '

  • 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 =

<b>TABLES

t_outtab = itab</b>

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

Change ur code which are all in bold...

Reward me if its useful.

Regadrs

Ravi

Former Member
0 Kudos
44

See the below program and i modified :

report x.

DATA:BEGIN OF itab OCCURS 0,

lifnr LIKE lfa1-lifnr,

name1 LIKE lfa1-name1,

END OF itab.

TYPE-POOLS:slis.

DATA:repid LIKE sy-repid.

DATA:f_lfa11 TYPE slis_t_fieldcat_alv,

f_lfa1 TYPE slis_fieldcat_alv.

initialization.

repid = sy-repid.

start-of-selection.

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

end-of-selection.

PERFORM col_head.

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 = 'ITAB'

  • IS_LAYOUT =

it_fieldcat = f_lfa11

  • 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 = 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-tabname = 'ITAB'.

f_lfa1-ref_fieldname = 'LIFNR'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-seltext_l = 'Vendor #'.

f_lfa1-seltext_m = 'Vendor #'.

f_lfa1-seltext_s = 'Vendor #'.

APPEND f_lfa1 TO f_lfa11.

clear f_lfa1.

f_lfa1-fieldname = 'NAME1'.

f_lfa1-tabname = 'ITAB'.

*f_lfa1-ref_fieldname = 'name1'.

f_lfa1-ref_fieldname = 'NAME1'.

f_lfa1-ref_tabname = 'LFA1'.

f_lfa1-seltext_l = 'Name'.

f_lfa1-seltext_m = 'Name'.

f_lfa1-seltext_s = 'Name'.

APPEND f_lfa1 TO f_lfa11.

clear f_lfa1.

ENDFORM. "COL_HEAD

Reward Points if it is helpful

Thanks

Seshu