2006 Dec 20 5:30 AM
Hi Experts,
I am facing problem with replace statement.
I am moving lv_matnr value to right by shift statement.
And I want to replace all space value to '0'.
following is the sample code.
lv_num = 16 - STRLEN( LV_MATNR ).
shift lv_matnr by lv_num places right.
replace ALL OCCURRENCES OF ' ' in lv_matnr with '0'
could you please help me on this.
needed very urgently
Thanks in Advance
Hi Experts,
I am facing problem with replace statement.
I am moving lv_matnr value to right by shift statement.
And I want to replace all space value to '0'.
following is the sample code.
lv_num = 16 - STRLEN( LV_MATNR ).
shift lv_matnr by lv_num places right.
replace ALL OCCURRENCES OF ' ' in lv_matnr with '0'
could you please help me on this.
needed very urgently
Thanks in Advance
2006 Dec 20 5:31 AM
2006 Dec 20 5:32 AM
hi,
use this.
converts any number into a string fill with zeroes
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = LV_MATNR
IMPORTING
output = lv_num
Example:
input = 123
output = 000000123
Rgds
Anver
2006 Dec 20 5:32 AM
Use the function module CONVERSION_EXIT_ALPHA_INPUT
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_matnr
IMPORTING
OUTPUT = lv_matnr.
2006 Dec 20 5:34 AM
<b>data: lv_matnr type matnr.</b>
lv_num = 16-strlen(lv_matnr).
shift lv_matnr by lv_num places right.
replace all occurrences of space in lv_matnr with '0'.
****************************
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_matnr
IMPORTING
OUTPUT = lv_matnr.
Message was edited by:
Ramesh Babu Chirumamilla
2006 Dec 20 5:36 AM
Hi
Use the unpack command.
e.g <b>UNPACK LV_MATNR TO LV_MATNR</b> .
Regards
Arun
2006 Dec 20 5:37 AM
hi,
try this.
data dummy(16) type c '0000000000000000'.
lv_num = 16 - STRLEN( LV_MATNR ).
<b>concatenate dummy(lv_num) lv_matnr into lv_matnr.</b>
i think this will help u.
2006 Dec 20 5:38 AM
2006 Dec 20 5:41 AM
Hi,
data lv_matnr(18)."According to the requirement
lv_matnr = matnr_value.
unpack lv_matnr to lv_matnr.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |