2014 Apr 21 2:58 PM
Hi Folks,
My select-option field(material) i want the value without leading zeros for that I want to use conversion routine OUTPUT.
how can i convert the values from low to high values.From my below code I can able to do only low values not complete range.
my current code
loop at s_new.
CALL FUNCTION 'CONVERSION_EXIT_PRODU_OUTPUT'
EXPORTING
input = s_new-low
IMPORTING
OUTPUT = s_new-low
.
modify s_new.
endloop.
I want all the values in s_new[] should be without leading zeros.
Please advice me.
Thanks,
Smriti
2014 Apr 21 3:12 PM
Hi,
Try the below code.........
loop at s_new.
CALL FUNCTION 'CONVERSION_EXIT_PRODU_OUTPUT'
EXPORTING
input = s_new-low
IMPORTING
OUTPUT = s_new-low
CALL FUNCTION 'CONVERSION_EXIT_PRODU_OUTPUT'
EXPORTING
input = s_new-high
IMPORTING
OUTPUT = s_new-high
.
modify s_new.
endloop.
2014 Apr 21 3:20 PM
hi Smriti,
For this, you have to loop at your select option and apply the conversion for each value.
using only LOW and HIGH will change only these two values, but you might provide multiple entries as this being a selection option accepts it. hence for multiple values you will need LOOP on the select option values.
Regards,
DN.
2014 Apr 21 3:24 PM
Hi Raj,
just a correction in your approach:
loop at s_new.
IF s_new-low is not initial. " check if the value is present
CALL FUNCTION 'CONVERSION_EXIT_PRODU_OUTPUT'
EXPORTING
input = s_new-low
IMPORTING
OUTPUT = s_new-low
ENDIF.
IF s_new-high is not initial. " check if the value is present
CALL FUNCTION 'CONVERSION_EXIT_PRODU_OUTPUT'
EXPORTING
input = s_new-high
IMPORTING
OUTPUT = s_new-high
ENDIF.
.
modify s_new.
endloop.
Regards,
DN.
2014 Apr 21 3:26 PM
Hi Deepak,
Yes you are right, the same I am looking for ..
Could you plz give me some input on the same..
Thanks,
Smriti
2014 Apr 22 4:30 AM
Hi Smriti,
Please find a code snippet for your reference. I have simply used a write statement, you can use your FM as desired.
TABLES MARA.
SELECT-OPTIONS S_MARA FOR MARA-MATNR.
DATA: LT_MARA TYPE TABLE OF MARA.
***** this part will select all the values in LOW part of select-option
LOOP AT S_MARA.
IF S_MARA-LOW IS NOT INITIAL.
WRITE:/ S_MARA-LOW. "remove zeroes and modify
ENDIF.
ENDLOOP.
***** this part will select all the values in HIGH part of select-option
READ TABLE S_MARA INDEX 1.
IF S_MARA-HIGH IS NOT INITIAL. "remove zeroes and modify
WRITE:/ S_MARA-HIGH.
ENDIF.
Please revert if still in doubt.
Regards,
DN.