2005 Sep 21 7:29 AM
pls let me know how to do padding of digits and out put ony few digits for that field.
Thanks.
2005 Sep 21 7:38 AM
Hi Anu,
You have to move this to a character field and use the following sytax.
a = '123456789'.
b = a+2(3).
Now value of 'b' is 345.
The index starts from zero. i.e. the digit '1' is at position zero.
Thanks
Vinod
pls let me know how to do padding of digits and out put ony few digits for that field.
Thanks.
2005 Sep 21 7:38 AM
Hi Anu,
You have to move this to a character field and use the following sytax.
a = '123456789'.
b = a+2(3).
Now value of 'b' is 345.
The index starts from zero. i.e. the digit '1' is at position zero.
Thanks
Vinod
2005 Sep 21 7:46 AM
what is the data type u r using?
if u r using type n then u can use sub-field access
like...
data n1(5) type n.
...
....
write 😕 n1+0(2).
however u cannot do the same for type p or f . for these u need to convert to a character type and then use sub-field access...
what is the scenario? u want to restrict only the decimal places or what?
rgds,
PJ
Message was edited by: Priyank Jain
2005 Sep 21 8:20 AM
I want to pad few digits with 0 and output only few digits.all are chacrater fileds.
2005 Sep 21 8:27 AM
<i>padding few digits with 0</i>
data: result(100) .
concatenate '0' '1' '2' '3' into result .
<i>output only few digits?</i>
write result to result left deleting leading '0' .
is this what you are looking for?
can you be little more clear.
Regards
Raja
2005 Sep 21 8:31 AM
for character types use as follows to print only a few digits..
write 😕 fld+0(2)
which means write 2 characters starting from the beginning...specify the position and number of characters as u desire....
padding with 0s...
use type n....
data num1(10) type n.
write 😕 num1. " this gives 0000000000
num1 = 345. "u can assign ur character field here
write 😕 num1. " this gives 0000000345
does that help?
rgds,
PJ
2007 Aug 23 6:47 AM
Hi!!!!!!!! I do not know any thing about Padding , Rounding and Arthematic and logical expressions but I have an Idea
can u Please send blogs or PDF formates regarding these concepts to study them
2005 Sep 21 8:29 AM
Hi Anu,
pls describe your problem in detail
for the moment you could look here: <a href="http://help.sap.com/saphelp_47x200/helpdata/EN/fc/eb3357358411d1829f0000e829fbfe/frameset.htm">Processing Character Strings</a>
Andreas
2005 Sep 21 8:31 AM
DATA NAME(10) VALUE '1234'.
DO 5 Times.
CONCATENATE '0' NAME INTO NAME.
ENDDO
WRITE 😕 NAME.
This will give output as 0000012234.
Change 5 times to desired value.
Cheers
2005 Sep 21 8:59 AM
Hi Anu,
Have a look at demo programs
DEMO_DATA_PROCESS_FIELDS
DEMO_DATA_STRING
Thanks
Lakshman
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |