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

convert

Former Member
0 Likes
889

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
Read only

Former Member
0 Likes
822

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
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
822

declare it as type c to your required length

Read only

former_member386202
Active Contributor
0 Likes
822

Hi,

Declare v_int as type p with decimals 0.

Data : V_int typ p decimals 0.

Regards,

Prashant

Read only

Former Member
0 Likes
822

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

Read only

0 Likes
822

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

Read only

0 Likes
822

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

Read only

Former Member
0 Likes
823

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

Read only

0 Likes
822

hi satish

thanks

Read only

former_member191735
Active Contributor
0 Likes
822

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.