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: 

reg : spaces in the output file .

Former Member
0 Kudos

Hi all ,

i have used concatenate command but the thing is that in output when i see after c_version value there shud be 20 spaces .but it is not happening now .whenevr i give blank spaces to add after all the variables then it is not taking .for ex ... i have below pasted the file output .after 2.0 there shud be 20 spaces but if we press right arrow key it shud not go to the next line after 20 spaces it shud go to the next line .any pointers plz thanx in advance ......

INVSYNSSD B70SAPAMS0000000005D0000002520200808130556352.0

data : l_spare TYPE string,

l_sp_size TYPE i VALUE '20'.

SHIFT l_spare RIGHT BY l_sp_size PLACES.

CONCATENATE c_msg_type c_msg_stype l_tr_type

zsource_site c_sou_appln l_seq_fno

l_envrn l_msg_flgth l_stamp

c_version l_spare INTO wa_final_header.

i had actually got replies to use respecting blanks but i am using sap 4.6c i think it does not support .can anybody plz help me out.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

If you want to use spaces at the end and you are having a problem to use it because of your version you can concatenate white character spaces at the end. To generate "White character Spaces" in your ABAP editor just use "ALT+255".

What this does is, it create a space which is of type character as we are using the ASCII value of the space. Please query if you have any doubts.

Thanks,

Jayant Sahu.

5 REPLIES 5

Former Member
0 Kudos

normally although you have spaces at last, SAP doesnot consider these spaces wjile downloading of data.

One thing is you can use entry key separator at the end of the data line so as that the spaces are been shown up.

0 Kudos

hi can you tell me in breif wat is entry key separator ..and how to use it plz ....can you tell me ..

0 Kudos

You can try using RESPECTING BLANKS addition.

This is from SAP help:


Addition 3 
... RESPECTING BLANKS 


Effect 
The addition RESPECTING BLANKS is only allowed during string processing and causes the closing spaces for data objects dobj1 dobj2 ... or rows in the internal table itab to be taken into account. Without the addon, this is only the case with string. 



Note 
With addition RESPECTING BLANKS, statement CONCATENATE can be used in order to assign any character strings EX>text - taking into account the closing empty character - to target str of type string: CLEAR str. CONCATENATE str text INTO str RESPECTING BLANKS. 



Example 
After the first CONCATENATE statement, result contains "When_the_music_is_over", after the second statement it contains "When______the_______music_____is________ over______" . The underscores here represent blank characters. 

TYPES text   TYPE c LENGTH 10. 
DATA  itab   TYPE TABLE OF text. 
DATA  result TYPE string. 

APPEND 'When'  TO itab. 
APPEND 'the'   TO itab. 
APPEND 'music' TO itab. 
APPEND 'is'    TO itab. 
APPEND 'over'  TO itab. 

CONCATENATE LINES OF itab INTO result SEPARATED BY space. 
... 
CONCATENATE LINES OF itab INTO result RESPECTING BLANKS. 

Former Member
0 Kudos

Hello,

If you want to use spaces at the end and you are having a problem to use it because of your version you can concatenate white character spaces at the end. To generate "White character Spaces" in your ABAP editor just use "ALT+255".

What this does is, it create a space which is of type character as we are using the ASCII value of the space. Please query if you have any doubts.

Thanks,

Jayant Sahu.

0 Kudos

Hi ,

as you said can you please tell me how to use it sir ...any sample code plz .....thanx in advance ....