on 05-10-2006 5:54 AM
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!
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
CONVERSION_EXIT_XXXXX_INPUT,
CONVERSION_EXIT_XXXXX_OUTPUT.
XXXXX-> IT IS OF 5 LETTERS .
AND THERE ARE MANY FN MODULES , U CAN CHECK IN SE37.
ex:
REPORT ZTESTH messAGE-ID ZV.
parameter : p_kunnr type kunnr.
data v_kunnr(10).
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = p_kunnr
IMPORTING
OUTPUT = v_kunnr
.
write: p_kunnr, v_kunnr.
Message was edited by: Hymavathi Oruganti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
GOOD
WRONG
SELECT SINGLE kunnr name1 adrnr FROM kna1
INTO CORRESPONDING FIELDS OF wa_custom
WHERE kna1~kunnr = seh_custom .
RIGHT
SELECT SINGLE kunnr name1 adrnr FROM kna1
INTO CORRESPONDING FIELDS OF wa_custom
WHERE kna1-kunnr = seh_custom .
THANKS
MRUTYUN
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi james,
1. I set input box for the user to input the customer number, such as '1171'
How is the input box / parameters defined ?
2. it should be LIKE KNA1-kunnr.
3. Then automatic conversion will happen.
(ie. padding of zeroes when using in variables)
regards,
amit m.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use CONVERSION_EXIT_ALPHA_INPUT, Pass SEH_CUSTOM to both INPUT and OUTPUT and then u will get the zero's automatically apppended.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.