Application Development and Automation 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: 
Read only

concatenation

Former Member
0 Likes
2,303

hi all,

I am concatenating 3 fields date,time, order number as

below

DATA: W_TOP TYPE SLIS_LISTHEADER,

T_TOP LIKE STANDARD TABLE OF W_TOP.

W_TOP-TYP = 'S'.

CONCATENATE 'DATE:' SY-DATUM

'TIME:' SY-UZEIT

'ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO.

APPEND W_TOP TO T_TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = T_TOP

I_LOGO = 'GE_LOGO'

i am getting the output as

DATE:20080508TIME:224326ORDERNO:12

i.e i am not getting the spaces between the fields

But i must get the output as i.e i must get the output with spaces

DATE:2008050 TIME:224326 ORDERNO:12

reply ASAP.

hi all,

I am concatenating 3 fields date,time, order number as

below

DATA: W_TOP TYPE SLIS_LISTHEADER,

T_TOP LIKE STANDARD TABLE OF W_TOP.

W_TOP-TYP = 'S'.

CONCATENATE 'DATE:' SY-DATUM

'TIME:' SY-UZEIT

'ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO.

APPEND W_TOP TO T_TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = T_TOP

I_LOGO = 'GE_LOGO'

i am getting the output as

DATE:20080508TIME:224326ORDERNO:12

i.e i am not getting the spaces between the fields

But i must get the output as i.e i must get the output with spaces

DATE:2008050 TIME:224326 ORDERNO:12

reply ASAP.

22 REPLIES 22
Read only

Former Member
0 Likes
2,273

please instead 'Time:' to ' Time'.

Read only

Former Member
0 Likes
2,273

Hi,

Use the extension seperated by Space in Concatenate. i.e.

CONCATENATE 'DATE:' SY-DATUM

'TIME:' SY-UZEIT

'ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO separated by space.

Regards

Raju Chitale

Read only

former_member156446
Active Contributor
0 Likes
2,273
CONCATENATE 'DATE:' SY-DATUM into vl_1.
condense vl_1 no gaps.
CONCATENATE 'TIME:' SY-UZEIT into vl_2.
condense vl_2 no gaps.
CONCATENATE 'ORDER NUMBER:' P_VBELN INTO vl_3.
condense vl_3 no gaps.
CONCATENATE vl_1 vl_2 vl_3 into W_TOP-INFO seperated by space.
Read only

0 Likes
2,273

hi jacjandjay,

how shud v declare V1_1 V1_2 v1_3 .I shud get more space in between the fieldsreply ASAP.

Read only

Former Member
0 Likes
2,273

Hi ,

As said by Eric try to do this way

CONCATENATE 'DATE:' SY-DATUM
            '  TIME:' SY-UZEIT
            '  ORDER NUMBER:' P_VBELN INTO
            W_TOP-INFO.
APPEND W_TOP TO T_TOP.

try to give Space before TIME and ORDER NUMBER in ' ' (cotetions).

or u can write seperated by space.

Best regards,

raam

Read only

0 Likes
2,273

hi raam,

i tried this but it is giving only single space.i want more space between each field.Please reply ASAP

Read only

Former Member
0 Likes
2,273

Hi try this,

CONCATENATE 'DATE:' SY-DATUM ` `

'TIME:' SY-UZEIT ` `

'ORDER NUMBER:' P_VBELN ` ` INTO

W_TOP-INFO.

regards,

kk.

Read only

0 Likes
2,273

hi raju,

i tried this but it is giving only single space.i want more space between each field.Please reply ASAP

Read only

0 Likes
2,273

hi,

i tried this but it is giving only single space.i want more space between each field.Please reply ASAP

Read only

0 Likes
2,273

CONCATENATE 'DATE:' SY-DATUM

'TIME:' SY-UZEIT

'ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO

SEPARATED BY ' '.

in the ' ' give space that you want to have in the fields...

OTHERWISE

CONCATENATE 'DATE : ' SY-DATUM ' '

'TIME : ' SY-UZEIT ' '

'ORDER NUMBER : ' P_VBELN INTO ' '

W_TOP-INFO.

Edited by: Sharayu Kumatkar on May 9, 2008 10:01 AM

Read only

0 Likes
2,273

Hi,

In that case you I don not think you can do it using concatenatation. However it could be achieved as follows:

DATA w_c(100).

w_date(13),

w_time(13),

w_i type I, w_no_of_spaces_required(1) value '5'.

w_orderno(23).

CONCATENATE 'DATE:' SY-DATUM

Into w_date.

w_c = w_date.

Concatenate

'TIME:' SY-UZEIT into w_time.

w_i = 13 + w_no_of_spaces_required.

w_c+w_i = w_time.

Concatenate

'ORDER NUMBER:' P_VBELN INTO

w_orderno.

w_i = 13 + w_no_of_spaces_required.

w_c+w_i = w_orderno.

W_TOP-INFO = w_c.

In the above logic it is assumedthat you require 5 spaces in between. You change the value of the variable w_no_of_spaces_required from '5' to whatever you want.

