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

Need help to fix run time error.

Former Member
0 Likes
1,336

Hi,

I am getting runtime error as below below code:

EPORT ZCLASSIC_ALV_030725_REPORT.

Tables:MARA.

Parameter: Cu_date like sy-datum default sy-datum,

DMAP as checkbox,

All_CAP as checkbox,

ALV_Rep radiobutton group g1 default 'X',

Clas_Rep radiobutton group g1.

types: begin of t_mara,

MATNR type MARA-MATNR,

ERSDA type MARA-ERSDA,

MBRSH type MBRSH,

MATKL type MATKL,

MEINS type MEINS,

End of t_mara.

Data : i_mara type standard table of t_mara,

wa_mara type t_mara.

selection-screen begin of block b1.

Select-options: SO_MATNR for MARA-MATNR,

so_MATKL for MARA-MATKL.

selection-screen end of block b1.

start-of-selection.

select x~MATNR

y~ERSDA

y~MBRSH

x~MATKL

y~MEINS

y~MEINS

into table i_MARA from Mara as x inner join MARA as y on xMATNR = yMATNR

where x~MATNR in so_matnr and

x~MATKL in so_matkl.

End-of-selection.

Loop at i_mara into wa_mara.

write: /1 wa_mara-MATNR,

wa_mara-ERSDA,

wa_mara-MBRSH,

wa_mara-MATKL,

wa_mara-MEINS.

skip.

clear: wa_mara.

endloop.

pls have a look on this and make correction on this.

Edited by: Avinav@27 on Oct 20, 2009 1:14 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
958

Hi

select x~MATNR

y~ERSDA

y~MBRSH

x~MATKL

y~MEINS

y~MEINS ---> Remove this and hope it would be fine

into table i_MARA from Mara as x inner join MARA as y on xMATNR = yMATNR

where x~MATNR in so_matnr and

x~MATKL in so_matkl.

Why you want an INNER JOIN on the same table ???????

Try omit that.

since your I_mara has only 5 components and you are selecting 6 fields and passing them back

Cheers

Ram

Edited by: Ramchander Krishnamraju on Oct 20, 2009 1:20 PM

5 REPLIES 5
Read only

Former Member
0 Likes
958

read the dump..

what does it say?

Read only

Former Member
0 Likes
959

Hi

select x~MATNR

y~ERSDA

y~MBRSH

x~MATKL

y~MEINS

y~MEINS ---> Remove this and hope it would be fine

into table i_MARA from Mara as x inner join MARA as y on xMATNR = yMATNR

where x~MATNR in so_matnr and

x~MATKL in so_matkl.

Why you want an INNER JOIN on the same table ???????

Try omit that.

since your I_mara has only 5 components and you are selecting 6 fields and passing them back

Cheers

Ram

Edited by: Ramchander Krishnamraju on Oct 20, 2009 1:20 PM

Read only

Former Member
0 Likes
958

Debug your code and find where the error lies and make the necessary correction. Still if you are not able to solve it, post the specific issue and the error you are facing for any suggestions. Please dont expect others to do your work

Read only

Former Member
0 Likes
958

Thanks for the Answer.............

Read only

Former Member
0 Likes
958

Hi Avinav,

You will be getting below runtime error..

Too few fields in INTO clause.

Your internal table contains less number of fileld then you wrote in the select statement..

SELECT X~MATNR
  Y~ERSDA
  Y~MBRSH
  X~MATKL
  Y~MEINS
*  Y~MEINS " Comment or Remove it.. you need to select it once only...
  INTO TABLE I_MARA FROM MARA AS X INNER JOIN MARA AS Y ON X~MATNR = Y~MATNR
  WHERE X~MATNR IN SO_MATNR AND
  X~MATKL IN SO_MATKL.

Suggest you to read the dump analysis when you are getting dump through ST22 T-code...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya