01-15-2007 6:26 AM
Hi,
iam checking the conditions for numeric and character.if the output is numeric then it can shift to right justify,else if it is charcter left justify.but the following code is not checking for charcter fields.
data:p_input type c.
data: pout type string.
data: htype like DD01V-DATATYPE.
if htype = 'CHAR'.
shift htype LEFT DELETING LEADING space.
else.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
STRING_IN = P_INPUT
IMPORTING
STRING_OUT = POUT
HTYPE = HTYPE.
SHIFT htype RIGHT DELETING TRAILING space.
endif.
plz help me..
thanks
01-15-2007 7:13 AM
hi,
try sth like that:
parameters p_input(50).
DATA: pout TYPE string.
DATA: htype LIKE dd01v-datatype.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = p_input
IMPORTING
string_out = pout
htype = htype.
IF htype = 'CHAR'.
SHIFT pout LEFT DELETING LEADING space.
ELSE.
SHIFT pout RIGHT DELETING TRAILING space.
ENDIF.
Andreas
01-15-2007 6:54 AM
Hi,
Please initialise htype to 'CHAR'. Also, Populate pout and use shift pout LEFT DELETING LEADING space.
Eg: Move 'CHAR' TO HTYPE.
Move ' SKK' TO POUT.
And then, use shift pout LEFT DELETING LEADING space.
and not shift htype LEFT DELETING LEADING space.
01-15-2007 7:13 AM
hi,
try sth like that:
parameters p_input(50).
DATA: pout TYPE string.
DATA: htype LIKE dd01v-datatype.
CALL FUNCTION 'NUMERIC_CHECK'
EXPORTING
string_in = p_input
IMPORTING
string_out = pout
htype = htype.
IF htype = 'CHAR'.
SHIFT pout LEFT DELETING LEADING space.
ELSE.
SHIFT pout RIGHT DELETING TRAILING space.
ENDIF.
Andreas
01-15-2007 7:14 AM
use code like this -
if input CN '0123456789' . " (not numc field)
**right justify.
else.
*left justify.
endif.