Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Cocatenate

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

kostas_tsioubris
Contributor
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

use PACK statement before conctenate.

reward points

Sameer

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

kostas_tsioubris
Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

Which table you want to update sarath?

Can you give us its definition?

Kostas

0 Kudos

Hi,

I have to update this concatenated value to CDHR-OBJECTID.

data type : cahr

no of chars: 90

Regards,

sarath

0 Kudos

hi,

Sorry, its cdhdr-OBJECTID.

Regards,

sarath

0 Kudos

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

Former Member
0 Kudos

hi sharath,

u can use the statement with condense zero & change the value and use the concatenate statement to use it.

regards

raman