Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg Select option

Former Member
0 Likes
779

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

5 REPLIES 5
Read only

Former Member
0 Likes
725

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.

Read only

Former Member
0 Likes
725

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.

Read only

0 Likes
725

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.

Read only

0 Likes
725

Hi Deepak,

Yes you are right, the same I am looking for ..

Could you plz give me some input on the same..

Thanks,

Smriti

Read only

0 Likes
725

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.