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: 

Program termination in BDC upload

Former Member
0 Kudos

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 .

4 REPLIES 4

Manohar2u
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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. 

Former Member
0 Kudos

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.