‎2008 Mar 28 9:06 AM
Hi,
I have a variable to type string whose value is 20080328. Now i want display the output in the format 28032008?
Regards,
Asha
‎2008 Mar 28 9:10 AM
hi Asha,
Do this way ...
data :v_date(10) type c value '20080328',
v_date1(10) .
Concatenate v_date+6(2) v_date+4(2) _date+0(4) into v_date1.
write : v_date1.
‎2008 Mar 28 9:08 AM
hi,
Please find the below example .....
DATA: v_date TYPE c LENGTH 10.
WRITE sy-datum TO v_date.This will do ur job simple... no need to split string....
All the very best....
Regards,
Sreenivasa sarma K.
Edited by: sharmashree kashi on Mar 28, 2008 5:13 PM
‎2008 Mar 28 9:09 AM
‎2008 Mar 28 9:10 AM
‎2008 Mar 28 9:10 AM
z1 = lz_string(4).
z2 = lz_string+4(2).
z3 = lz_string+6(2).
concatenate z3 z2 z1 into lz_string2.
‎2008 Mar 28 9:10 AM
hi Asha,
Do this way ...
data :v_date(10) type c value '20080328',
v_date1(10) .
Concatenate v_date+6(2) v_date+4(2) _date+0(4) into v_date1.
write : v_date1.
‎2008 Mar 28 9:12 AM
write sydatum to g_date mm/dd/yyyy.
This should work.
If u want to know how to split then here it is
SPLIT wa_data-data AT tab
INTO:
wa_item-ind2
wa_item-posnr
wa_item-matnr
wa_item-kwmeng
wa_item-pstyv
wa_item-werks.
Here tab is tab operator.
if u want you can do offset also. like this g_date+2(2).Which will give u the months.
‎2008 Mar 28 9:14 AM
Hi,
Check this piece of code.
data: v_var type string value '20080328'.
concatenate v_var+6(2) v_var+4(2) v_var(4) into v_var.
write: v_var.
Reward points if it helps.
Reagrds.
Abhisek.
‎2008 Mar 28 9:16 AM
hi,
20080328.
WRITE: w_str+6(2).
w_str+4(2).
w_str+0(4).
or u can also store into a string
wstr0(2) = w_str6(2).
wstr2(4) =w_str4(2).
wstr4(4)=w_str0(4).
it will do
regards,
priya