2008 Jun 27 11:46 AM
Hi Guru,
I have material group in my internal table.
So I have to make that as 7 character. means if I have number as 123 then it should show as 123 means preceeding by 4 spaces. if 1234 then it should show as 1234 preceeding by 3 spaces and so on.
Please help me.
Hi Guru,
I have material group in my internal table.
So I have to make that as 7 character. means if I have number as 123 then it should show as 123 means preceeding by 4 spaces. if 1234 then it should show as 1234 preceeding by 3 spaces and so on.
Please help me.
2008 Jun 27 11:50 AM
hi there is nothing to do like this ..
it will automatically fetch the data it will give the required space automatically....if you write like this..
loop at itab into wa.
itab1-matnr = wa+0(7).
endloop.
2008 Jun 27 11:51 AM
Hi,
try this:
tables: mara.
*
select * from mara up to 100 rows.
write: / mara-matkl right-justified.
endselect.
Regards, Dieter
2008 Jun 27 12:00 PM
hi sandeep,
create a data object
data : a(7) type n.
assign internal table value to this data object.
Reward points if helpful,
Regards,
Ani
2008 Jun 27 12:21 PM
Hi,
you can check following code. It may solve your problem
DATA mat(7) TYPE c.
DATA: text TYPE string VALUE `1234`,
num TYPE i,
rem TYPE i,
c_0 TYPE c VALUE '0'.
MOVE text TO mat.
WRITE: / text.
WRITE: / mat.
num = STRLEN( mat ).
WRITE: / num.
rem = 7 - num.
DO rem TIMES.
IF rem <= 0.
EXIT.
ENDIF.
CONCATENATE c_0 mat INTO mat.
ENDDO.
WRITE: / mat.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |