09-15-2015 4:05 PM
hi,
I am converting smartfrom otf to binary using SX_OBJECT_CONVERT_OTF_PDF. the data type of content_bin is SOLIX_TAB, which is RAW (255). I want to convert this into SDOK_SDATX which is RAW (1022). I have used below code to do that, But I am getting dump in FM SX_TABLE_LINE_WIDTH_CHANGE 'Invalid partial field access: Length is too large'. Am i Missing something? is there a better way to do this?
Dump text:
In the executed program "SAPLSX03", the system attempted to access the field
"CONTENT_IN" of the type "u" and with the length 127 using the length 255.
However, a partial field access with a length specification that is
larger than the field length is not allowed.
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = lt_control_parameters
output_options = lt_output_options
it_approval_data = lt_approval_data
IMPORTING
job_output_info = lt_job_output_info
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
*
CLEAR: lt_otf[], lt_content_hex, lt_content_txt.
lt_otf[] = lt_job_output_info-otfdata[].
LOOP AT lt_otf INTO ls_otf.
CLEAR ls_content.
CONCATENATE ls_otf-tdprintcom ls_otf-tdprintpar INTO ls_content.
APPEND ls_content TO lt_content_txt.
ENDLOOP.
CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
EXPORTING
format_src = 'OTF'
format_dst = 'PDF'
CHANGING
transfer_bin = lv_transfer_bin
content_txt = lt_content_txt
content_bin = lt_content_hex
objhead = lt_objhead
len = lv_len
EXCEPTIONS
err_conv_failed = 1
OTHERS = 2.
DATA: lt_content_new TYPE bbpt_att_cont.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
transfer_bin = 'X'
TABLES
content_in = lt_content_hex
content_out = lt_content_new
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
09-16-2015 4:48 AM
09-15-2015 4:58 PM
09-15-2015 6:53 PM
hi ethan,
I have a smartform with some data in SRM system. I need to send this data to ECC. The standard FM to transfer this data has a table parameter which has line type SDOKCNTBIN ( this has only one field which refers to SDOK_SDATX as data element ( which is RAW , 1022 ). So my question is how do i get the smart form data into this format?
09-15-2015 5:04 PM
call function 'SX_TABLE_LINE_WIDTH_CHANGE'
exporting
line_width_src = 127
transfer_bin = 'X'
TABLES
content_in = lt_content_hex
content_out = lt_content_new
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
09-15-2015 6:50 PM
09-15-2015 7:52 PM
Hi Shankar,
i hope you have idea about class CL_BCS_CONVERT, there is a method which will convert XSTRING_TO_SOLIX.
you can use that logic by doing below steps
1 convert your SOLIX_TAB, which is RAW (255) to xstring in a varible.
2. try to use the logic in the method, which is using sy-tleng which is ABAP System Field: Row
Length of Internal Table and change it to your internal table length manually by placing that code in your performs or classes.
you have to copy that logic because method export table is SOLIX.
thanks
09-16-2015 4:48 AM