Application Development and Automation 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: 
Read only

ALV Error messages

Former Member
0 Likes
534

Is there a list of what specific error messages mean that are returned from ALV function calls. I have the following code that has data in the IMAT table but the 'REUSE_ALV_LIST_DISPLAY' returns a 1 error code.

REPORT Z_ALVGRID_INTERNAL.

************************************************************************

tables:

pa0001, zhr_adweather.

types: begin of ts_imat ,

orgeh like PA0001-ORGEH,

ename like PA0001-ENAME,

pernr like PA0001-PERNR,

wapernr like zhr_adweather-pernr,

wa_date_taken like zhr_adweather-date_taken,

wa_hours_taken like zhr_adweather-hours_taken,

wa_expire_date like zhr_adweather-expire_date,

wa_makeup_date like zhr_adweather-makeup_date,

wa_makeup_hours like zhr_adweather-makeup_hours,

wa_results like zhr_adweather-results,

end of ts_imat.

Data:

imat type table of ts_imat, " internal table

gs_imat type ts_imat. " work area for the table

data:

gs_zhr_adweather type zhr_adweather,

gs_pernr like pa0001-pernr,

gs_orgeh like pa0001-orgeh,

gs_ename like pa0001-ename.

data i_repid like sy-repid.

data i_lines like sy-tabix.

TYPE-POOLS: SLIS.

data int_fcat type SLIS_T_FIELDCAT_ALV.

start-of-selection.

select single pernr orgeh ename from pa0001

into (gs_imat-pernr, gs_imat-orgeh, gs_imat-ename)

where pernr = '00000053'.

select single * from zhr_adweather

into gs_zhr_adweather

where pernr = '00000053'.

if sy-subrc = 0.

gs_imat-wapernr = gs_zhr_adweather-pernr.

gs_imat-wa_date_taken = gs_zhr_adweather-date_taken.

  • gs_imat-wa_hours_taken = gs_zhr_adweather-hours_taken.

  • gs_imat-wa_expire_date = gs_zhr_adweather-expire_date.

  • gs_imat-wa_makeup_date = gs_zhr_adweather-makeup_date.

  • gs_imat-wa_makeup_hours = gs_zhr_adweather-makeup_hours.

  • gs_imat-wa_results = gs_zhr_adweather-results.

endif.

append gs_imat to imat.

clear i_lines.

describe table imat lines i_lines.

if i_lines lt 1.

write: /

'No materials found.'.

exit.

endif.

end-of-selection.

i_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = i_repid

I_INTERNAL_TABNAME = 'IMAT' "capital letters!

I_INCLNAME = i_repid

CHANGING

CT_FIELDCAT = int_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.

ENDIF.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'

  • I_CALLBACK_PROGRAM = i_repid

IT_FIELDCAT = int_fcat

I_SAVE = 'A'

TABLES

T_OUTTAB = IMAT

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_LIST_DISPLAY'.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

None that I know of, but in this case, you have the exporting parameter 'i_callback_program' used twice in the call to FM REUSE_ALV_LIST_DISPLAY. That may be your problem.

Rob

Is there a list of what specific error messages mean that are returned from ALV function calls. I have the following code that has data in the IMAT table but the 'REUSE_ALV_LIST_DISPLAY' returns a 1 error code.

REPORT Z_ALVGRID_INTERNAL.

************************************************************************

tables:

pa0001, zhr_adweather.

types: begin of ts_imat ,

orgeh like PA0001-ORGEH,

ename like PA0001-ENAME,

pernr like PA0001-PERNR,

wapernr like zhr_adweather-pernr,

wa_date_taken like zhr_adweather-date_taken,

wa_hours_taken like zhr_adweather-hours_taken,

wa_expire_date like zhr_adweather-expire_date,

wa_makeup_date like zhr_adweather-makeup_date,

wa_makeup_hours like zhr_adweather-makeup_hours,

wa_results like zhr_adweather-results,

end of ts_imat.

Data:

imat type table of ts_imat, " internal table

gs_imat type ts_imat. " work area for the table

data:

gs_zhr_adweather type zhr_adweather,

gs_pernr like pa0001-pernr,

gs_orgeh like pa0001-orgeh,

gs_ename like pa0001-ename.

data i_repid like sy-repid.

data i_lines like sy-tabix.

TYPE-POOLS: SLIS.

data int_fcat type SLIS_T_FIELDCAT_ALV.

start-of-selection.

select single pernr orgeh ename from pa0001

into (gs_imat-pernr, gs_imat-orgeh, gs_imat-ename)

where pernr = '00000053'.

select single * from zhr_adweather

into gs_zhr_adweather

where pernr = '00000053'.

if sy-subrc = 0.

gs_imat-wapernr = gs_zhr_adweather-pernr.

gs_imat-wa_date_taken = gs_zhr_adweather-date_taken.

  • gs_imat-wa_hours_taken = gs_zhr_adweather-hours_taken.

  • gs_imat-wa_expire_date = gs_zhr_adweather-expire_date.

  • gs_imat-wa_makeup_date = gs_zhr_adweather-makeup_date.

  • gs_imat-wa_makeup_hours = gs_zhr_adweather-makeup_hours.

  • gs_imat-wa_results = gs_zhr_adweather-results.

endif.

append gs_imat to imat.

clear i_lines.

describe table imat lines i_lines.

if i_lines lt 1.

write: /

'No materials found.'.

exit.

endif.

end-of-selection.

i_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = i_repid

I_INTERNAL_TABNAME = 'IMAT' "capital letters!

