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

BDC Error:input value is longer than screen field?

arpita_churi3
Active Participant
0 Likes
12,294

Hi all,

I have written a BDC program for a ztcode in that i am enetring values on screen fields and on click of save button it will save data to ztable.

Following is my recording:

PERFORM BDC_DYNPRO USING 'ZCUST_MPOOL_BDC' '0100'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SAVE'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ZCUSTOMER-ZAGE'.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'

WA_CUST-ZCUSTID.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZFNAME'

WA_CUST-ZFNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZLNAME'

WA_CUST-ZLNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZADDR'

WA_CUST-ZADDR.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZMOBILE'

WA_CUST-ZMOBILE.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZSEX'

WA_CUST-ZSEX.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZAGE'

WA_CUST-ZAGE.

the session is created sucessfully but i run session through SM35,i wont take all values from my text file.

It will not take ZCUSTID (Primary key of type INT1)and ZAGE(type INT1) and in the log it will dispaly the following error:

Field ZCUSTOMER-ZCUSTID. input value is longer than screen field

Field ZCUSTOMER-ZAGE. input value is longer than screen field

and record is saved in ztable with these two fiedls as blanks.

Thanks and Regards,

Arpita

1 ACCEPTED SOLUTION
Read only

Former Member
4,504

Hi Arpita,

the value might be moving to extreme right as fval is char132,

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'

WA_CUST-ZCUSTID. check it in debugging mode the value for fval at 132 position the value is displayed .

delete the leading spaces, just as done below.

so if you are writing perform in ur report change the form

as

FORM bdc_field USING fnam fval.
  CLEAR wa_bdcdata.
  wa_bdcdata-fnam = fnam.
  wa_bdcdata-fval = fval.
  SHIFT wa_bdcdata-fval LEFT DELETING LEADING space.   " this statement will do the rest.
  APPEND wa_bdcdata TO bdcdata.
ENDFORM.                    "BDC_FIELD

Regards,

Aby

Hi all,

I have written a BDC program for a ztcode in that i am enetring values on screen fields and on click of save button it will save data to ztable.

Following is my recording:

PERFORM BDC_DYNPRO USING 'ZCUST_MPOOL_BDC' '0100'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SAVE'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ZCUSTOMER-ZAGE'.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'

WA_CUST-ZCUSTID.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZFNAME'

WA_CUST-ZFNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZLNAME'

WA_CUST-ZLNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZADDR'

WA_CUST-ZADDR.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZMOBILE'

WA_CUST-ZMOBILE.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZSEX'

WA_CUST-ZSEX.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZAGE'

WA_CUST-ZAGE.

the session is created sucessfully but i run session through SM35,i wont take all values from my text file.

It will not take ZCUSTID (Primary key of type INT1)and ZAGE(type INT1) and in the log it will dispaly the following error:

Field ZCUSTOMER-ZCUSTID. input value is longer than screen field

Field ZCUSTOMER-ZAGE. input value is longer than screen field

and record is saved in ztable with these two fiedls as blanks.

Thanks and Regards,

Arpita

10 REPLIES 10
Read only

Former Member
0 Likes
4,504

Hi,

Check the domain, and screen field lenths.

there might be miss match in display lenth and actual(visible) lenth.

Read only

Former Member
0 Likes
4,504

Hi Arpita,

Use WRITE .. TO Statement instead of = while moving the data for BDC..

This should solve your issue..

Nag

Read only

former_member585060
Active Contributor
0 Likes
4,504

Hi,

Check weather the workarea WA_CUST is of type ZCUSTOMER. That error comes when the incoming field and the structure field are different.

ZCUSTOMER-ZCUSTID & WA_CUST-ZCUSTID

ZCUSTOMER-ZAGE & WA_CUST-ZAGE

Should have same datatype.

Regards

Bala Krishna

Read only

Former Member
4,505

Hi Arpita,

the value might be moving to extreme right as fval is char132,

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'

WA_CUST-ZCUSTID. check it in debugging mode the value for fval at 132 position the value is displayed .

delete the leading spaces, just as done below.

so if you are writing perform in ur report change the form

as

FORM bdc_field USING fnam fval.
  CLEAR wa_bdcdata.
  wa_bdcdata-fnam = fnam.
  wa_bdcdata-fval = fval.
  SHIFT wa_bdcdata-fval LEFT DELETING LEADING space.   " this statement will do the rest.
  APPEND wa_bdcdata TO bdcdata.
ENDFORM.                    "BDC_FIELD

Regards,

Aby

Read only

0 Likes
4,504

Hi Abhi,

Thanks for replay.

My issue is solved. it is taking values properly now.

But the problem now is there are 5 records in my text file but it wont take all record one by one.

It will ask me "Do you still want to keep the batch input data?" and after pressing no it will take next record.

I wnat that all record should be taken one by one.

Thanks and Regards,

Arpita

Read only

0 Likes
4,504

Hi Arpita,

One thing i would like to tell always use the string variable when you passed the data to BDC fields and Condense the string variable.


Thanks

Nishant

Read only

0 Likes
4,504

Hi Arpita,

Need help your help if you find answer for below, could you please share here how you proceed ?

"But the problem now is there are 5 records in my text file but it wont take all record one by one.

It will ask me "Do you still want to keep the batch input data?" and after pressing no it will take next record.

I wnat that all record should be taken one by one"

As I also want to perform same thing in my requirement .

Thank you in advance!

BR,Swati

Read only

Former Member
0 Likes
4,504

Hi,

Try this...

First Declare two variable of type CHAR with the same length of ur field which showing blank.

Now assign Values to this Variable

like w1 = wa- ,

w2 = wa- ,

and then pass theses variable in BDC Field .

like instead of passing wa-

pass w1 in bdc field

I am sure it will work.

Read only

Former Member
0 Likes
4,504

Hi,

Try this.

PERFORM BDC_DYNPRO USING 'ZCUST_MPOOL_BDC' '0100'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=SAVE'.

condense ZCUSTOMER-ZAGE.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'ZCUSTOMER-ZAGE'.

condense WA_CUST-ZCUSTID.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'

WA_CUST-ZCUSTID.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZFNAME'

WA_CUST-ZFNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZLNAME'

WA_CUST-ZLNAME.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZADDR'

WA_CUST-ZADDR.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZMOBILE'

WA_CUST-ZMOBILE.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZSEX'

WA_CUST-ZSEX.

PERFORM BDC_FIELD USING 'ZCUSTOMER-ZAGE'

WA_CUST-ZAGE.

if it doesnt work then let me know data elemnt of zagw & ZCUSTID.

Rgds

Siva

Read only

Former Member
0 Likes
4,504

Hi everybody,

Try this one.You will get succeed.


FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR wa_BDCDATA.
wa_BDCDATA
-PROGRAM  = PROGRAM.
wa_BDCDATA
-DYNPRO   = DYNPRO.
wa_BDCDATA
-DYNBEGIN = 'X'.
APPEND wa_BDCDATA to it_bdcdata.
ENDFORM.

FORM BDC_FIELD USING FNAM FVAL.
*  IF FVAL <> NODATA.
CLEAR wa_BDCDATA.
wa_BDCDATA
-FNAM = FNAM.
wa_BDCDATA
-FVAL = FVAL.
SHIFT wa_bdcdata-fval LEFT DELETING LEADING space.
APPEND wa_BDCDATA to it_bdcdata.
*  ENDIF.
ENDFORM.