01-10-2007 7:01 PM
hi All,
I am having a requirement. client wants to download a record into a .txt file. now the record is AAAASPACEBBBBBDDDD.
now the problem is DDDD is decimal value and i m converting it to character. however though now the client wants the record such as the field DDDD should be right justfied. now i can right justify if decimal value but since i have converted it to character so that i can use concatenate and write to a file on Pc, i am not able to right justify it.
can someone give me some suggestions,
thanks,
gaurav
01-10-2007 7:34 PM
When you write the decimasl to the character field:
WRITE f_d to itab-f_c RIGHT-JUSTIFIED.
Rob
01-10-2007 7:16 PM
Hi,
Try with this code.
Data: v_string type string.
Data: v_len type i.
Data: v_int(10) type n.
Data: v_char(10) type c.
CONSTANTS c_six(6) type c value ' '.
v_string = 'Amandeep Sharma1981'.
v_len = strlen( v_string ).
v_len = v_len - 4.
v_int = v_string+v_len(4).
v_char = v_int.
v_char+0(6) = c_six.
Concatenate v_string+0(v_len) v_char into v_string.
I have taken your numerical value as 4 characters. you can modify as and how you want.
Regards,
Aman
01-10-2007 7:34 PM
When you write the decimasl to the character field:
WRITE f_d to itab-f_c RIGHT-JUSTIFIED.
Rob