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: 

Error in this application

Former Member
0 Kudos
168

CAN any one say why i am gettin the run time error in this application...

i am sending u the code and the error also....

&----


*& Report Z_SB_RP_MATERIAL

*&

&----


*&

*&

&----


REPORT Z_SB_RP_MATERIAL

NO STANDARD PAGE HEADING

LINE-SIZE 200

LINE-COUNT 60(2).

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

  • TABLES DECLARATION *

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

TABLES: MARA,

MARD,

MAKT,

MARC,

EINA,

EINE.

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

  • INTERNAL TABLES DECLARATIONS *

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

DATA: BEGIN OF ITAB OCCURS 10,

MATNR LIKE MARA-MATNR,

MEINS LIKE MARA-MEINS,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

SPART LIKE MARA-SPART,

MAKTX LIKE MAKT-MAKTX,

LVORM LIKE MARC-LVORM,

EKGRP LIKE MARC-EKGRP,

WERKS LIKE MARC-WERKS,

LABST LIKE MARD-LABST,

SPEME LIKE MARD-SPEME,

LGORT LIKE MARD-SPEME,

END OF ITAB.

DATA: BEGIN OF ITAB1 OCCURS 3,

INFNR LIKE EINA-INFNR,

MATKL LIKE EINA-MATKL,

LIFNR LIKE EINA-LIFNR,

EKORG LIKE EINE-EKORG,

ERDAT LIKE EINE-ERDAT,

ERNAM LIKE EINE-ERNAM,

NETPR LIKE EINE-NETPR,

END OF ITAB1.

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

  • SELECTION-SCREEN *

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

SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-T01.

SELECT-OPTIONS: SMATNR FOR MARA-MATNR,

SERSDA FOR MARA-ERSDA,

SWERKS FOR MARC-WERKS,

SLGORT FOR MARD-LGORT.

SELECTION-SCREEN END OF BLOCK BLK.

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

  • TOP-OF-PAGE *

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

TOP-OF-PAGE.

ULINE (152).

WRITE:/ SY-VLINE,

02 'S.NO',

06 SY-VLINE,

08 'MATNR',

20 SY-VLINE,

22 'MEINS',

32 SY-VLINE,

34 'ERSDA',

44 SY-VLINE,

46 'ERNAM',

56 SY-VLINE,

58 'SPART',

68 SY-VLINE,

70 'MAKTX',

80 SY-VLINE,

82 'LVORM',

92 SY-VLINE,

94 'EKGRP',

104 SY-VLINE,

106 'WERKS',

116 SY-VLINE,

118 'LABST',

128 SY-VLINE,

130 'SPEME',

140 SY-VLINE,

142 'LGORT',

152 SY-VLINE.

ULINE (152).

ULINE (152).

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

  • START-OF-SELECTION *

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

START-OF-SELECTION.

SELECT T1~MATNR

T1~MEINS

T1~ERSDA

T1~ERNAM

T1~SPART

T2~MAKTX

T3~LVORM

T3~EKGRP

T3~WERKS

T4~LABST

T4~SPEME

T4~LGORT

INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM MARA AS T1

INNER JOIN MAKT AS T2

ON T1MATNR = T2MATNR

INNER JOIN MARC AS T3

ON T2MATNR = T3MATNR

INNER JOIN MARD AS T4

ON T3MATNR = T4MATNR

WHERE T1~MATNR IN SMATNR.

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

  • END-0F-SELECTION *

**************************************************************\

END-OF-SELECTION.

DATA: COUNT(4) TYPE N.

LOOP AT ITAB.

COUNT = COUNT + 1.

WRITE:/ SY-VLINE,

02 COUNT,

06 SY-VLINE,

08 ITAB-MATNR,

20 SY-VLINE,

22 ITAB-MEINS,

32 SY-VLINE,

34 ITAB-ERSDA,

44 SY-VLINE,

46 ITAB-ERNAM,

56 SY-VLINE,

58 ITAB-SPART,

68 SY-VLINE,

70 ITAB-MAKTX,

80 SY-VLINE,

82 ITAB-LVORM,

92 SY-VLINE,

94 ITAB-EKGRP,

104 SY-VLINE,

106 ITAB-WERKS,

116 SY-VLINE,

118 ITAB-LABST,

128 SY-VLINE,

130 ITAB-SPEME,

140 SY-VLINE,

142 ITAB-LGORT,

152 SY-VLINE.

HIDE ITAB-MATNR.

ENDLOOP.

ULINE (152).

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

  • AT LINE-SELECTION *

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

AT LINE-SELECTION.

SELECT T4~INFNR

T4~MATKL

T4~LIFNR

T5~EKORG

T5~ERDAT

T5~ERNAM

T5~NETPR

INTO CORRESPONDING FIELDS OF TABLE ITAB1

FROM EINA AS T4

INNER JOIN EINE AS T5

ON T4INFNR = T5INFNR.

ULINE (160).

WRITE:/ SY-VLINE,

03 'NUMBER OF PURCHASING INFO RECORD',

30 SY-VLINE,

32 'MATERIAL GROUP',

45 SY-VLINE,

47 'VENDOR ACC.NUMBER',

60 'SY-VLINE',

62 'PURCHASING ORGANIZATION',

80 SY-VLINE,

82 'DATA ON WHICH THE RECORD WAS CREATED',

105 SY-VLINE,

107 'NAME OF THE PERSON WHO CREATED THE OBJECT',

130 SY-VLINE,

132 'NET PRICE IN PURCHASING INFO RECORD',

160 SY-VLINE.

ULINE (160).

ULINE (160).

LOOP AT ITAB1.

WRITE:/ SY-VLINE,

03 ITAB1-INFNR,

30 SY-VLINE,

32 ITAB1-MATKL,

45 SY-VLINE,

47 ITAB1-LIFNR,

60 SY-VLINE,

62 ITAB1-EKORG,

80 SY-VLINE,

82 ITAB1-ERDAT,

105 SY-VLINE,

107 ITAB1-ERNAM,

130 SY-VLINE,

132 ITAB1-NETPR,

160 SY-VLINE.

ENDLOOP.

ULINE (160).

RUN TIME ERROR:---

Runtime Errors DBIF_RSQL_INVALID_RSQL

Except. CX_SY_OPEN_SQL_DB

Date and Time 27.09.2007 00:51:18

Short text

RSQL error 23 when accessing table "MARA ".

Missing Handling of System Exception

Program !_SB_RP_MATERIAL

Trigger Location of Exception

Program !_SB_RP_MATERIAL

Include !_SB_RP_MATERIAL

Row 102

Module Name START-OF-SELECTION

Source Code Extract

Line SourceCde

72 22 'MEINS',

73 32 SY-VLINE,

74 34 'ERSDA',

75 44 SY-VLINE,

76 46 'ERNAM',

77 56 SY-VLINE,

78 58 'SPART',

79 68 SY-VLINE,

80 70 'MAKTX',

81 80 SY-VLINE,

82 82 'LVORM',

83 92 SY-VLINE,

84 94 'EKGRP',

85 104 SY-VLINE,

86 106 'WERKS',

87 116 SY-VLINE,

88 118 'LABST',

89 128 SY-VLINE,

90 130 'SPEME',

91 140 SY-VLINE,

92 142 'LGORT',

93 152 SY-VLINE.

94

95 ULINE (152).

96 ULINE (152).

97

98 **************************************************************

99 * START-OF-SELECTION *

100 **************************************************************

101 START-OF-SELECTION.

>>>>> SELECT T1~MATNR

103 T1~MEINS

104 T1~ERSDA

105 T1~ERNAM

106 T1~SPART

107 T2~MAKTX

108 T3~LVORM

109 T3~EKGRP

110 T3~WERKS

111 T4~LABST

112 T4~SPEME

113 T4~LGORT

114 INTO CORRESPONDING FIELDS OF TABLE ITAB

115 FROM MARA AS T1

116 INNER JOIN MAKT AS T2

117 ON T1MATNR = T2MATNR

118 INNER JOIN MARC AS T3

119 ON T2MATNR = T3MATNR

