2006 Jun 30 7:55 PM
Hi ,
i am using the BDC method to upload data into infotype table pa2010 . on the selection screen of the include of the BDC method i.e INCLUDE bdcrecx1 there is field called NoDataIndicator as / . In the program i am doing some calculation to get no of hours worked like .
IF NOT record-stdaz_006 IS INITIAL.
v_days_006 = record-stdaz_006 / v_arbst.
PERFORM bdc_field USING 'P2012-ANZHL' v_days_006.
ELSE.
v_days_007 = record-anzhl_007 / v_arbst.
PERFORM bdc_field USING 'P2012-ANZHL' v_days_007.
ENDIF.
the program is terminating when it coming to ' / ' in the calculation part and shows the error in
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> NODATA. -
error is shown at this point
CLEAR BDCDATA.
BDCDATA-FNAM = FNAM.
BDCDATA-FVAL = FVAL.
APPEND BDCDATA.
ENDIF.
ENDFORM.
when i remove the / in the selection screen it is not showing error . Please advise me on this how to handle as i want the option nodataindicator as / on the selection screen .
2006 Jun 30 8:02 PM
what is data type id data and v_days_006. Might be the the data conversion/mismatch issue.
try with
<b>if fval ne space.</b>
Regds
Manohar
2006 Jun 30 8:07 PM
I think you need to write both v_days_006 and v_days_007 to a character field and pass the character field to bdc_field.
Rob
2006 Jun 30 8:21 PM
You basically have to declare a character variable to store the calculated value and pass that to the routine as the subroutine is expecting it to be a character field.
Try this.
DATA: v_anzhl(8).
IF NOT record-stdaz_006 IS INITIAL.
v_days_006 = record-stdaz_006 / v_arbst.
CLEAR v_anzhl.
WRITE v_days_006 TO v_anzhl NO-GROUPING.
PERFORM bdc_field USING 'P2012-ANZHL' v_anzhl.
ELSE.
v_days_007 = record-anzhl_007 / v_arbst.
CLEAR v_anzhl.
WRITE v_days_007 TO v_anzhl NO-GROUPING.
PERFORM bdc_field USING 'P2012-ANZHL' v_anzhl.
ENDIF.
2006 Jun 30 8:52 PM
Hi latha,
use this,
IF FVAL <> space.
also pass v_days_006 and v_days_007 to other variables
and use them in perform statement.
regards,
keerthi.