07-20-2007 8:27 AM
HI all,
I am trying to concatenate 100 with 3000 and both with vaifkos-aufnr ( orderno)
and storing in a variable.
Expeceted out put is 10030001000016417
but I am getting 1003000001000016417.
I checked the contents of the table tacontains order num like 001000016417.
but i am retriving only order number and displaying it it is giving out put as 1000016417.
One more thing is ,
i want to concatenate this for all ordernumbers and update the database field of other data base table.
Can u send the code how to concatenate and store in internal table and using that how to update the data base table.
Regards,
sarath
07-20-2007 8:36 AM
Hi,
you can also try to use
write vaifkos-aufnr to lv_var no-zero.
lv_var is your variable and then use
concatenate '100' '3000' lv_var into lv_var.
Kostas
07-20-2007 8:30 AM
07-20-2007 8:32 AM
Hi sarat,
If u want to add 000 before order number(internal type).then use the fm conversion_exit_alpha_input and if u want to split the 000's before order no. u will use conversion_exit_alpha_output.
try this.
If useful rewrad me with points.
Thanks
Sanket.
07-20-2007 8:33 AM
HI sarath,
first convert this field to 001000016417 to 1000016417.
then use conctenate.
You can change this by using conversion_exit_alpha_input Fm.
your field is of lengh 12 so create a variable of 10 lenth
and pass it.
hope it will help u out.
reward if helpful
regards
azad.
07-20-2007 8:33 AM
Hi Sarath,
This is because in displaying the table content it will display the 1000016417 but when u fetch the value from that table it will give u 001000016417 - at the backend when u display conversion exit fm will be executed and fetch the values.
to solve ur issue pls use conversion exits use function 'CONVERSION_EXIT_ALPHA_INPUT'.
it should solve ur issue :
<b>Pls reward pts for usefull answer :)</b>
regards
Sathish
07-20-2007 8:36 AM
Hi,
you can also try to use
write vaifkos-aufnr to lv_var no-zero.
lv_var is your variable and then use
concatenate '100' '3000' lv_var into lv_var.
Kostas
07-20-2007 8:48 AM
Hi Kostas Tsioubris ,
Thanks for your answer. its working.
can you try to answer for my remaining questions regarding my problem.
Thanks to all for giving replay.
Regards,
sarath
07-20-2007 8:51 AM
Which table you want to update sarath?
Can you give us its definition?
Kostas
07-20-2007 8:56 AM
Hi,
I have to update this concatenated value to CDHR-OBJECTID.
data type : cahr
no of chars: 90
Regards,
sarath
07-20-2007 8:58 AM
07-20-2007 9:11 AM
Hi,
objectid is a key field in table cdhdr so your program will create new entries. Anyway I don't think it is a good idea to update this table your own.
If you are sure about this you can use something like this.
data: lt_cdhdr like cdhdr occurs 0 with header line.
field-symbols <fs> like cdhdr.
select * from cdhdr into lt_cdhdr
where "put your conditions here....
loop at it_cdhdr assigning <fs>.
***here you use the concatenate logic for field lv_var...
<fs>-objetid = lv_var.
endloop.
modify cdhdr from table lt_cdhdr.
if sy-subrc = 0.
commit work and wait.
else.
rollback work.
endif.
Make sure that you want to change the cdhdr table though or else you may have problems in your system.
Kostas
07-20-2007 9:19 AM
hi sharath,
u can use the statement with condense zero & change the value and use the concatenate statement to use it.
regards
raman