I hope this helps,

Regards

Raju Chitale

Read only

0 Likes
2,273

hi raju,

i tried this but i am getting only single space ,i want more no : of spaces.reply ASAP .i got the output as

DATE:20080509 ORDER NUMBER:0000000012

Read only

0 Likes
2,273

Hi,

I have tried this & its working fine. Just copy:

DATA:w_c(100),

p_vbeln(10) value '1234567890',

w_date(13),

w_time(13),

w_i type I, w_no_of_spaces_required(1) value '5',

w_orderno(23).

CONCATENATE 'DATE:' SY-DATUM

Into w_date.

w_c = w_date.

Concatenate

'TIME:' SY-UZEIT into w_time.

w_i = 13 + w_no_of_spaces_required.

w_c+w_i = w_time.

Concatenate

'ORDER NUMBER:' P_VBELN INTO

w_orderno.

w_i = 29 + w_no_of_spaces_required.

w_c+w_i = w_orderno.

Regards

Raju Chitale

Read only

0 Likes
2,273

hi raju,

the code u have given is working for REUSE_ALV_LIST_DISPLAY when i am using TOP_OF_LIST event.

But it is not working for REUSE_ALV_GRID_DISPLAY when i am using TOP_OF_PAGE.I have to display using grid.Reply ASAP.

Can we use loop for REUSE_ALV_LIST_DISPLAY?reply ASAP.

Read only

0 Likes
2,273

Hi,

Just before calling the ALV_GRID_DISPLAY,

DATA: t_list_top_of_page TYPE slis_t_listheader.

PERFORM comment_build USING t_list_top_of_page[].

*

FORM comment_build USING e04_lt_top_of_page TYPE slis_t_listheader.

*

REFRESH : e04_lt_top_of_page.

CLEAR ls_line.

ls_line-typ = 'H'.

ls_line-info = 'REPORT HEADING'.

APPEND ls_line TO e04_lt_top_of_page.

CLEAR ls_line.

ls_line-typ = 'S'.

Use your Concatenation logic here & put your final string i.e. w_c into ls_line-info.

i.e. ls_line-info = w_c.

APPEND ls_line TO e04_lt_top_of_page.

CLEAR ls_line.

  • Your TOP OF PAGE should be as follows:

TOP-OF-PAGE.

PERFORM top_of_page.

*

FORM top_of_page. *

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_list_top_of_page

ENDFORM.

I hope this helps,

Regards

Raju Chitale

Edited by: Raju Chitale on May 9, 2008 2:05 PM

Read only

0 Likes
2,273

hi raju,

the code u have given didnt work

Read only

Former Member
0 Likes
2,273

W_TOP-TYP = 'S'.

CONCATENATE 'DATE:' SY-DATUM

' TIME:' SY-UZEIT

' ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO.

APPEND W_TOP TO T_TOP.

try this you will get the output.

Regards,

Madan.

Read only

Former Member
0 Likes
2,273

Hi,

Change your code like this.

1.CONCATENATE 'DATE:' SY-DATUM into Date.(this is taken as variable)

2.CONCATENATE 'TIME:' SY-UZEIT into time.

3.CONCATENATE 'ORDER NUMBER:' P_VBELN into order.

4.CONCATENATE date time order into W_TOP-INFO seperated by SPACE.

5.Append

Note: take date,time and order as chanracter type variables.

Reward,if useful.

thanks,

Chandu

Read only

0 Likes
2,273

hi chandu,

i tried this but i am getting only single space.I want more space.reply ASAP

Read only

0 Likes
2,273

Hi,

Have a look on the following example and change your code.

data: sep2(5) type c.

concatenate 'a' ' e' into sep2.

or

concatenate 'a ' 'e' into sep2.

write: sep2.

Give the spaces before/after the variables.

Reward,if useful.

thanks,

Chandu

Read only

Former Member
0 Likes
2,273

Hi,

define a variable as

Data: SEP(3) value ' '. " This will create a space of 3 char

and then write this:

CONCATENATE 'DATE:' SY-DATUM

'TIME:' SY-UZEIT

'ORDER NUMBER:' P_VBELN INTO

W_TOP-INFO separated by sep.

Cheers,

Saurabh

Read only

Former Member
0 Likes
2,273

DATA: W_TOP TYPE SLIS_LISTHEADER,

T_TOP LIKE STANDARD TABLE OF W_TOP.

DATA:

W_DATE(15),

W_TIME(15),

W_NUM(20).

W_TOP-TYP = 'S'.

CONCATENATE 'DATE:' SY-DATUM INTO W_DATE.

CONCATENATE 'TIME:' SY-UZEIT INTO W_TIME .

CONCATENATE 'ORDER NUMBER:' P_VBELN INTO W_NUM .

CONCATENATE W_DATE W_TIME W_NUM INTO W_TOP-INFO SEPARATED BY SPACE.

APPEND W_TOP TO T_TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = T_TOP

I_LOGO = 'GE_LOGO'