‎2009 Jun 22 11:09 AM
Hi Friends..
I want to give three fields as a input of read_text function module.
three fields are matnr, werks and charg.
for example matnr = gowri10000
werks = 1000
charg = welcome12
after concatenating it shows like gowri100001000welcome12
But I need an output like = gowri10000 1000welcome12
I need output with spaces from matnr field.
plz give some solution
Thanks
Gowrishankar
‎2009 Jun 22 11:12 AM
HI,
data: v_text1 type string,
v_text2 type string.
concatenate werks charg into v_text2.
concatenate matnr v_text2 into v_text1 separated by space.
Regards,
Kumar Bandanadham
‎2009 Jun 22 11:12 AM
HI,
data: v_text1 type string,
v_text2 type string.
concatenate werks charg into v_text2.
concatenate matnr v_text2 into v_text1 separated by space.
Regards,
Kumar Bandanadham
‎2009 Jun 22 11:14 AM
Hello,
It is simple:
DATA:
V_STR TYPE STRING,
V_STR1 TYPE STRING.
CONCATENATE WERKS CHARG INTO V_STR1.
CONCATENATE MATNR V_STR1 INTO V_STR SEPARATED BY SPACE.BR,
Suhas
‎2009 Jun 22 11:14 AM
HI,
You can do it by using the concatenate statement twice.
first concatenate matnr and werks into one field using separated by space or respecting blanks then concatenate charg to the field with out spaces
go for F1 help on concatenate for more reference
Regards
Sarves
‎2009 Jun 22 11:15 AM
If you want to concatenate all the fields seperated by space :
Follow this code :
Concatenate wa_matnr wa_werks wa_charg into wa_final seperated by space.
As you mentioned in your query go through this
gowri10000 1000welcome12
Concatenate wa_matnr space wa_werks wa_charg into wa_final .
Hope it helps
‎2009 Jun 22 11:23 AM
Hi Thanks to everyone..
But no one got my point.
I want output like this.
for example total length of matnr =18, but matnr field having only 10 digit value.
I want output matnr 8space werks charg
like this..
Edited by: gowrishankar p on Jun 22, 2009 12:23 PM
‎2009 Jun 22 11:31 AM
Hi,
As suggested earlier the following code will give your output.
DATA : MATNR TYPE MATNR,
WERKS TYPE wERKS_D,
CHARG TYPE CHARG_D.
DATA : STRING TYPE CHAR32.
MATNR = 'abc'.
WERKS = '0010'.
CHARG = 'abc'.
CONCATENATE MATNR WERKS CHARG INTO STRING RESPECTING BLANKS.The addition respecting blanks adds the spaces after ABC for the MATNR.
Your type of the field should be same as MATNR.
Regards,
Ankur Parab
‎2009 Jun 22 11:34 AM
Hello Ankur,
I am using Release 640 & your code does not syntax check :-((
Can you please let me know which release are you in?
BR,
Suhas
‎2009 Jun 22 11:40 AM
‎2009 Jun 22 12:03 PM
hi,
try this :-
DATA: i_matnr TYPE mara-matnr,
i_werks TYPE marc-werks,
i_charg TYPE mchb-charg,
i_text TYPE string.
i_matnr = '18'.
i_werks = '10'.
i_charg = '100'.
CONCATENATE i_matnr i_werks i_charg INTO i_text RESPECTING BLANKS.
Hope this solves your issue.
‎2009 Jun 22 11:15 AM
Hi
Try like below:
data: lv_con(30),
lv_field(50).
Concatenate matnr werks into lv_con separated by space.
concatenate lv_con charg into lv_field.
lv_field will ahve your desired output.
Regards,
Himanshu
‎2009 Jun 22 11:16 AM
Hi,
Do as follows:-
DATA : MATNR TYPE MATNR,
WERKS TYPE wERKS_D,
CHARG TYPE CHARG_D.
DATA : STRING TYPE CHAR32.
MATNR = 'abc'.
WERKS = '0010'.
CHARG = 'abc'.
CONCATENATE MATNR WERKS CHARG INTO STRING RESPECTING BLANKS.Regards,
Ankur Parab
‎2009 Jun 22 11:19 AM
‎2009 Jun 22 11:34 AM
Hi,
go through the following piece of code .... i hope u will get help..
constants: c_matnr(10) type c value 'gowri10000',
c_werks(4) type c value '1000',
c_charg(9) type c value 'welcome12'.
data:v_string type string.
concatenate c_matnr c_werks into v_string separated by space.
concatenate v_string c_charg into v_string.
write: / v_string.
out put is :
gowri10000 1000welcome12 the way u want...
thanks & Regards
Ashu SIngh
‎2009 Jun 22 12:17 PM
Hi,
try this.
CONCATENATE ' ' f1 f2 INTO f3 SEPARATED BY SPACE.
‎2009 Jun 22 12:39 PM
Hi Gowrishankar,
Here is the solution:
data: str1 type string,
str2 type string.
conmcatenate werks charg into str1.
concatenate matnr str1 into str2 separated by space.