10-16-2006 1:40 PM
Hi,
I need to print the last and the first 10 for character of a field.
like the field name is mara-wrkst.i need to print last 4 and first 10.
10-16-2006 1:43 PM
Hi
For the first ten it will be
DATA: ws_first type char10.
ws_first = mara-wrkst+0(10)
10-16-2006 1:44 PM
Hi
You can do that by using offset.
Eg:
l_var(10) -> first 10 characters
l_var+6(4) -> last 4 characters from a field of 10 chars.
Kind Regards
Eswar
10-16-2006 1:50 PM
Hi,
last 4:
z = strlen ( mara-wrkst ) - 4.
if z > 10."1st condition 1st 10
write mara-wrkst+Z(4).
endif.
A.
Message was edited by: Andreas Mann
10-16-2006 2:00 PM
HI Kamlesh,
find the sample code below. This should solve your issue.
DATA: wrkst TYPE wrkst VALUE '20061010565656556',
ws_wrkst TYPE wrkst,
wrkst1 TYPE char10,
wrkst2 TYPE char4.
WRITE wrkst TO ws_wrkst RIGHT-JUSTIFIED.
wrkst1 = ws_wrkst+44(4).
clear ws_wrkst.
WRITE wrkst TO ws_wrkst left-JUSTIFIED.
wrkst2 = ws_wrkst+0(10).
write: wrkst1 , wrkst2.
Reward points if this helps.
Manish
10-16-2006 2:15 PM
hi
good
store that value in a field and split the value in two and store in two variables and than you print them.
Use the SPLIT statement
thanks
mrutyun^