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

Error while using BDC

Former Member
0 Likes
3,576

Hi Experts,

I have used the alv list report

for eg: the output is

vendor.no plant quantity

i had displayed quantity's sum at the end of the field(quantity),using do_sum = 'x'.

that total amount(wrbtr) should display in FB60(in amount field)

i had used bdc for this,but im getting the error as

FIELD INVFO-WRBTR. input value is longer than screen field

Can anyone suggest me on this issue.

Regards,

Sharmila.S

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,517

Take the quantity in the character field. Use CONDENSE..NO GAPS and then pass that to BDC screen field INVFO-WRBTR.

33 REPLIES 33
Read only

Former Member
0 Likes
3,517

Check the subtotal , is it more than length 13.

You need to check INVFO-WRBTR it is having length more than what your are giving on screen.

Did you considered 2 decimal length?

Edited by: Harsh Bhalla on Dec 30, 2009 3:06 PM

Read only

0 Likes
3,517

the quantity field is based on the calculation.the user will enter the value.

as of now the value is 5,572,347.66

Read only

0 Likes
3,517

Check the data type you are using for this field which is passed to BDC.

Preferably use data type as C, with length same as the original data type.

Hope this helps!!!

Read only

0 Likes
3,517

If i give date type c with the original llength.Im not getting the sub total amount,it picks only the line item value

Read only

0 Likes
3,517

You have to pass this total quantity to the BDC screen, if i get it correctly.

Assign this total Quantity to a variable of data type C.

Pass this new variable to the BDC screen.

Read only

0 Likes
3,517

i had done but couldnt get the result

Read only

0 Likes
3,517

Also the correct length for this variable would be 16 & not 13.

13 + 2 decimal + . point.

Read only

0 Likes
3,517

i have changed field length as 16.

but now also im getting the line item value not the subtotal.

Read only

Former Member
0 Likes
3,517

Hi,

Try using CONVERSION routine to convert the total, that you have calculated, into input format. And then assign this converted value to the BDC table.

Regards,

Bhavesh.

Read only

0 Likes
3,517

how to use the conversion routine.

i havent used this type

Read only

0 Likes
3,517

Check the value on runtime in debug mode.

Check what value is passed to the BDC session. You can get some help from there on.

Probably the total is not assigned correctly to the variable passed in BDC.

Read only

0 Likes
3,517

In debugging mode the total is fetching but in the display it is showing the error as FIELD INVFO-WRBTR. input value is longer than screen field

Read only

Former Member
0 Likes
3,518

Take the quantity in the character field. Use CONDENSE..NO GAPS and then pass that to BDC screen field INVFO-WRBTR.

Read only

0 Likes
3,517

applied your concept but only line item value is coming,i need the total value

Read only

0 Likes
3,517

I think you are using do_sum = X for getting the total Quantity.

So the total would be availble during runtime in ALV.

Can you clarify how are you passing the total quantity to the BDC screen.

Read only

0 Likes
3,517

im passing the quantity to another internal table and collecting it.that collect value only im passing to bdc

Read only

0 Likes
3,517

If you are getting a line item value instead of total, then I guess the collect is not working properly for caluculating the total. Check if the collect statement is working properly.

Read only

0 Likes
3,517

If you are getting a line item value instead of total, then I guess the collect is not working properly for caluculating the total. Check if the collect statement is working properly.

Read only

0 Likes
3,517

If you are getting a line item value instead of total, then I guess the collect is not working properly for caluculating the total. Check if the collect statement is working properly.

Read only

0 Likes
3,517

Hi,

Run the BDC in all display mode once. And check what is the value mapping to that field.

There might be some other issues like mapping incorrect source to target.

You can resolve the problem in this way.

Run the FB60 transaction directly with your inputs...here you can easily identify the problem.

If every thing works good from transaction then check the same thing with your program, in all display mode.

comeback here if you find any difficulty.

Thanks,

Naveen Inuganti.

Read only

0 Likes
3,517

if i declare the collect

for eg value type dmbtr.

it is working in the debugging but not display in fb60.

if i declare the collect

for eg value(13) type c.

it is fetching the line item.

Read only

0 Likes
3,517

Just declare the collect as the first option like value type dmbtr.

And while filling the BDC table take it into character and use CONDENSE..NO GAPS and and then transfer to FVAL.

Also in debugging check if value is coming properly in FVAL of that screen field.

Read only

0 Likes
3,517

While debugging,im getting two value

headerline 4900.00 (last value of the line item)

5572347.66(total value)

only 4900.00 value is moving to fb60

Read only

0 Likes
3,517

Can you show the code how you are moving the values to BDC table from your internal table?

I guess the correct value is not getting moved to the BDC table.

Read only

0 Likes
3,517

data:value type c.

loop at it_mseg1.
    move it_mseg1-lifnr to bdc-lifnr.
    move it_mseg1-werks to bdc-werks.
    move it_mseg1-diff to bdc-diff1.
    collect bdc.
    clear it_mseg1.
    endloop.
    value = bdc-diff1.*this is the value*

    CONDENSE value no-gaps.
loop at bdc.
perform bdc_dynpro      using 'SAPMF05A' '1100'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.


*perform bdc_field       using 'INVFO-WRBTR'
                              value.*

*perform bdc_field       using 'INVFO-WRBTR'
                              value.*

                          

*perform bdc_field       using 'INVFO-WRBTR'
                              value.*


*perform bdc_field       using 'INVFO-WRBTR'
                              value.*
            
*perform bdc_field       using 'INVFO-WRBTR'
                              value.*


*perform bdc_field       using 'INVFO-WRBTR'
                              value.*


  CALL TRANSACTION 'FB60' USING BDCDATA MODE 'A' .


ENDLOOP.


  ENDCASE.
ENDFORM.                    "USER_COMMAND

Edited by: Sharmila Somasundaram on Dec 30, 2009 6:31 PM

Edited by: Sharmila Somasundaram on Dec 30, 2009 6:52 PM

Read only

0 Likes
3,517

Value should be have length 16. Declare like this data: value type char20.

Type c means only one character field.

Read only

0 Likes
3,517

You wrote:

headerline 4900.00 (last value of the line item)
5572347.66(total value)
Only 4900.00 is moving...

Because "Value" is having 4900.00 only.

check the problem in your code here:

loop at it_mseg1.
     move it_mseg1-lifnr to bdc-lifnr.
     move it_mseg1-werks to bdc-werks.
     move it_mseg1-diff to bdc-diff1.  <--- 4900.00 for last record
     collect bdc.
     clear it_mseg1.
   endloop.
   
  value = bdc-diff1.   <---- this work area bdc-diff1 can have last record value only i.e. 4900.00

change code some thing like this.

loop at it_mseg1.
     value = value + it_mseg1-diff.  <--- fill value here.
     move it_mseg1-lifnr to bdc-lifnr.
     move it_mseg1-werks to bdc-werks.
     move it_mseg1-diff to bdc-diff1.  
     collect bdc.
     clear it_mseg1.
   endloop.

Thanks,

Naveen.I

Read only

0 Likes
3,517

Check if MSEG-DIFF1 is getting populated correctly. If it is getting populated correctly then I guess only data type of value is the problem.

Read only

0 Likes
3,517

Agreed with Naveen the problem is that either you need to add the quantity is some varaiable inside the loop or otherwise read the table with index 1 after the loop and then pass the value into BDC.

Read only

0 Likes
3,517

Hi Naveen,

Thanks a lot i got the answer.

Edited by: Sharmila Somasundaram on Dec 31, 2009 11:35 AM

Read only

Former Member
0 Likes
3,517

Hi Sharmila,

What I want to say is keep the data type of quantity equal to WRBTR in final internal table which you are showing in ALV.

In that case you will get the correct subtotal . And during populating BDC table take the quantity field in character and use CONDENSE..NO GAPS.

Let me know in case of any issues.

Read only

0 Likes
3,517

i tried exactly the same way as u mentioned

Read only

Former Member
0 Likes
3,517

If you are getting a line item value instead of total, then I guess the collect is not working properly for caluculating the total. Check if the collect statement is working properly.