120 INNER JOIN MARD AS T4

121 ON T3MATNR = T4MATNR

THANX & REGARDS,

PHANINDER

7 REPLIES 7

JozsefSzikszai
Active Contributor
0 Kudos
134

hi Phaninder,

SQL Error ==> this means that you have to talk to basis guys and ask them!

ec

Former Member
0 Kudos
134

Hi,

you have an error in type declearation for table ITAB.

SPEME LIKE MARD-SPEME,

LGORT LIKE MARD-SPEME,

Regards,

Tanmay

former_member188827
Active Contributor
0 Kudos
134

in declaration:

instead of..

LGORT LIKE MARD-SPEME,

use

LGORT LIKE MARD-lgort,

Former Member
0 Kudos
134

DATA: BEGIN OF ITAB OCCURS 10,

MATNR LIKE MARA-MATNR,

MEINS LIKE MARA-MEINS,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

SPART LIKE MARA-SPART,

MAKTX LIKE MAKT-MAKTX,

LVORM LIKE MARC-LVORM,

EKGRP LIKE MARC-EKGRP,

WERKS LIKE MARC-WERKS,

LABST LIKE MARD-LABST,

SPEME LIKE MARD-SPEME,

LGORT LIKE MARD-SPEME,

END OF ITAB.

check the second last line declaration

Check your all declaration. The error was because it was unable to move data in tabe ITAB

Former Member
0 Kudos
134

<b>SMALL MISTAKE</b>

&----


*& Report Z_SB_RP_MATERIAL

*&

&----


*&

*&

&----


REPORT Z_SB_RP_MATERIAL

NO STANDARD PAGE HEADING

LINE-SIZE 200

LINE-COUNT 60(2).

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

  • TABLES DECLARATION *

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

TABLES: MARA,

MARD,

MAKT,

MARC,

EINA,

EINE.

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

  • INTERNAL TABLES DECLARATIONS *

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

DATA: BEGIN OF ITAB OCCURS 10,

MATNR LIKE MARA-MATNR,

MEINS LIKE MARA-MEINS,

ERSDA LIKE MARA-ERSDA,

ERNAM LIKE MARA-ERNAM,

SPART LIKE MARA-SPART,

MAKTX LIKE MAKT-MAKTX,

LVORM LIKE MARC-LVORM,

EKGRP LIKE MARC-EKGRP,

WERKS LIKE MARC-WERKS,

LABST LIKE MARD-LABST,

SPEME LIKE MARD-SPEME,

<b>LGORT LIKE MARD-LGORT,</b>

END OF ITAB.

DATA: BEGIN OF ITAB1 OCCURS 3,

INFNR LIKE EINA-INFNR,

MATKL LIKE EINA-MATKL,

LIFNR LIKE EINA-LIFNR,

EKORG LIKE EINE-EKORG,

ERDAT LIKE EINE-ERDAT,

ERNAM LIKE EINE-ERNAM,

NETPR LIKE EINE-NETPR,

END OF ITAB1.

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

  • SELECTION-SCREEN *

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

SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-T01.

SELECT-OPTIONS: SMATNR FOR MARA-MATNR,

SERSDA FOR MARA-ERSDA,

SWERKS FOR MARC-WERKS,

SLGORT FOR MARD-LGORT.

SELECTION-SCREEN END OF BLOCK BLK.

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

  • TOP-OF-PAGE *

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

TOP-OF-PAGE.

ULINE (152).

WRITE:/ SY-VLINE,

02 'S.NO',

06 SY-VLINE,

08 'MATNR',

20 SY-VLINE,

22 'MEINS',

32 SY-VLINE,

34 'ERSDA',

44 SY-VLINE,

46 'ERNAM',

56 SY-VLINE,

58 'SPART',

68 SY-VLINE,

70 'MAKTX',

80 SY-VLINE,

82 'LVORM',

92 SY-VLINE,

94 'EKGRP',

104 SY-VLINE,

106 'WERKS',

116 SY-VLINE,

118 'LABST',

128 SY-VLINE,

130 'SPEME',

140 SY-VLINE,

142 'LGORT',

