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: 

Amount Field format problem

0 Kudos

Hi,

I am uploading G/L entry using STD program RFBIBL00.

In input excel file I am getting amount as 1000.1

When i upload excel to Internal table field (Type C) it is 1000.1

I am passing this value as it is to BBSEG-WRBTR.

Program creates BDC Session. But when I execute BDC session in foreground/backgorund, the amount field show 1000,1

and gives error "Input should be in the form __.___.___.__~,__"

My current decimal notation at user level is 1,234,567.89

I tried passing amount to BBSEG-WRBTR in all possible formats but no use.

If i pass amount without decimal. i.e 1000, it works fine.

BBSEG-WRBTR is char16 field.

Any idea, what could be the problem?

This is very urgent.

Thanks & regards,

Umesh

12 REPLIES 12

Former Member
0 Kudos

You can try:


DATA: xcel_f(10) VALUE '1000.1',
      bdc_f(10),
      dec_f LIKE bseg-dmbtr.

dec_f = xcel_f.
bdc_f = dec_f.

WRITE /001 bdc_f.

Rob

0 Kudos

Hi,

Tried. But not working.

Regards,

Umesh

0 Kudos

FORM convert_amount USING p_dcpfm TYPE xudcpfm

<b>p_in_amt TYPE wrbtr</b>

p_waers TYPE waers

CHANGING p_out_amt TYPE wrbtr_bi.

<b> Input amount will be in 99999.99 format

*DATA: lv_amount TYPE wrbtr.</b>

<b>write p_in_amt to p_out_amt</b>

0 Kudos

I am pasting code.

Whatever commented, all tried.

FORM convert_amount USING p_dcpfm TYPE xudcpfm

p_in_amt TYPE c

p_waers TYPE waers

CHANGING p_out_amt TYPE wrbtr_bi.

  • Input amount will be in 99999.99 format

DATA: lv_amount TYPE wrbtr.

lv_amount = p_in_amt.

p_out_amt = lv_amount.

  • CLEAR p_in_amt.

  • WRITE: lv_amount CURRENCY p_waers TO p_out_amt.

  • CONDENSE p_out_amt.

  • WRITE p_out_amt TO p_out_amt LEFT-JUSTIFIED.

  • CASE p_dcpfm.

  • WHEN ''. "1.234.567,89

  • TRANSLATE p_out_amt USING '.#'.

  • TRANSLATE p_out_amt USING ',.'.

  • TRANSLATE p_out_amt USING '# '.

*

  • WHEN 'X'. "1,234,567.89

  • TRANSLATE p_out_amt USING ', '.

  • CONDENSE p_out_amt NO-GAPS.

*

  • WHEN 'Y'. "1 234 567,89

  • TRANSLATE p_out_amt USING ',.'.

  • CONDENSE p_out_amt NO-GAPS.

*

  • ENDCASE.

ENDFORM. " convert_amount

0 Kudos

I tested it. It works for me. What error are you getting?

Try running the code snippet I gave. That should show you how to do it.

Rob

Message was edited by: Rob Burbank

0 Kudos

Hi Umesh,

You can write the statement:

WRITE lv_amount to p_out_amt. This will convert the amount in user defined amount field. Here p_out_amt should be 16 character field.

0 Kudos

Hi Amit,

I tried that also.

In bebug mode I can see after write statement. P_out_amt becomes 1,000.10

But When i execute BDC it shows 1.000,10 and gives error "Enter Numeric Value".

Its strange.

I am not able to Understand how format is changing.

Regards,

Umesh

0 Kudos

Are you executing it or is someone else (with a different currency format)?

rob

Former Member
0 Kudos

Hi umesh,

Define a variable with CHAR16 data type.

use WRITE ..TO statement to get it convert into system decimal notation form automatically.

WRITE <SOURCE> TO <DEST> Here <DEST> is varaible of type CHAR16.

Mark the helpful answers.

Thanks

Eswar

Former Member
0 Kudos

Why dont you try the below

WRITE lval to BBSEG-WRBTR using edit mask 'RR__________.__'.

Former Member
0 Kudos

Hi

Have a variable of type WRBTR.

Write this value to this variable and then use this variable in BDC.

Regards,

Raj

Former Member
0 Kudos

Hi,

Try to set the country ...Before using the WRITE statement...The decimal notation can be set for each country also..

SET COUNTRY 'US'.

  • In your case try to use T001-LAND1 for the company code..

data: v_amount type netpr.

v_amount = '121212121'.

data: v_amount_chr type char16.

write: v_amount to v_amount_chr.

write: / v_amount_chr.

Thanks,

Naren