2008 Apr 23 12:56 PM
I have a data field of 40 char.
e.g. lv_type = 'LOAN'
should display as " LOAN"
means though lv_type is 4 characters it should take 40 characters and add 36 spaces.
so how to add spaces appropriately.
if lv_type is 6 characters it should add 34 spaces.
2008 Apr 23 1:02 PM
This works
DATA: inval(4) TYPE c,
outval(40) TYPE c.
inval = 'LOAN'.
WRITE inval TO outval RIGHT-JUSTIFIED.
WRITE:/ outval.
I have a data field of 40 char.
e.g. lv_type = 'LOAN'
should display as " LOAN"
means though lv_type is 4 characters it should take 40 characters and add 36 spaces.
so how to add spaces appropriately.
if lv_type is 6 characters it should add 34 spaces.
2008 Apr 23 1:00 PM
Hi
Better try to declare the variable with length 40.
After getting the variable make a command like this
Shift left lv_vbeln deleting leading space.
Thanks and Regards
arun joseph
2008 Apr 23 1:01 PM
Hi,
Try declaring it as VARCHAR or LONGVARCHAR.
Reward if helpful.
regards,
Ramya
2008 Apr 23 1:02 PM
This works
DATA: inval(4) TYPE c,
outval(40) TYPE c.
inval = 'LOAN'.
WRITE inval TO outval RIGHT-JUSTIFIED.
WRITE:/ outval.
2008 Apr 23 1:08 PM
Hi
Try to declare a variable like this.
Data : x(40)
Once you got the variable in the field u have declared what ever for example we name it as y.
Then make a assignment like this.
Y = X.
Hope it will works
Arun Joseph
2008 Apr 23 1:07 PM
Hi santosh,
1. This is one way. Just copy paste.
2.
report abc.
data : lv_type(40) type c.
data : ln type i.
lv_type = 'LOAN'.
*-------------------------- before
write :/ lv_type.
*-------------------------- after
ln = strlen( lv_type ).
ln = 40 - ln.
shift lv_type right by ln places.
write :/ lv_type.
regards,
amit m.
2008 Apr 23 1:16 PM
Hi,
Just try this code:
DATA: VAR(10) TYPE C,
INT TYPE I,
LEN TYPE I.
VAR = 'ABC'.
WRITE: / VAR.
DESCRIBE FIELD VAR LENGTH LEN IN CHARACTER MODE.
INT = STRLEN( VAR ).
INT = LEN - INT.
SHIFT VAR BY INT PLACES RIGHT.
WRITE: / VAR.
Reward if useful.
Regards,
Bhaskar