10-12-2006 9:24 AM
Hello,
I am getting the value like w183-145-001 in select option.
But i need to display only the w183 in output,
how can i do that.
10-12-2006 9:29 AM
Hi John,
Suppose ur field VAR contains = w183-145-001.
1) Use Split Command. split VAR at '-' into var1 var2
var3. Var1 will contain w183
2) Use offset var1 = VAR+0(3).
Hope this solves ur problem.
Manish
Message was edited by: Manish Kumar
10-12-2006 9:29 AM
Hi John,
Suppose ur field VAR contains = w183-145-001.
1) Use Split Command. split VAR at '-' into var1 var2
var3. Var1 will contain w183
2) Use offset var1 = VAR+0(3).
Hope this solves ur problem.
Manish
Message was edited by: Manish Kumar
10-12-2006 9:41 AM
Hai manish,
I am having a valu like IEQw183.
I want to show only w183 in output.How to split this to final display.
10-12-2006 9:43 AM
Hi Johnn
I don't know what you need to do exactly, but you should consider if you change the value for the output you should restore the original value for the select.
Max
10-12-2006 10:00 AM
Hi John,
While splitting use p_var-low
s
plit p_var-low at '-' into var1 var2.
The first 3 letters IEQ are for selection options
10-12-2006 9:35 AM
Hi
U should create a convertion routine for output, for example the field BKPF-BELNR is linked to domanain BELNR uses the routine ALPHA (fm CONVERSION_EXIT_ALPHA_INPUT,
CONVERSION_EXIT_ALPHA_OUTPUT).
Max
10-12-2006 9:36 AM
U can use SPLIT lvalue AT '-' into v1 v2 v3.
v1 has the value.
Second way is to
SEARCH lvalue for '-'.
If sy-subrc = 0.
write lvalue(sy-fdpos) into v1.
endif.
v1 has the value.
<b>Adding to the above you can use
len = strlen(v1).
lfinal = v1+3(len).</b>
Message was edited by: Anurag Bankley
10-12-2006 9:57 AM
Hai anurag,
I am getting error field strlen is unknown.
how to declare this.
10-12-2006 10:07 AM
Hi Johnn,
is VAR = IEQw183. or QW183 (I think IE is comming because of numeric field).
Anyway if VAR = IEQw183-145-001
var1 = VAR+3(3).
Code below will clarify your doubt.
data: VAR type char10 value '0123456789',
var1 type char3,
var2 type char3.
var1 = var+0(3). " result = 012
var2 = var+3(3). " result = 345
write:/ var1, var2.
Reward points if it helps.
Manish