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: 

convert

Former Member
0 Kudos

TYPES: BEGIN OF t_alter,

matnr LIKE mara-matnr, "Material number

MTART LIKE mara-MTART, "Plant

END OF t_alter.

data : v_int type i.

data :i_alter TYPE STANDARD TABLE OF t_alter,

wa_alter type t_alter.

select matnr MTART from mara into table i_alter.

loop at i_alter into wa_alter.

v_int = v_int + 1.

write 😕 v_int , wa_alter-matnr.

endloop.

in this program v_int value is 1,000 1,001 is coming

in this i want display v_int valiue 1000 not display ',' .how to convert ','

pls send the code.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Kumar,

Convert it to char.

Data: v_char(10) type c.
TYPES: BEGIN OF t_alter,
matnr LIKE mara-matnr, "Material number
MTART LIKE mara-MTART, "Plant
END OF t_alter.
data : v_int type i.
data :i_alter TYPE STANDARD TABLE OF t_alter,
wa_alter type t_alter.
select matnr MTART from mara into table i_alter.
loop at i_alter into wa_alter.
v_int = v_int + 1.
Move v_int to v_char.
write 😕 v_char , wa_alter-matnr.
endloop.

Regards,

Satish

8 REPLIES 8

kesavadas_thekkillath
Active Contributor
0 Kudos

declare it as type c to your required length

former_member386202
Active Contributor
0 Kudos

Hi,

Declare v_int as type p with decimals 0.

Data : V_int typ p decimals 0.

Regards,

Prashant

Former Member
0 Kudos

hi kuamr kk ,

one way to do this is to change envoirment variables.

System->User Profile->Own data

Click on Defaults TAB change Decimal Notations.

Regards,

Sachin

0 Kudos

As sachin said change the profile settings, or you can use the variable type NUMC.

but i suggest going with Sachin's idea.

regards,

Niran

0 Kudos

Hi Kumar,

If you want to see the value as 1000 instead of 1,000. I strongly believe you need to move it to char variable, If you change your user settings, it looks okay to you , but when the user with diff. settings is accessing this program might get different look.

So I prefer move it to Char.

Thanks,

Pavan

Former Member
0 Kudos

Kumar,

Convert it to char.

Data: v_char(10) type c.
TYPES: BEGIN OF t_alter,
matnr LIKE mara-matnr, "Material number
MTART LIKE mara-MTART, "Plant
END OF t_alter.
data : v_int type i.
data :i_alter TYPE STANDARD TABLE OF t_alter,
wa_alter type t_alter.
select matnr MTART from mara into table i_alter.
loop at i_alter into wa_alter.
v_int = v_int + 1.
Move v_int to v_char.
write 😕 v_char , wa_alter-matnr.
endloop.

Regards,

Satish

0 Kudos

hi satish

thanks

former_member191735
Active Contributor
0 Kudos

Use Replace all occurenses ',' with space. This will work.

check out help on replace .... you will see.. No need to convert into different field but make sure your field should be a char field or just check out the help.