-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathCLAS_ZSAPLINK_TRANSFORMATION.slnk
490 lines (437 loc) · 26.4 KB
/
CLAS_ZSAPLINK_TRANSFORMATION.slnk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<?xml version="1.0" encoding="utf-8"?>
<CLAS CLSNAME="ZSAPLINK_TRANSFORMATION" VERSION="1" LANGU="E" DESCRIPT="SAPlink - XSLT Plugin" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" CLSCCINCL="X" FIXPT="X" UNICODE="X" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 " ZSAPLINK_PLUGIN_MAJOR_VERSION="0 " ZSAPLINK_PLUGIN_MINOR_VERSION="1 " ZSAPLINK_PLUGIN_BUILD_VERSION="0 " ZSAPLINK_PLUGIN_INFO1="ZSAPLINK_CLASS is part of the main ZSAPLINK project --> This plugin found there instead of ZSAPLINK_PLUGINS projects" ZSAPLINK_PLUGIN_INFO2="SAPLINK homepage: https://www.assembla.com/spaces/saplink/wiki" ZSAPLINK_PLUGIN_INFO3="Download from https://www.assembla.com/code/saplink/subversion/nodes" ZSAPLINK_PLUGIN_INFO4="and navigate to: trunk -> core -> ZSAPLINK -> CLAS -> ZSAPLINK_CLASS.slnk" REFCLSNAME="ZSAPLINK">
<localImplementation>*"* local class implementation for public class
*"* use this source file for the implementation part of
*"* local helper classes</localImplementation>
<localTypes>*"* use this source file for any type declarations (class
*"* definitions, interfaces or data types) you need for method
*"* implementation or private method's signature</localTypes>
<localMacros>*"* use this source file for any macro definitions you need
*"* in the implementation part of the class</localMacros>
<attribute CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="C_OBJECT_TYPE" VERSION="1" LANGU="E" DESCRIPT="XSLT Object Type" EXPOSURE="1" STATE="1" EDITORDER="0 " ATTDECLTYP="2" ATTVALUE="'XSLT'" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="C_TAG_SOURCE" VERSION="1" LANGU="E" DESCRIPT="XML Tag for Source" EXPOSURE="1" STATE="1" EDITORDER="3 " ATTDECLTYP="2" ATTVALUE="'source'" ATTEXPVIRT="0" TYPTYPE="1" TYPE="STRING" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<attribute CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="XSLT_NAME" VERSION="1" LANGU="E" DESCRIPT="XSLT Name" EXPOSURE="1" STATE="1" EDITORDER="1 " ATTDECLTYP="0" ATTEXPVIRT="0" TYPTYPE="1" TYPE="CXSLTDESC" SRCROW1="0 " SRCCOLUMN1="0 " SRCROW2="0 " SRCCOLUMN2="0 " TYPESRC_LENG="0 "/>
<inheritance CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" STATE="1">
<redefinition CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" MTDNAME="CHECKEXISTS" EXPOSURE="0"/>
<redefinition CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" MTDNAME="CREATEIXMLDOCFROMOBJECT" EXPOSURE="0"/>
<redefinition CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" MTDNAME="CREATEOBJECTFROMIXMLDOC" EXPOSURE="0"/>
<redefinition CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" MTDNAME="DELETEOBJECT" EXPOSURE="0"/>
<redefinition CLSNAME="ZSAPLINK_TRANSFORMATION" REFCLSNAME="ZSAPLINK" VERSION="1" MTDNAME="GETOBJECTTYPE" EXPOSURE="0"/>
</inheritance>
<method CLSNAME="ZSAPLINK" CMPNAME="CHECKEXISTS" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD checkexists .
CONSTANTS:
lc_exists TYPE char1 VALUE '1'.
set_xslt_name( ).
IF cl_o2_api_xsltdesc=>exists( xslt_name ) EQ lc_exists.
exists = abap_true.
ENDIF.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK" CMPNAME="CREATEIXMLDOCFROMOBJECT" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD createixmldocfromobject .
DATA:
lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
ls_attributes TYPE o2xsltattr,
lo_rootnode TYPE REF TO if_ixml_element,
lt_xslt_source TYPE o2pageline_table,
lo_node TYPE REF TO if_ixml_element,
l_source TYPE string.
* set internal object name
set_xslt_name( ).
* load XSLT transformation
lo_xslt = get_xslt( xslt_name ).
* create parent node with attributes
lo_rootnode = xmldoc->create_element( c_object_type ).
* 1. get attributes
ls_attributes = lo_xslt->get_attributes( ).
setattributesfromstructure( node = lo_rootnode structure = ls_attributes ).
* 2. get XSLT source
lt_xslt_source = lo_xslt->get_source( ).
l_source = zsaplink_transformation=>buildsourcestring( pagetable = lt_xslt_source ).
lo_node = xmldoc->create_element( c_tag_source ).
lo_node->set_value( l_source ).
lo_rootnode->append_child( lo_node ).
xmldoc->append_child( lo_rootnode ).
ixmldocument = xmldoc.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK" CMPNAME="CREATEOBJECTFROMIXMLDOC" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD createobjectfromixmldoc .
DATA:
lo_rootnode TYPE REF TO if_ixml_element,
lo_node TYPE REF TO if_ixml_element,
lo_filter TYPE REF TO if_ixml_node_filter,
lo_iterator TYPE REF TO if_ixml_node_iterator,
lo_xslt TYPE REF TO cl_o2_api_xsltdesc,
ls_attributes TYPE o2xsltattr,
lt_xslt_source TYPE o2pageline_table,
ls_xslt_source LIKE LINE OF lt_xslt_source,
l_source TYPE string,
lt_source TYPE table_of_strings.
* try to find a XSLT transformation in the XML tree
xmldoc = ixmldocument.
lo_rootnode = xmldoc->find_from_name( c_object_type ).
* 1. get attributes
getstructurefromattributes( EXPORTING node = lo_rootnode CHANGING structure = ls_attributes ).
ls_attributes-devclass = devclass.
* set XSLT transformation name
objname = ls_attributes-xsltdesc.
set_xslt_name( ).
* check whether object already exists and if overwriting
* is allowed
IF checkexists( ) IS NOT INITIAL.
IF overwrite IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
ELSE.
* delete object for new install
deleteobject( ).
ENDIF.
ENDIF.
* 2. get XSLT source
CLEAR: lo_filter, lo_iterator, lo_node.
lo_filter = xmldoc->create_filter_name( c_tag_source ).
lo_iterator = xmldoc->create_iterator_filtered( lo_filter ).
lo_node ?= lo_iterator->get_next( ).
IF lo_node IS NOT INITIAL.
l_source = lo_node->get_value( ).
lt_source = zsaplink_transformation=>buildtablefromstring( source = l_source ).
LOOP AT lt_source INTO l_source.
CLEAR ls_xslt_source.
ls_xslt_source-line = l_source.
APPEND ls_xslt_source TO lt_xslt_source.
ENDLOOP.
ENDIF.
* create new XSLT transformation
cl_o2_api_xsltdesc=>create_new(
EXPORTING
p_source = lt_xslt_source
p_attr = ls_attributes
IMPORTING
p_obj = lo_xslt
EXCEPTIONS
object_already_existing = 1
not_authorized = 2
undefined_name = 3
OTHERS = 4 ).
IF sy-subrc NE 0.
CASE sy-subrc.
* object must not be existing already at this stage
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN 3.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
* check for valid object reference
IF lo_xslt IS NOT BOUND.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDIF.
* save XSLT transformation
save_xslt( lo_xslt ).
* reset
set_xslt_changeable( i_changeable = abap_false io_xslt = lo_xslt ).
name = objname.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK" CMPNAME="DELETEOBJECT" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD deleteobject .
DATA:
lo_xslt TYPE REF TO cl_o2_api_xsltdesc.
* set internal object name
set_xslt_name( ).
* load XSLT transformation
lo_xslt = get_xslt( xslt_name ).
* set changeable
set_xslt_changeable( i_changeable = abap_true io_xslt = lo_xslt ).
* delete XSLT transformation
lo_xslt->delete(
EXCEPTIONS
object_invalid = 1
object_not_changeable = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>locked.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
* only this call really deletes the XSLT
save_xslt( lo_xslt ).
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK" CMPNAME="GETOBJECTTYPE" VERSION="0" EXPOSURE="0" STATE="0" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD getobjecttype .
objecttype = c_object_type. " XSLT transformation
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="GET_XSLT" VERSION="1" LANGU="E" DESCRIPT="Returns the requested XXSLT Transformation object" EXPOSURE="1" STATE="1" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" MTDNEWEXC="X" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="GET_XSLT" SCONAME="I_XSLT_NAME" VERSION="1" LANGU="E" DESCRIPT="XSLT Name" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="CSEQUENCE" PAROPTIONL="X"/>
<parameter CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="GET_XSLT" SCONAME="RO_XSLT" VERSION="1" LANGU="E" DESCRIPT="XSLT Transformation" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " PARDECLTYP="3" PARPASSTYP="0" TYPTYPE="3" TYPE="CL_O2_API_XSLTDESC"/>
<exception CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="GET_XSLT" SCONAME="ZCX_SAPLINK" VERSION="1" LANGU="E" DESCRIPT="SAPlink exception class" MTDTYPE="0" EDITORDER="1 "/>
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD get_xslt .
* load XSLT transformation
cl_o2_api_xsltdesc=>load(
EXPORTING
p_xslt_desc = i_xslt_name
IMPORTING
p_obj = ro_xslt
EXCEPTIONS
not_existing = 1
permission_failure = 2
OTHERS = 5 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SAVE_XSLT" VERSION="1" LANGU="E" DESCRIPT="Saves the XSLT Transformation" EXPOSURE="1" STATE="1" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" MTDNEWEXC="X" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SAVE_XSLT" SCONAME="IO_XSLT" VERSION="1" LANGU="E" DESCRIPT="XSLT Transformation" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="3" TYPE="CL_O2_API_XSLTDESC"/>
<exception CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SAVE_XSLT" SCONAME="ZCX_SAPLINK" VERSION="1" LANGU="E" DESCRIPT="SAPlink exception class" MTDTYPE="0" EDITORDER="1 "/>
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD SAVE_XSLT .
* save XSLT transformation
io_xslt->save(
EXCEPTIONS
permission_failure = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 5.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SET_XSLT_CHANGEABLE" VERSION="1" LANGU="E" DESCRIPT="Sets the XSLT Transformation changeable" EXPOSURE="1" STATE="1" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" MTDNEWEXC="X" BCMTDCAT="00" BCMTDSYN="0">
<parameter CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SET_XSLT_CHANGEABLE" SCONAME="I_CHANGEABLE" VERSION="1" LANGU="E" DESCRIPT="Changeable?" CMPTYPE="1" MTDTYPE="0" EDITORDER="1 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="1" TYPE="ABAP_BOOL" PARVALUE="ABAP_TRUE" PARPREFERD="X"/>
<parameter CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SET_XSLT_CHANGEABLE" SCONAME="IO_XSLT" VERSION="1" LANGU="E" DESCRIPT="XSLT Transformation" CMPTYPE="1" MTDTYPE="0" EDITORDER="2 " DISPID="0 " PARDECLTYP="0" PARPASSTYP="1" TYPTYPE="3" TYPE="CL_O2_API_XSLTDESC"/>
<exception CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SET_XSLT_CHANGEABLE" SCONAME="ZCX_SAPLINK" VERSION="1" LANGU="E" DESCRIPT="SAPlink exception class" MTDTYPE="0" EDITORDER="1 "/>
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD set_xslt_changeable.
* set changeable
io_xslt->set_changeable(
EXPORTING
p_changeable = i_changeable
EXCEPTIONS
object_already_unlocked = 4
object_already_changeable = 5
object_locked_by_other_user = 3
permission_failure = 2
OTHERS = 10 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
WHEN 2.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN 3.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>locked.
WHEN 4 OR 5. " do nothing, continue
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
ENDMETHOD.</source>
</method>
<method CLSNAME="ZSAPLINK_TRANSFORMATION" CMPNAME="SET_XSLT_NAME" VERSION="1" LANGU="E" DESCRIPT="Setzt XSLT Name" EXPOSURE="1" STATE="1" EDITORDER="0 " DISPID="0 " MTDTYPE="0" MTDDECLTYP="0" BCMTDCAT="00" BCMTDSYN="0">
<source>*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*|Copyright 2006-2015 by Nicola Fankhauser([email protected])
*| |
*| Licensed under the Apache License, Version 2.0 (the "License"); |
*| you may not use this file except in compliance with the License. |
*| You may obtain a copy of the License at |
*| |
*| http://www.apache.org/licenses/LICENSE-2.0 |
*| |
*| Unless required by applicable law or agreed to in writing, software |
*| distributed under the License is distributed on an "AS IS" BASIS, |
*| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
*| implied. |
*| See the License for the specific language governing permissions and |
*| limitations under the License. |
*\---------------------------------------------------------------------/
METHOD set_xslt_name.
xslt_name = objname.
ENDMETHOD.</source>
</method>
</CLAS>