cancel
Showing results for 
Search instead for 
Did you mean: 

remove leading spaces in currency field

Former Member
0 Kudos

Hi,

Could you please tell me how to remove leading spaces in currency field in write statement?

the length of the field cannot be changed by writing fieldname(length).

is there any other method to do the same. the length should vary according to the amount in the field.

Ragards,

Krutika

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Thank u for help........

Former Member
0 Kudos

Hi,

define a variable of type string(or Char20) in Global definitions.

pass your currency field to this variable.

use Shift <Variable> left deleting leading space.

if you have decimal values in your amount field then you have define one more variable1 of type P decimals 3.

pass your amount field to this variable.

and this variable1 to variable.

then shift .... left deleting leading space.

Thanks,

Sree.

Former Member
0 Kudos

Thanks,

Actually we are getting issue like in BDC even though our value is correct, In BDC filedcat value it is showing with leading space.

after using your code it is working.

so conclusion is that in BDC if anybody is having any decimal values.

please trim leading space before passing it to BDC.

else it will give erro like. 'Field value is longer than field in BDC' something like that.

Thks.

Former Member
0 Kudos

Hi Krutika,

Use Character field then you can remove leading zeros.

data : dl_curr type char18.

write <curr> to dl_curr currency <waers>.

Condense dl_curr.

Regards,

Ramu N.

Former Member
0 Kudos

Hi,

If this is regarding Smartforms when u drag and Drop the Currency field say WEARS in the Text, Selct the field and Say EDIT button on the right corner and Say &IT_VBAP-WAERS(CZ)& and Say Enter this will reduce the leading spaces.

Thanks and Regards,

Vijaya Lakshmi.T

Former Member
0 Kudos

hi,

Try &field-name(CIZ)&

or &field-name(C)&

Regards,

Sujit

Former Member
0 Kudos

Hi,

try this

data: value type dmbtr.

value = '120121'.

write:/ value left-justified.

regards,

Venkatesh