METHOD fill_doc_ship_type_txt.
DATA: exref TYPE REF TO cx_root.
TRY.
CLEAR docstc-ship_type_text_name.
IF docstc-vstel IS NOT INITIAL AND docstc-vsart IS NOT INITIAL.
"Some logic to determine name
docstc-ship_type_text_name = 'ZDLVY_XYZ' && docstc-vstel && '_' && docstc-vsart.
CONDENSE docstc-ship_type_text_name NO-GAPS.
IF langu IS INITIAL.
langu = 'E'.
ENDIF.
docstc-ship_type_text_langu = langu.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = docstc-ship_type_text_langu
name = docstc-ship_type_text_name
object = 'TEXT'
TABLES
lines = docstc-ship_type_text "Contains text lines, type TSFTEXT
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
IF langu NE 'E'.
result = fill_doc_ship_type_txt( langu = 'E' ).
ELSE.
result-status = c_stat_warning.
IF NOT sy-msgid IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO result-status_text.
ENDIF.
ENDIF.
ELSE.
result-status = c_stat_success.
ENDIF.
ELSE.
result-status = c_stat_error.
ENDIF.
CATCH cx_root INTO exref.
result-status = c_stat_error.
result-status_text = exref->get_text( ).
ENDTRY.
ENDMETHOD.
method xyz_get_entitsey.
............
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = 'E'
name = name
object = 'TEXT'
TABLES
lines = texts-tdlines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc IS INITIAL.
CALL FUNCTION 'CONVERT_ITF_TO_STREAM_TEXT'
EXPORTING
language = 'E'
lf = abap_true
IMPORTING
stream_lines = texts-strlines
TABLES
itf_text = texts-tdlines.
"Add Lines to entityset table
DATA: newline TYPE LINE OF zcl_zfdp_ef_purchase_o_mpc=>tt_pofixtext.
LOOP AT texts-strlines ASSIGNING FIELD-SYMBOL(<wa>).
CLEAR newline.
newline-seqno = sy-tabix.
newline-tdline = <wa>.
"Some sort of logic to open close tags for each line, in case if user forgets to add
"Javascript event will work for each line,therefore tags needs to exists for each line
IF newline-tdline CP '*<b>*' AND NOT newline-tdline CP '*</b>*'.
newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</b>*' AND NOT newline-tdline CP '*<b>*'.
newline-tdline = '<b>' && newline-tdline.
ENDIF.
IF newline-tdline CP '*<u>*' AND NOT newline-tdline CP '*</u>*'.
newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</u>*' AND NOT newline-tdline CP '*<u>*'.
newline-tdline = '<u>' && newline-tdline.
ENDIF.
IF newline-tdline CP '*<i>*' AND NOT newline-tdline CP '*</i>*'.
newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</i>*' AND NOT newline-tdline CP '*<i>*'.
newline-tdline = '<i>' && newline-tdline.
ENDIF.
APPEND newline TO et_entityset.
ENDLOOP.
ENDIF.
..........
endmethod.
// Form.FixText.xyz.Tdline::initialize - (JavaScript, client)
if(this.rawValue != null)
{
var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +
"<exData contentType='text/html' xmlns='http://www.xfa.org/schema/xfa-template/2.8/'" +
"><body xmlns='http://www.w3.org/1999/xhtml' xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/' " +
"xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +
"<p>"+ this.rawValue +"</p></body></exData>";
this.value.exData.loadXML(envelope,1,1);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
10 | |
8 | |
7 | |
4 | |
4 | |
4 | |
4 | |
3 |