2014 Feb 24 5:35 AM
Hi Gurus,
Can you help me with this? Error was Division 0 type p.
Thanks for your BIG HELP!!
2014 Feb 24 6:40 AM
2014 Feb 24 6:01 AM
Hi Neezaa,
From the DUMP snapshot, it doesnt seem that it is division by 0 error.
It looks like your select statement is incomplete.
The reasons can be:
1)Use INTO clause in the select.
2)If you dont want to use INTO then declare the tables using TABLES statement.(This is obsolete)
Thanks,
Shilpa Bansal.
2014 Feb 24 6:01 AM
2014 Feb 24 6:18 AM
Hi Harsh,
Have you used Select single in your prog,
If yes, mention the table name in TABLES statement or else.
DATA: lv_stru type <ztable name>.
now you can change your code like
select single * from <ztable> into lv_stru.
This is resolve your issue.
Arivazhagan S
2014 Feb 24 6:09 AM
Hi,
Can you please send source code extract of the statement where this dump occured.
2014 Feb 24 6:22 AM
Hi Neezaa,
Please post screenshot for source code extract where the dump is occurring. You can see it in ST22. We can help you further after looking at it.
Regards,
Sheetal A.
2014 Feb 24 6:40 AM
2014 Feb 24 6:47 AM
Seems ITAB_D-Nsp is initial in this case thats why u getting dump.
Try by making below modifications.
IF NOT itab_d-nsp is INITIAL.
itab_d-nios = itab_d-nil/itab_d-nsp * 100.
ENDIF.
2014 Feb 24 6:50 AM
Hi,
The earlier screenshot showed a different error.
Well to avoid this division by 0 error just use following statement:
If itab_d-nsp is not initial.
itab_d-nios = itab_d-nil/itab_d-nsp * 100.
endif.
2014 Feb 24 6:56 AM
Hi Neezaa,
You are getting error because itab_d-nsp is having value as 0. You cannot divide by zero without handling the exception. So my advise would be whenever you are dividing by zero just check before that if the value is initial or not. Please do as suggested by and Shilpa Bansal.
Regards,
Sheetal.
2014 Feb 24 7:10 AM
hi neezaa,
try replacing line 507 by snippet
if itab_d-nsp eq 0.
itab_d-nios = itab_d-nil.
elseif itab_d-nsp ne 0.
itab_d-nios = itab_d-nil/itab_d-nsp * 100.
endif.
Hope it solves ur problem.
2014 Feb 24 7:03 AM
This error is coming because , in run time 'itab_d-nsp*100 ' is zero .
to avoid this , put condition like
IF itab_d-nsp IS NOT INITIAL .
Iitab_d-nios = itab_d-nil / itab_d-nsp*100 .
ENDIF .
Regards
DJ .
2014 Feb 24 7:05 AM
Hi Neeza
The earlier dump and this one both are different. One is because you have not declarared target work area to hold value during select and second is because of divide by zero error. Please put an if clasue before diving to check if it is not initial then only proceed
Nabheet
2014 Feb 24 7:24 AM
Hello Neezaa Dee ,
This is because of Zero value in the field itab_d-nsp.
So before calculting just check with itab_d-nsp not equal to zero...
****Note Use brackets for the calcultions [ Ex : A = B + ( C * 100 ) or A = ( B + C ) * 100 ]
follow the below code ..
IF ITAB_D-NSP <> 0.
ITAB_D-NIOS = ( ITAB_D-NIL / ITAB_D-NSP ) * 100.
ENDIF.
or otherwise follow Mr.Hitesh Wankhede said above...
Thanks,
Vijay SR