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: 

PUT EXTRA SPACE

Former Member
0 Kudos

HI ALL,,

I want to put some space between to words in header part of alv report . my code is following.

CONCATENATE 'Vendor : ' LIFNR1 ' '

INTO

L_LIST .

I want to put some extra space after " Vendor " word.

plz help me...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use the addition Respecting Blanks with Concatenate.

Try like this;

Data : lv_vendor(20) type c value 'Vendor :'.

CONCATENATE lv_vendor lifnr1 INTO l_list RESPECTING BLANKS.

The output would like;

Vendor :            10000000

For more information see F1 help for Concatenate.

Regards

Karthik D

32 REPLIES 32

Former Member
0 Kudos

create a field like new = ' '. then try concatenate statement

Former Member
0 Kudos

Hi Ankita,

try this code-

CONCATENATE 'Vendor : ' LIFNR1

INTO

L_LIST separated by space.

Former Member
0 Kudos

Hi Ankita,

try it this way:

Data:

w_string type string,

w_char(5) value ' '.

CONCATENATE 'Vendor:' LIFNR1 ' '

INTO

w_string separated by w_char.

Write:

w_string.

With luck,

Pritam.

Former Member
0 Kudos

Hi,

Use the addition Respecting Blanks with Concatenate.

Try like this;

Data : lv_vendor(20) type c value 'Vendor :'.

CONCATENATE lv_vendor lifnr1 INTO l_list RESPECTING BLANKS.

The output would like;

Vendor :            10000000

For more information see F1 help for Concatenate.

Regards

Karthik D

0 Kudos

Karthik,

"RESPECTING BLANKS " IS NOT WORKING...

But i want same output as u put here.

0 Kudos

Hi,

What is the length of l_list field?

Try like this it is working fine.

DATA : l_list(30) TYPE c.

DATA : lv_vendor(20) TYPE c VALUE 'Vendor :'.

CONCATENATE lv_vendor lifnr INTO l_list RESPECTING BLANKS.

Regards

Bala Krishna

0 Kudos

one such option.

Data : text(50) .



text+0(6) = 'Hello'.
text+20(10) =  'world' .


write text.

0 Kudos

Hi,

check this code-

Data : w_vendor(20) type c value 'Vendor :'.

Parameters:p_lifnr type lifnr.

Data:l_list type string.

CONCATENATE w_vendor p_lifnr INTO l_list respecting blanks.

write:l_list.

0 Kudos

another option with concatenate.

Data : text(50) .

concatenate 'hello' `               ` 'world' into text.


write text.

0 Kudos

Bala...

when i m using "RESPECTING BLANKS" it gives error.

I am able to use only separated by space.

Plz help me..

0 Kudos

Hi ,

try this code-

Data : w_vendor(20) type c value 'Vendor :',
       w_space(8) type c.
Parameters:p_lifnr type lifnr.

Data:l_list type string.

CONCATENATE w_vendor p_lifnr INTO l_list separated by w_space.

write:l_list.

0 Kudos

hi ankita,

As i said its working fine for me. You need to declare all variables considering the length, so declare variables with appropriate length and try again.

Regards

Karthik D

<removed_by_moderator>

Edited by: Julius Bussche on Sep 6, 2008 10:52 AM

0 Kudos

>

> hi ankita,

>

> As i said its working fine for me. You need to declare all variables considering the length, so declare variables with appropriate length and try again.

>

>

> Regards

> Karthik D

>

> <removed_by_moderator> -


