Application Development 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: 

how can i hide zeros in select-options?

Former Member
0 Kudos

I wanna hide zeros in select-options values.
eg.
select-options value is 00000338
but i wanna display it without zeros.

Users enter just 338 but i will use it with zeros in my query. How can i do it?

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos

Hi

If you area declaring using proper type it will automatically add zero's in backend. I just created select option for MARA-MATNR on screen you see 123 but in debugging it will add leading zero's because of its domain conversion exits. Please use correct field and table reference

Nabheet

9 REPLIES 9

nabheetscn
Active Contributor
0 Kudos

Hi

If you area declaring using proper type it will automatically add zero's in backend. I just created select option for MARA-MATNR on screen you see 123 but in debugging it will add leading zero's because of its domain conversion exits. Please use correct field and table reference

Nabheet

0 Kudos

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_bpid-low.

   SELECT DISTINCT bpid FROM /atom/pj50 INTO TABLE gt_itab.

"i deleted zeros in select-options values

   LOOP AT gt_itab.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

   EXPORTING

     input        = gt_itab-bpid

  IMPORTING

    OUTPUT        = gt_itab-bpid

           .

MODIFY gt_itab.

   ENDLOOP.

"f4 help function

   IF sy-subrc = 0.

     CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

       EXPORTING

         retfield        = 'BPID'

         dynpprog        = sy-repid

         dynpnr          = sy-dynnr        "Aktif pencere

         dynprofield     = 'S_BPID-LOW'

         value_org       = 'S'             "Mandatory

       TABLES

        value_tab       = gt_itab

*       FIELD_TAB       =

*       RETURN_TAB      =

       EXCEPTIONS

         parameter_error = 1

         no_values_found = 2

         OTHERS          = 3.

     IF sy-subrc <> 0.

       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

     ENDIF.

   ENDIF.

When users write  a value without zeros and dont use f4 window in select-options.
must i use pack or overlay to do it.

I am using correct field. i hope you understood me.

0 Kudos

1.) If you are displaying all the values of table /atom/pj50 in F4 help for S_BPID then you can achieve this like:


SELECT-OPTIONS: s_bpid FOR /atom/pj50-bpid.


2.) Then use pack or overlay if require.


Cheers,

Prakash

0 Kudos

I think if user enter 313 etc on select option in debugging it will automatically add leading zeros if domain has a conversion routine

0 Kudos

This table is test table so that domain have no conversion. Thanks for your answers.

0 Kudos

Then incase your table store it with leading zeros you should use conversion_Exit_alpha_input for the same..it does not work...? Please attach screen shot of table data in both detailed view for one line and one view for all lines

0 Kudos

I solved problem.

bpid and pernr datas are same but length is diffirent. I just change it. every pernr is 8 character but bpid's length is 12 character i changed it on below code.

data : lv_pernr like pa0001-pernr.

LOOP AT s_bpid.

lv_pernr = s_bpid-low.

s_bpid-low = lv_pernr.

modify s_bpid index sy-tabix transporting low.

ENDLOOP.

Thanks nabheet madan.

Former Member
0 Kudos

Hi Kaya,

Currently I am not infront of SAP system but please check if BPID domain have conversion routine it will take leading zero , no need to do any code for that.

Cheers,

Prakash

0 Kudos

Thanks for your help.