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

Gnerating error

Former Member
0 Likes
1,004

I am getting the error while activating the alvoops report program like ,

source code ???????????????????????????????? line 0

error when gernerating the selection screen 1000 of report.

can any one resolve it.

10 REPLIES 10
Read only

Former Member
0 Likes
979

Hi Anjali,

Kindly post the code here so that easy to solve....and if possible go to debugg and check which line is it populating..so easy to capture by your self

regards

sas

Read only

0 Likes
979

&----


*& Report ZG_ALVOOPS_INTER *

*& *

&----


*& *

*& *

&----


REPORT ZG_ALVOOPS_INTER.

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

  • TABLES *

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

tables : vbak.

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

  • TYPES *

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

types: BEGIN OF ty_vbak,

vbeln TYPE vbak-vbeln,

erdat TYPE vbak-erdat,

audat TYPE vbak-audat,

netwr TYPE vbak-netwr,

END OF ty_vbak,

BEGIN OF ty_vbap,

vbeln TYPE vbap-vbeln,

posnr TYPE vbap-posnr,

matnr TYPE vbap-matnr,

matkl TYPE vbap-matkl,

END OF ty_vbap.

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

  • data declarations *

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

data : i_vbak type table of ty_vbak,

i_vbap type table of ty_vbap,

wa_vbak type ty_vbak,

wa_vbap type ty_vbap,

i_fcat type lvc_t_fcat,

wa_fcat type lvc_s_fcat,

alvgrid type REF TO cl_gui_alv_grid,

container type ref to cl_gui_custom_container,

  • events type REF TO event_class,

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

  • data declarations for interactive list *

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

i_fcat1 type table of lvc_t_fcat,

wa_fcat1 type lvc_s_fcat,

alvgrid1 type REF TO cl_gui_alv_grid,

container1 type REF TO cl_gui_custom_container.

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

  • selection screen *

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

select-options : s_vbeln for vbak-vbeln.

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

  • start-of-selection *

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

start-of-selection.

*fetch data into table and field characteristics

PERFORM fetch_data.

*ALV display for output

PERFORM alv_output.

CALL SCREEN 1000.

END-OF-SELECTION.

&----


*& Form fetch_data

&----


  • text

----


form fetch_data .

select vbeln

erdat

audat

netwr

from vbak

into table i_vbak

where vbeln in s_vbeln.

endform. " fetch_data

&----


*& Form alv_output

&----


  • text

----


form alv_output .

CREATE OBJECT container

EXPORTING

container_name = 'CONTAINER'

.

IF sy-subrc <> 0.

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

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

ENDIF.

CREATE OBJECT alvgrid

EXPORTING

I_parent = CONTAINER

.

IF sy-subrc <> 0.

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

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

ENDIF.

PERFORM FIELDCAT.

CALL METHOD alvgrid->set_table_for_first_display

CHANGING

it_outtab = I_VBAK[]

IT_FIELDCATALOG = I_FCAT[]

.

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. " alv_output

&----


*& Form FIELDCAT

&----


  • text

----


form FIELDCAT .

wa_fcat-col_pos = 1.

wa_fcat-fieldname = 'VBELN'.

wa_fcat-seltext = 'SALES DOCUMENT'.

APPEND wa_fcat to i_fcat.

wa_fcat-col_pos = 2.

wa_fcat-fieldname = 'ERDAT'.

wa_fcat-seltext = 'DATE OF CREATION'.

APPEND wa_fcat to i_fcat.

wa_fcat-col_pos = 3.

wa_fcat-fieldname = 'AUDAT'.

wa_fcat-seltext = 'DOCUMENT DATE'.

APPEND wa_fcat to i_fcat.

wa_fcat-col_pos = 4.

wa_fcat-fieldname = 'NETWR'.

wa_fcat-seltext = 'NET VALUE'.

APPEND wa_fcat to i_fcat.

endform. " FIELDCAT

Read only

0 Likes
979

Hi Anjali ,

Call screen 1000 ?

Did u developed any screen's?

If yes then pls change the screne number using 1000 is not allowed in sap where this is the standard screen number's..

Ok check this & correct me if i am wrong...

Regards

Sas

Read only

0 Likes
979

i have change the screen number from 1000 to 100 but showing the same error

Read only

0 Likes
979

Could you pls alborate your requirement ?

Like what exactly are you expectin ? and what is happening ?

Regards

sas

Read only

0 Likes
979

ya sory i got after changing the screen number,

thank u very much.

Read only

0 Likes
979

oops...thanks & appreciate your spirit ...

Regards

sas

Read only

0 Likes
979

hi anjali,

i tried pasting ur code i didn't get any error while activating.

only while executing we get a dump. the problem may be since u r using screen 1000 which are reserved for selection-screen. Try using a different screen and define ur container there.

sample code

TYPES: BEGIN OF TY_MARA,

MATNR TYPE MARA-MATNR, " Material Number

ERSDA TYPE MARA-ERSDA, " Creation date

ERNAM TYPE MARA-ERNAM, "Name of Person who Created the Object

MTART TYPE MARA-MTART, "Material Type

END OF TY_MARA.

DATA: it_mara type table of ty_mara,

wa_mara like line of it_mara.

DATA: container type ref to cl_gui_custom_container,

alv_grid type ref to cl_gui_alv_grid,

field_cat type lvc_t_fcat.

DATA: ok_code type sy-ucomm.

SELECT-OPTIONS: s_matnr for wa_mara-matnr.

at selection-screen.

if s_matnr-low is initial.

MESSAGE E002(ZVIK).

  • enter a value

endif.

select matnr ersda ernam mtart

from mara

into table it_mara

where matnr in s_matnr.

if sy-subrc ne 0.

MESSAGE E001(ZVIK).

  • invalid data

endif.

call screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

if it_mara is not initial.

CREATE OBJECT CONTAINER

EXPORTING

CONTAINER_NAME = 'CON_MARA'

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5

others = 6

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

CREATE OBJECT ALV_GRID

EXPORTING

I_PARENT = CONTAINER

EXCEPTIONS

ERROR_CNTL_CREATE = 1

ERROR_CNTL_INIT = 2

ERROR_CNTL_LINK = 3

ERROR_DP_CREATE = 4

others = 5

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

perform field_catalogue.

CALL METHOD ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY

CHANGING

IT_OUTTAB = it_mara

IT_FIELDCATALOG = field_cat

EXCEPTIONS

INVALID_PARAMETER_COMBINATION = 1

PROGRAM_ERROR = 2

TOO_MANY_LINES = 3

others = 4

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

endif.

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

Case ok_code.

when 'BACK'.

Leave program.

Endcase.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Form field_catalogue

&----


  • text

----


  • <--P_FIELD_CAT text

----


FORM field_catalogue.

DATA: l_field_cat type lvc_s_fcat.

l_field_cat-fieldname = 'MATNR'.

l_field_cat-col_pos = '1'.

l_field_cat-outputlen = '18'.

l_field_cat-just = 'C'.

l_field_cat-coltext = text-001. "'Material No.'(001).

l_field_cat-tabname = 'IT_MARA'.

l_field_cat-no_zero = 'X'.

append l_field_cat to field_cat.

l_field_cat-fieldname = 'ERSDA'.

l_field_cat-col_pos = '2'.

l_field_cat-outputlen = '10'.

l_field_cat-just = 'C'.

l_field_cat-coltext = text-002. " 'Creation date'(002).

l_field_cat-tabname = 'IT_MARA'.

append l_field_cat to field_cat.

l_field_cat-fieldname = 'ERNAM'.

l_field_cat-col_pos = '3'.

l_field_cat-outputlen = '15'.

l_field_cat-just = 'C'.

l_field_cat-coltext = text-003. "'Name of person'(003).

l_field_cat-tabname = 'IT_MARA'.

append l_field_cat to field_cat.

l_field_cat-fieldname = 'MTART'.

l_field_cat-col_pos = '4'.

l_field_cat-outputlen = '8'.

l_field_cat-just = 'C'.

l_field_cat-coltext = text-004. "'Material Type'(004).

l_field_cat-tabname = 'IT_MARA'.

append l_field_cat to field_cat.

ENDFORM. " field_catalogue

Read only

Former Member
0 Likes
979

Hi Anjali

some problem in u r selection screen defination

please c heck there

kiran

Read only

Former Member
0 Likes
979

Recheck the definition of elements in selection screen especially if you are using formatting options like POSITION, length ...

As adviced by SAS, posting your code can help for better advices.

~Eswar

Ooops, wrong context i guess..

Edited by: Eswar Rao Boddeti on Nov 7, 2008 2:22 PM