‎2021 Oct 13 8:14 AM
how we can remove the right leading zero ??????
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = IT_FMIT1-RFIPEX
IMPORTING
OUTPUT = IT_FMIT1-RFIPEX.
i also use this function module but give debug error u can tell please there should be variable or internal table with field???
‎2021 Oct 13 8:34 AM
Hello aya12
The function interface is:
FUNCTION CONVERSION_EXIT_ALPHA_OUTPUT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(INPUT) TYPE CLIKE
*" EXPORTING
*" VALUE(OUTPUT) TYPE CLIKE
*"----------------------------------------------------------------------
IT_FMIT1-RFIPEX needs to be a character like field. See SAP Help on Generic ABAP Types for the details of CLIKE type.
Best regards
Dominik Tylczynski
‎2021 Oct 13 8:27 AM
Hi Haya,
This function module helps to remove the left leading zeros if any, also it is always suggested to use the variable in this like any ABAP field.
Conversion exit ALPHA, internal->external
Regards,
Vipin
‎2021 Oct 13 8:34 AM
Hello aya12
The function interface is:
FUNCTION CONVERSION_EXIT_ALPHA_OUTPUT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(INPUT) TYPE CLIKE
*" EXPORTING
*" VALUE(OUTPUT) TYPE CLIKE
*"----------------------------------------------------------------------
IT_FMIT1-RFIPEX needs to be a character like field. See SAP Help on Generic ABAP Types for the details of CLIKE type.
Best regards
Dominik Tylczynski
‎2021 Oct 13 8:35 AM
something like that should work
get length of field
do length times
offset = lenght - sy-index.
if field+offset(1) eq 0.
field = field+0(offset)
else.
exit.
endif.
enddo.
‎2021 Oct 13 8:36 AM
‎2021 Oct 13 12:46 PM
No problem for me:
DATA it_fmit1 TYPE fmit.
it_fmit1-rfipex = '000000000000000000000150'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = it_fmit1-rfipex
IMPORTING
output = it_fmit1-rfipex.
ASSERT it_fmit1-rfipex = '150'.