2008 Aug 13 1:15 PM
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.
2008 Aug 13 1:19 PM
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.
2008 Aug 13 1:19 PM
2008 Aug 13 1:20 PM
Hi,
you have to use RESPECTING BLANKS addition in concatenate statement.
For example,
concatenate 'name' ' ' into v_name separeted by ',' RESPECTING BLANKS.
Regards,
Boobalan S
2008 Aug 13 1:43 PM
HI ,ITS NOT WORKING FOR ME CAN YOU BRIEF ME AGAIN WITH A PIECE OF SAMPLE CODE .THANX IN ADVANCE ...
2008 Aug 13 1:21 PM
Hi,
As of Web AS 2.0 we cannot use CONCATENATE statement as it ignores trailing spaces but from release 7.0 this statement can be used with new addition RESPECTING BLANKS to achieve the same. So to accomplish this task in 6.20 we can use the method UCCP of class CL_ABAP_CONV_IN_CE.
Check this sample code..may be it will help u..
REPORT z_sn_space.
CONSTANTS: c_space TYPE syhex02 VALUE '00a0'. " Value for space
DATA: g_space TYPE string,
l_pos type i.
TYPES: BEGIN OF ty_data,
field1(8) TYPE c,
END OF ty_data.
DATA: wa_data TYPE ty_data.
DATA: i_data TYPE STANDARD TABLE OF ty_data.
* Get the actual value for a space
g_space = cl_abap_conv_in_ce=>uccp( c_space ).
wa_data-field1 = 'Joy'.
L_pos = strlen( wa_data-field1 ).
Do 5 times.
wa_data-field1+l_pos(1) = g_space.
L_pos = l_pos + 1.
Enddo.
APPEND wa_data TO i_data.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = 'C:\trailing_space_demo.txt'
CHANGING
data_tab = i_data
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
NOT_SUPPORTED_BY_GUI = 22
ERROR_NO_GUI = 23
others = 24
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Joyjit Ghosh on Aug 13, 2008 2:22 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |