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

Quantity Conversion

Former Member
0 Likes
1,299

Hi Experts,

I am doing BDC on PO.

while uploading PO quantity MENGE value (ex. 17.90) to BDC , I am getting the value in BDC Screen as 17.90,00.

How can I get the exact value(17.90).

Help me in this issue..

Regards

Ganesh Reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,196

Hi,

If u use Quantity or Rate values,u must take MENGE type Char in u r program.

8 REPLIES 8
Read only

Former Member
0 Likes
1,196

HI,

take a varibale type char with required length and then use the write statement.

For Ex : WRITE MENGE to <Var>.

it writes the data to user format. Try this.

Read only

Former Member
0 Likes
1,197

Hi,

If u use Quantity or Rate values,u must take MENGE type Char in u r program.

Read only

Former Member
0 Likes
1,196

Hi Ganesh,

Declare the variable as PACKED DECIMAL as below.

DATA: VAR1 type P DECIMALS 2

.

Thanks

Read only

0 Likes
1,196

still I am getting the same error..

Read only

Former Member
0 Likes
1,196

Hi Ganesh,

I think you are getting this because of the user settings.

ask your FC to change the DECIMAL point SETTINGS

HOPE this will work for you.

regards

Ramchander Rao.K

Read only

Former Member
0 Likes
1,196

You need to ensure that you are using a character variable for the BDC input.

do something like


data: w_char(15) type c.

data: w_menge like ekpo-menge value '17.90'.

write: w_menge to w_char decimals 3 no-grouping.

and then use w_char for your bdc session.

Cheers

Allan

Edited by: Allan Willis on Nov 21, 2008 8:34 AM changed decimals to 3

Read only

Former Member
0 Likes
1,196

perform format_quantity using l_menge

changing menge_string.

form format_quantity using p_gsmng

changing p_gsmng_string.

data: l_thousand_SEPERATOR(1) type c.

perform GET_THOUSAND_SEPERATOR changing l_thousand_SEPERATOR.

  • Remove thousand seperator

write p_gsmng to p_gsmng_string.

replace l_thousand_SEPERATOR with ' ' into p_gsmng_string.

condense p_gsmng_string no-gaps.

endform. " format_quantity

form get_thousand_seperator using p_sep.

data: l_amount like bseg-dmbtr,

l_amount_string(15) type c.

  • Find 1000 seperator. If decimal seperator = . then

  • 1000 seperator = , else 1000 seperator = .

l_amount = '1.00'.

write l_amount to l_amount_string.

if l_amount_string cs ','.

p_sep = '.'.

else.

p_sep = ','.

endif.

endform. " GET_THOUSAND_SEPERATOR

Read only

0 Likes
1,196

Sreekanth, you can avoid all that code to remove the thousands separator by using the no-grouping option on the write statement.

Cheers

Allan