‎2008 Jun 09 9:20 AM
hi,
how we can define more spaces between two variables in output .
for ex: i neeed output as
Var1 Var2 but it is coming as
Var1 Var2 ,
how we can pls
THX
‎2008 Jun 09 9:22 AM
‎2008 Jun 09 9:24 AM
Hi,
If you want the space in output then use offset to get space between fields see below code...
WRITE: / wa-matnr, 20 wa-maktx, 66 wa-werks.......
Rgds,
Bujji
‎2008 Jun 09 9:36 AM
but i need to use space while concatenating two variables
How ?
‎2008 Jun 09 9:48 AM
hi Chaaya,
in SAP ABAP if you wish to concatenate 2 or 3 strings together then you can use the following function module.
STRING_CONCATENATE_3
The above mentioned function module excepts 3 strings and concatenates them into 1. Please see the example given below.
REPORT ZEX_STRINGCON .
parameters: p_str1(100),
p_str2(100),
p_str3(100).
Data: d_str(500).
CALL FUNCTION 'STRING_CONCATENATE_3'
EXPORTING
STRING1 = p_str1
STRING2 = p_str2
STRING3 = p_str3
IMPORTING
STRING = d_str
EXCEPTIONS
TOO_SMALL = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Write: d_str.
If the input is as follows.
p_str1 = 'This'
p_str2 = 'Is'
p_str3 = 'ABAP'
The output would be as follows.
String Concatenate
THISISABAP
i hope this helps...
do reward if helpful or get back with further queries.
‎2008 Jun 09 10:03 AM
hi
u can declare a variable tab = ' '.
data tab(5) type c.
concatenate str1 str2 into <var> separated by tab.
‎2008 Jun 09 9:53 AM
Hi,
Take a new variable or constant with length what you need for your concatenate statement and fill with space like in the below said way. Then make spaces with in the single quotes with ALT+0160 (Press alt key in you key board and clik on 0160 in your key board which equals to one space).
Rgds,
Bujji