How add '0' dynamically? Help.
I set input box for the user to input the customer number, such as '1171'.
1171 is stored in <i>seh_custom</i> ,which is like <i>kna1-kunnr</i>.
SELECT SINGLE kunnr name1 adrnr FROM kna1 INTO CORRESPONDING FIELDS OF wa_custom WHERE kna1~kunnr = seh_custom . IF sy-subrc <> 0. ... "Error ENDIF.
But the codes don't work, as in database the <i>kunnr</i> is stored in '0000001171'.
Any suggestion ? Thanks very much!
Hymavathi Oruganti replied
u need to use conversion routines,
generally SAP uses conversion routines internally to convert from user format to sap format and vice versa.
but some times if it does not use /work, we need to use explicitly conversion routines which convert data from user given format (ex:1) to sap format (ex: for kunnr as it is of char 10 internally stored as 0000000001).
there are many conversion exits.
u can use the following fn module for ur purpose.
generally their format will be
XXXXX-> IT IS OF 5 LETTERS .
AND THERE ARE MANY FN MODULES , U CAN CHECK IN SE37.
REPORT ZTESTH messAGE-ID ZV.
parameter : p_kunnr type kunnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
INPUT = p_kunnr
OUTPUT = v_kunnr
write: p_kunnr, v_kunnr.
Message was edited by: Hymavathi Oruganti