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

issue with bdc

Former Member
0 Likes
904

Hi all,

Iam writing a bdc program and passing the values from the internal table.

I have declared the field using standard table,

mabst like marc-mabst,

Iam reading the value from marc , then iam reducing it to half

data: begin of mat_int_table occurs 0,

matnr like mara-matnr,

werks like marc-werks ,

bstrf like marc-bstrf,

mabst like marc-mabst,

minbe like marc-minbe,

end of mat_int_table .

select * from marc where matnr in smatnr and

werks in swerks.

clear mat_int_table.

move marc-werks to mat_int_table-werks.

move marc-matnr to mat_int_table-matnr .

move marc-bstrf to mat_int_table-bstrf.

mat_int_table-mabst = ( marc-mabst / 2 ).

move marc-minbe to mat_int_table-minbe .

append mat_int_table.

loop at mat_int_table.

refresh bdcdata.

perform bdc_field using 'BDC_CURSOR'

'MARC-MABST'.

perform bdc_field using 'MARC-DISLS'

'HB'.

perform bdc_field using 'MARC-MABST'

  • '200'.---- this thing works.

MAT_INT_TABLE-MABST. -


this is where iam having problem

endloop.

the error iam getting is

Field MARC-MABST. input value is longer than screen field

Can anyone tell whats the issurein here

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
875

Hi,

I had a similar problem once in BDC with a amount field. What i did is create a field of type character and pass it to BDC.

In you case MARC-MABST is quantity field. You defined a field as

<b>DATA: l_MABST(13) type c.</b>

Assing the value of MARC-MABST to l_MABST and use l_MABST in your BDC. It will solve your problem.

So, your code would be

*************************************************
l_MABST = MAT_INT_TABLE-MABST.

perform bdc_field using 'MARC-MABST' l_MABST.

*************************************************

Let me know if you have any question.

Regards,

RS

Regards,

RS

Hi,

I had a similar problem once in BDC with a amount field. What i did is create a field of type character and pass it to BDC.

In you case MARC-MABST is quantity field. You defined a field as

<b>DATA: l_MABST(13) type c.</b>

Assing the value of MARC-MABST to l_MABST and use l_MABST in your BDC. It will solve your problem.

So, your code would be

*************************************************
l_MABST = MAT_INT_TABLE-MABST.

perform bdc_field using 'MARC-MABST' l_MABST.

*************************************************

Let me know if you have any question.

Regards,

RS

Regards,

RS

6 REPLIES 6
Read only

Former Member
0 Likes
876

Hi,

I had a similar problem once in BDC with a amount field. What i did is create a field of type character and pass it to BDC.

In you case MARC-MABST is quantity field. You defined a field as

<b>DATA: l_MABST(13) type c.</b>

Assing the value of MARC-MABST to l_MABST and use l_MABST in your BDC. It will solve your problem.

So, your code would be

*************************************************
l_MABST = MAT_INT_TABLE-MABST.

perform bdc_field using 'MARC-MABST' l_MABST.

*************************************************

Let me know if you have any question.

Regards,

RS

Regards,

RS

Read only

Former Member
0 Likes
875

Hi,

I had a similar problem once in BDC with a amount field. What i did is create a field of type character and pass it to BDC.

In you case MARC-MABST is quantity field. You defined a field as

<b>DATA: l_MABST(13) type c.</b>

Assing the value of MARC-MABST to l_MABST and use l_MABST in your BDC. It will solve your problem.

So, your code would be

*************************************************
l_MABST = MAT_INT_TABLE-MABST.
 
perform bdc_field using 'MARC-MABST' l_MABST.
 
*************************************************

Let me know if you have any question.

Regards,

RS

<b>Sorry, double posting due to network problem.</b>

Read only

RaymondGiuseppi
Active Contributor
0 Likes
875

When coming to Batch Input with quantity or amount, use WRITE to BDCDATA instead of MOVE.

Regards

Read only

0 Likes
875

Hi

RS - I got it resolved by your suggestion

Is athere any particular reason for that.

Raymond, we cannot use write marc-mabst to xyz because it s quantity field.

so you mean to move into char field and then write to xyz.

is that what you are saying let me know

thanks

venki

Read only

0 Likes
875

Hi,

I do not know what the exact reason is, but it has something to do with the "internal length" of data type and "display length" of data type. This issue is prevalent for currency field, amount fields.

Thats is the reason that when you do BDC it is always recommended to use the field of type C ( Character) to pass the values of all of your field.. So, pass your field value to field of type character and then pass it to BDC table. This problem does not happen for field type DEC, CHAR, NUMC because here, "field length" and "display length" is same.

I hope this clarifies your doubt.

If your issue has been resolved, please award the points accordingly and close the thread. So in future if someone has same issue it is easy for someone to find the solution with "answered" thread.

Let me know if you have any question.

Regards,

RS

Read only

0 Likes
875

Hi

Thank you

I have answered points to all.