2006 Jul 12 8:44 PM
Hi ,
i need to send the SAP data to liberty through an outbound interface flat file . The file has 3000 characters and in that they are only few fields from SAP has to be filled and the rest of the fields has to be filled with spaces in between the SAP fields . I am taking output table and in that i am filling required fields from SAP and the rest of them as a Filler varaibles in between but the output table declaration comes out too big,Please let me know if there is any other approach to follow.
Thanks,
Makks.
Hi ,
i need to send the SAP data to liberty through an outbound interface flat file . The file has 3000 characters and in that they are only few fields from SAP has to be filled and the rest of the fields has to be filled with spaces in between the SAP fields . I am taking output table and in that i am filling required fields from SAP and the rest of them as a Filler varaibles in between but the output table declaration comes out too big,Please let me know if there is any other approach to follow.
Thanks,
Makks.
2006 Jul 12 8:57 PM
As each idoc segment length will have upto 1000 char maximum, you need have 3 segment per idoc. Then while converting you need to concatenate in middleware.
Regds
Manohar
2006 Jul 12 9:03 PM
hi Manohar ,
thanks for fast response ,but i am not using any IDOCS its just a flat file which i need to send with the required SAP fields data and the rest as spaces in between SAP fields to liberty.
2006 Jul 12 9:02 PM
I don't think you have to define an internal table with all the filler fields if you are sure that SAP is not going to be the source for those fields. You can deal with it in different ways.
option 1.
Declare only one field for the entire free space.
data: begin of itab occurs 0,
field1 ....,
field2 ....,
myspace1(1000),
field3.....,
myspace2(1000).
data: end of itab.Here we are combining all the blank fields into a single field even though for the receiving system, it may be 20 fields. So myspace1 if just one field of your internal table with 1000 spaces, your receiving system will see it as 20 fields with spaces.
option 2:
Declare an internal table with just the fields you fill in from SAP. When you are transferring the record to unix using 'TRANSFER', you move the individual fields to the corresponding offsets of a 3000 long string.
data: v_string(3000).
data: begin of itab occurs 0,
field1...
field2....
field3...
data: end of itab.
loop at itab.
clear v_string.
move: itab-field1 to v_string+0(xx),
itab-field2 to v_string+50(xx),
itab-field3 to v_string+2525(xx).
transfer v_string to file.
endloop.
2006 Jul 13 12:42 AM
Hi,
Use the following :
OPEN DATASET v_err_file FOR OUTPUT IN TEXT MODE.
IF sy-subrc = 0.
CONCATENATE l_field1
cl_abap_char_utilities=>Horizontal_tab
l_field2
l_field3
cl
p_messg
INTO v_concat_err SEPARATED BY cl_abap_char_utilities=>Horizontal_tab.
TRANSFER v_concat_err TO v_err_file.
CLOSE DATASET v_err_file.
Best regards,
Prashant
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |