‎2009 Jun 29 7:20 AM
Hi,
I am getting runtime error 'BCD_BADDATA'.
I am getting values from a file in workarea.
and then using fields to further calculations.
While adding two fields, both are of packed decimal type, I am getting this error.
Please help me out.
Mani.
‎2009 Jun 29 7:24 AM
Dear Mani,
Generally BCD_BADDATA will come in the calculations. If your trying to calculate two incompatible fields this type error will come.
Check all the calculations you are performing.
Thanks and Regards,
‎2009 Jun 29 7:30 AM
Thanks Chandra,
But both the fields are of same type.
So what else I should check, while I am doing calculations.
‎2009 Jun 29 7:29 AM
Hi,
Post the calculation part and the declaration of the variables involved in it...
Regards
Karthik D
‎2009 Jun 29 7:33 AM
Data: SALES(7) TYPE P DECIMALS 2,
COST(10) TYPE P DECIMALS 2.
(Sales is getting value from one file.)
ADD SALES TO COST.
‎2009 Jun 29 7:38 AM
>
> Data: SALES(7) TYPE P DECIMALS 2,
> COST(10) TYPE P DECIMALS 2.
> (Sales is getting value from one file.)
>
> ADD SALES TO COST.
Hi,
What are the values of SALES and COST during the error? Could you be able to reproduce the error?
Regards
Karthik D
‎2009 Jun 29 8:11 AM
‎2009 Jun 29 8:23 AM
Hi,
The error may be possibly because of other calculation, could you post the code segment where the error occurs?
Regards
Karthik D
‎2009 Jun 29 8:25 AM
Hi Karthik,
code is:
IF SUMMARY-BILLG_PERIOD GE PPFY_BEG_YRMO.
CASE SUMMARY-KEY-SALES_CHNNL.
WHEN 'D ' OR 'EMS ' OR 'F ' OR 'MTR ' OR
'RPD ' OR 'RPE ' OR 'SPK '.
PERFORM 2200-COLLECT-PRFT-SPLT.
ENDCASE.
ENDIF.
ADD SUMMARY-SALES TO PROGRAM-SALES. " Here error occurs
ADD SUMMARY-COST TO PROGRAM-COST.
ADD SUMMARY-SELLG_QTY TO PROGRAM-SELLG_QTY.
ADD SUMMARY-BASIC_QTY TO PROGRAM-BASIC_QTY.
ADD SUMMARY-LOW_QTY TO PROGRAM-LOW_QTY.
ADD SUMMARY-ORD_CNT TO PROGRAM-ORD_CNT.
‎2009 Jun 29 8:27 AM
>
> ADD SUMMARY-SALES TO PROGRAM-SALES. " Here error occurs
How is Summary and program declared?
‎2009 Jun 29 8:32 AM
‎2009 Jun 29 7:34 AM
Hi ,
If the types are compatible then check if the value is divided by zero.
Regards,
Ravi.
‎2009 Jun 29 7:58 AM
Hi Mani,
As per the info u have given, regarding the field type.
Always for BDC, the fields used should be chars, if any other type, then it should be converted to string and used.
it is for smooth working of BDCs.
Its not a compulsion to change to string, but just something coz of which, the field type problems dont occur
Please try doing this
Regards,
Radhika
‎2009 Jun 29 8:15 AM
‎2009 Jun 29 8:21 AM
‎2009 Jun 29 9:09 AM
check the OSS note BCD_BADDATA
[http://www.sapfans.com/forums/viewtopic.php?t=108207]