152 SY-VLINE.

ULINE (152).

ULINE (152).

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

  • START-OF-SELECTION *

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

START-OF-SELECTION.

SELECT T1~MATNR

T1~MEINS

T1~ERSDA

T1~ERNAM

T1~SPART

T2~MAKTX

T3~LVORM

T3~EKGRP

T3~WERKS

T4~LABST

T4~SPEME

T4~LGORT

INTO CORRESPONDING FIELDS OF TABLE ITAB

FROM MARA AS T1

INNER JOIN MAKT AS T2

ON T1MATNR = T2MATNR

INNER JOIN MARC AS T3

ON T2MATNR = T3MATNR

INNER JOIN MARD AS T4

ON T3MATNR = T4MATNR

WHERE T1~MATNR IN SMATNR.

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

  • END-0F-SELECTION *

**************************************************************\

END-OF-SELECTION.

DATA: COUNT(4) TYPE N.

LOOP AT ITAB.

COUNT = COUNT + 1.

WRITE:/ SY-VLINE,

02 COUNT,

06 SY-VLINE,

08 ITAB-MATNR,

20 SY-VLINE,

22 ITAB-MEINS,

32 SY-VLINE,

34 ITAB-ERSDA,

44 SY-VLINE,

46 ITAB-ERNAM,

56 SY-VLINE,

58 ITAB-SPART,

68 SY-VLINE,

70 ITAB-MAKTX,

80 SY-VLINE,

82 ITAB-LVORM,

92 SY-VLINE,

94 ITAB-EKGRP,

104 SY-VLINE,

106 ITAB-WERKS,

116 SY-VLINE,

118 ITAB-LABST,

128 SY-VLINE,

130 ITAB-SPEME,

140 SY-VLINE,

142 ITAB-LGORT,

152 SY-VLINE.

HIDE ITAB-MATNR.

ENDLOOP.

ULINE (152).

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

  • AT LINE-SELECTION *

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

AT LINE-SELECTION.

SELECT T4~INFNR

T4~MATKL

T4~LIFNR

T5~EKORG

T5~ERDAT

T5~ERNAM

T5~NETPR

INTO CORRESPONDING FIELDS OF TABLE ITAB1

FROM EINA AS T4

INNER JOIN EINE AS T5

ON T4INFNR = T5INFNR.

ULINE (160).

WRITE:/ SY-VLINE,

03 'NUMBER OF PURCHASING INFO RECORD',

30 SY-VLINE,

32 'MATERIAL GROUP',

45 SY-VLINE,

47 'VENDOR ACC.NUMBER',

60 'SY-VLINE',

62 'PURCHASING ORGANIZATION',

80 SY-VLINE,

82 'DATA ON WHICH THE RECORD WAS CREATED',

105 SY-VLINE,

107 'NAME OF THE PERSON WHO CREATED THE OBJECT',

130 SY-VLINE,

132 'NET PRICE IN PURCHASING INFO RECORD',

160 SY-VLINE.

ULINE (160).

ULINE (160).

LOOP AT ITAB1.

WRITE:/ SY-VLINE,

03 ITAB1-INFNR,

30 SY-VLINE,

32 ITAB1-MATKL,

45 SY-VLINE,

47 ITAB1-LIFNR,

60 SY-VLINE,

62 ITAB1-EKORG,

80 SY-VLINE,

82 ITAB1-ERDAT,

105 SY-VLINE,

107 ITAB1-ERNAM,

130 SY-VLINE,

132 ITAB1-NETPR,

160 SY-VLINE.

ENDLOOP.

ULINE (160).

Former Member
0 Kudos
134

first let me know in which version u have executed the programme.........................i have tried it in ecc5.0 the problem is in u r start of selection ...dont use into corresponding fields ...if u r fetching the huge number of data...it will search for every field in the itab then it will place.....it will be better using [into table itab].

and one more thing try to declare two different itabs with mara makt as one and mard marc as one and use for all entries .....

dont use join statement for four tables ......even it is performance issue when u use it for 3 tables....

reward points if helpful

Former Member
0 Kudos
134

thanx to all