I_INCLNAME = i_repid

CHANGING

CT_FIELDCAT = int_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.

ENDIF.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'

  • I_CALLBACK_PROGRAM = i_repid

IT_FIELDCAT = int_fcat

I_SAVE = 'A'

TABLES

T_OUTTAB = IMAT

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_LIST_DISPLAY'.

ENDIF.

3 REPLIES 3
Read only

Former Member
0 Likes
508

None that I know of, but in this case, you have the exporting parameter 'i_callback_program' used twice in the call to FM REUSE_ALV_LIST_DISPLAY. That may be your problem.

Rob

Read only

Former Member
0 Likes
507

Hi ,

In the ALV list display call you are passing

PASS I_CALLBACK_PROGRAM = I_REPID

AND Declare imat as below

imat type standard table of ts_imat .

Please reward if useful.

Read only

0 Likes
507

I was able to get it working by moving values to int_fcat.

(see FORM BUILD_FIELDCATA .)

REPORT Z_ESP_ALVGRID_INTERNAL.

************************************************************************

tables:

pa0001, zhr_adweather.

types: begin of ts_imat ,

orgeh like PA0001-ORGEH,

ename like PA0001-ENAME,

pernr like PA0001-PERNR,

wapernr like zhr_adweather-pernr,

wa_date_taken like zhr_adweather-date_taken,

wa_hours_taken like zhr_adweather-hours_taken,

wa_expire_date like zhr_adweather-expire_date,

wa_makeup_date like zhr_adweather-makeup_date,

wa_makeup_hours like zhr_adweather-makeup_hours,

wa_results like zhr_adweather-results,

wa_outstanding like zhr_adweather-hours_taken,

end of ts_imat.

Data:

imat type standard table of ts_imat, " internal table

gs_imat type ts_imat. " work area for the table

data:

gs_zhr_adweather type zhr_adweather,

gs_pernr like pa0001-pernr,

gs_orgeh like pa0001-orgeh,

gs_ename like pa0001-ename.

data i_repid like sy-repid.

data i_lines like sy-tabix.

TYPE-POOLS: SLIS.

data int_fcat type SLIS_T_FIELDCAT_ALV with header line.

start-of-selection.

SELECT-OPTIONS:

S_PERNR FOR gs_pernr.

select single pernr orgeh ename from pa0001

into (gs_imat-pernr, gs_imat-orgeh, gs_imat-ename)

where pernr = s_PERNR.

if sy-subrc = 0.

endif.

select single * from zhr_adweather

into gs_zhr_adweather

where pernr = s_PERNR.

if sy-subrc = 0.

gs_imat-wapernr = gs_zhr_adweather-pernr.

gs_imat-wa_date_taken = gs_zhr_adweather-date_taken.

gs_imat-wa_hours_taken = gs_zhr_adweather-hours_taken.

gs_imat-wa_expire_date = gs_zhr_adweather-expire_date.

gs_imat-wa_makeup_date = gs_zhr_adweather-makeup_date.

gs_imat-wa_makeup_hours = gs_zhr_adweather-makeup_hours.

gs_imat-wa_results = gs_zhr_adweather-results.

gs_imat-wa_outstanding = gs_zhr_adweather-hours_taken - gs_zhr_adweather-makeup_hours.

endif.

append gs_imat to imat.

clear i_lines.

describe table imat lines i_lines.

if i_lines lt 1.

write: /

'No materials found.'.

exit.

endif.

end-of-selection.

perform build_fieldcata.

i_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'

IT_FIELDCAT = int_fcat[]

TABLES

T_OUTTAB = IMAT

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

write: /

'Returncode',

sy-subrc,

'from FUNCTION REUSE_ALV_LIST_DISPLAY'.

ENDIF.

&----


*& Form BUILD_FIELDCATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM BUILD_FIELDCATA .

clear int_fcat.

int_fcat-fieldname = 'ORGEH'.

int_fcat-seltext_l = 'ORGANIZATIONAL UNIT'.

int_fcat-col_pos = 1.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'ENAME'.

int_fcat-seltext_l = 'EMPLOYEE NAME'.

int_fcat-col_pos = 2.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'PERNR'.

int_fcat-seltext_l = 'PERSONNEL NUMBER'.

int_fcat-col_pos = 3.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WAPERNR'.

int_fcat-seltext_l = 'Z-PERNR'.

int_fcat-col_pos = 4.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_HOURS_TAKEN'.

int_fcat-seltext_l = 'HOURS TAKEN'.

int_fcat-col_pos = 6.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_DATE_TAKEN'.

int_fcat-seltext_l = 'DATE OF AW LEAVE TAKEN'.

int_fcat-col_pos = 5.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_EXPIRE_DATE'.

int_fcat-seltext_l = 'EXPIRATION DATE'.

int_fcat-col_pos = 7.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_MAKEUP_DATE'.

int_fcat-seltext_l = 'DATE OF AW MAKEUP'.

int_fcat-col_pos = 8.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_MAKEUP_HOURS'.

int_fcat-seltext_l = 'HOURS OF AW MAKEUP'.

int_fcat-col_pos = 9.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_OUTSTANDING'.

int_fcat-seltext_l = 'OUTSTANDING BALANCE'.

int_fcat-col_pos = 10.

append int_fcat.

clear int_fcat.

int_fcat-fieldname = 'WA_RESULTS'.

int_fcat-seltext_l = 'EXPIRED LEAVE RESULTS'.

int_fcat-col_pos = 11.

append int_fcat.

ENDFORM.