> Before asking [others|; to follow the rules, you might want to straighten up your own mess

pk

Edited by: Julius Bussche on Sep 6, 2008 10:53 AM

0 Kudos

you paste your full code here, so that we can try to solve it

0 Kudos

I m using alv grid control...

and for top of page code is like follow ....

FORM SUB_COMMENT_BUILD USING I_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

DATA : W1(30) TYPE C.

DATA : LV_VENDOR(20) TYPE C VALUE 'Vendor :',

CLEAR LS_LINE.

CONCATENATE LV_VENDOR ' ' LIFNR1 INTO L_LIST.

LS_LINE-TYP = 'S'.

LS_LINE-INFO = L_LIST.

APPEND LS_LINE TO I_TOP_OF_PAGE.

endform.

0 Kudos

if you don't give the complete details , you will never get the solution..

check this Program.. in this example you can give the gap using the ADD_GAP method.

report  ztest_page.

tables: sflight.
data : it_flight type table of sflight with header line.
data begin of it_sel_opt occurs 0.
        include structure rsparams.
data end   of it_sel_opt.
select-options: s_carrid for sflight-carrid.

start-of-selection.

  select * from sflight into table it_flight
   where carrid in s_carrid.

end-of-selection.

  call function 'RS_REFRESH_FROM_SELECTOPTIONS'
    exporting
      curr_report     = sy-repid
    tables
      selection_table = it_sel_opt
    exceptions
      not_found       = 01
      no_report       = 02.

  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program          = sy-repid
      i_callback_html_top_of_page = 'TOP_OF_PAGE'
      i_structure_name            = 'SFLIGHT'
    tables
      t_outtab                    = it_flight
    exceptions
      program_error               = 1
      others                      = 2.

*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->DOCUMENT   text
*----------------------------------------------------------------------*
form top_of_page using document type ref to cl_dd_document.
  data : dl_text(255) type c.  "Text

* Add new-line
  call method document->new_line.

  call method document->new_line.

  clear : dl_text.
* program ID
  dl_text = 'Program Name :'.
  call method document->add_gap.
  call method document->add_text
    exporting
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_heading_int.

  clear dl_text.
  dl_text = sy-repid.
  call method document->add_text
    exporting
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.

* Add new-line
  call method document->new_line.
  clear : dl_text.

  dl_text = 'Selection Criteria'.
  call method document->add_gap
    exporting
      width = 34.
  call method document->add_text
    exporting
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.

* Add new-line
  call method document->new_line.

  clear : dl_text.
  concatenate 'SELECT Option' 'SIGN' 'OPTION' 'LOW' 'HIGH'
  into dl_text separated by cl_abap_char_utilities=>horizontal_tab.

  call method document->add_gap
    exporting
      width = 34.
  call method document->add_text
    exporting
      text         = dl_text
      sap_emphasis = cl_dd_area=>heading
      sap_color    = cl_dd_area=>list_negative_inv.

* Add new-line
  call method document->new_line.
  loop at it_sel_opt.

    clear : dl_text.
    concatenate it_sel_opt-selname  it_sel_opt-sign
     it_sel_opt-option it_sel_opt-low it_sel_opt-high
    into dl_text separated by cl_abap_char_utilities=>horizontal_tab.

    call method document->add_gap
      exporting
        width = 34.
    call method document->add_text
      exporting
        text         = dl_text
        sap_emphasis = cl_dd_area=>heading
        sap_color    = cl_dd_area=>list_negative_inv.

* Add new-line
    call method document->new_line.

  endloop.

endform.                    "top_of_page

0 Kudos

Hi...

I had already given full detail... and i m not using OOP concept...

Plz help me.

0 Kudos

the above is not OOALV, it is normal alv. and this is using class cl_dd_document. with then you can align the TOP OF PAGE text what ever the way you want..

using the methods ADD_GAP of class CL_DD_DOCUMENT.

0 Kudos

>

> P.S.: Award Points for useful replies... -


> Before asking [others|; to follow the rules, you might want to straighten up your own mess

Hi prashanth,

I know very well about the rules of the forum and here also iam not requesting her to give points to me...

I know that requesting points is a offense by the rules of engagement, i would like to remind you that Assigning Points to useful replies is the responsibility of the thread starter.

I have just reminded her about that. I dont think there is a offense in that.

>

Step 4: Thank Others by Giving Points

>SDN/BPX has a Contributor Recognition Program. Which in short text means that for each question you have 10 points, which can be given to the person that answers your question. 6 & 2 points should also be given for helpful answers. For every question you later award points for, you in turn receive 1 point for. Please note that you do not need to explain that "points will be awarded". We should all know how the forum works.

Just thought to let you know this...Also keep in mind that no one is getting points credited to their bank accounts, all points are contributed towards [UN World Food Program|https://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/007928c5-c4ef-2a10-d9a3-8109ae621a82]...

Thanks for your advice....

Regards

Karthik D

0 Kudos

> I have just reminded her about that. I dont think there is a offense in that.

Hi there,

This reminder is already included in the rules and in the email watches sent together with posts, so there is no reason to add it in the post.

So please stop this here and continue with the question.

Cheers,

Julius

0 Kudos

No post should consists of Points that is the Main Motivation behind the rule. No point begging here.

It is left to the poster, You should not even suppose to mention the word points according to Rules of Engagement .

Edited by: Vijay Babu Dudla on Sep 6, 2008 6:58 AM

0 Kudos

>

>

> You should not even suppose to mention the word points according to Rules of Engagement .

>

> Edited by: Vijay Babu Dudla on Sep 6, 2008 6:58 AM

Cool..

but you have mentioned that word ???

Hey, leave it vijay,.....we are not here to exchange words, we are here to exchange knowledge...

Regards

Karthik D

0 Kudos

Hey..

What all r u doing?? I am asking for help and u all are worried about points??

0 Kudos

> but you have mentioned that word ???

I just mentioned to explain. Moderators are working every day to remove all these junk. it is an extra work which is causing the trouble for many of the Mods. They will remove this also. So we should keep the forum quality and control thats why we have rules. My aim to tell the importance of the rules. not to exchange of any words. Sorry my words are hurting you. as a community member i just gave the information. it is up to you to follow or not.

Ignore my message if you don't like.

0 Kudos

Hi,

Even in Debugger it is showing the value of w1 with spaces, may be the code of Function Module some where it is suppressing the values of space.

Just check in debugger the value of ur L_LIST value.

FORM build_comment USING p_heading TYPE slis_t_listheader.

DATA: hline TYPE slis_listheader.

DATA : w1(45) TYPE c.

DATA : lv_vendor(20) TYPE c VALUE 'Vendor :'.

DATA : lifnr1 TYPE lifnr VALUE '10001'.

CLEAR: hline.

w1+0(6) = lv_vendor.

w1+8(1) = ':'.

w1+35(10) = lifnr1.

hline-typ = 'S'.

hline-info = w1.

APPEND hline TO p_heading.

BREAK-POINT.

ENDFORM. " BUILD_COMMENT

Regards,

Bala Krishna

0 Kudos

>

> hi ankita,

>

> As i said its working fine for me. You need to declare all variables considering the length, so declare variables with appropriate length and try again.

>

>

> Regards

> Karthik D

>

> <removed_by_moderator>


>The only justification i ever need to make.

>

> Edited by: Julius Bussche on Sep 6, 2008 10:52 AM

Former Member
0 Kudos

hi,

CONCATENATE lv_dokar lv_doknr '...

no.of spaces u required..

' lv_doktl lv_dokvr INTO lv_objkt.

by

parthi

0 Kudos

Dear parthi..

Its not working...

Plz help me..

UmaArjunan
Active Participant
0 Kudos

hi,

Please use the following , it will surely work.

concatenate 'vendor : ' 'Alt key+pressNumpadkey255' 'Lifnr1' into l_list.

Pressing alt 255 will give you a single space. if you want to leave two spaces then press two time alt 255 key.

I have used this to leave space. Try this. it will work..

0 Kudos

Hi,

Is it your SAP version is lower that ECC 6.0?

I had tested the Respecting Blanks in ECC 5.0, and it is not working. But it is working in another ECC 6 system.

Perhaps it only working in ECC 6.0 system.

thanks:)

0 Kudos

I think it's too late but you can do that:



              concatenate data1 '         ' data2
              into data3 separated by space.

And the result (in abap program) look like what you want.

tata______toto ( __ is some blank)

Edited by: Pierron Fred on Oct 22, 2008 7:20 PM

Former Member
0 Kudos

solved