Skip to content

Instantly share code, notes, and snippets.

View alezhu's full-sized avatar
🏠
Working from home

Alexandr Zhuravlev alezhu

🏠
Working from home
View GitHub Profile
@alezhu
alezhu / transform.xslt
Last active September 18, 2018 08:11
XML parse with slip tags. SimpleTransformation
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:variable name="skip"/>
<tt:template>
<root>
<values>
<tt:assign to-var="skip" val="0"/>
<tt:group>
<tt:d-cond frq="?">
@alezhu
alezhu / data.xml
Last active September 18, 2018 07:27
xmlsimple transfomation with unnessesary tags
<root>
<values>
<material>1</material>
<prod>XXXX</prod>
<foo>bar</foo>
<values>
</root>
REPORT ZTEST_SORT_DUP_DELETE_VS_HASH.
TYPES:
BEGIN OF ts_data,
num TYPE i,
END OF ts_data.
TYPES:
BEGIN OF ts_result,
lines TYPE i,
@alezhu
alezhu / zaz_unlock_editor.abap
Created August 18, 2017 17:26
Разблокировка редактора для программы
REPORT zaz_unlock_editor.
PARAMETERS p_prog TYPE trdir-name OBLIGATORY.
START-OF-SELECTION.
UPDATE PROGDIR SET edtx = space WHERE name = p_prog AND edtx = 'X'.
COMMIT WORK.
WRITE 'Done'.
*DEFINITION
private section.
types:
begin of ts_dest,
bskey type SLD_BSKEY,
logsys type TBLSYSDEST-logsys,
dest type TBLSYSDEST-rfcdest,
end of ts_dest,
tt_dest type HASHED TABLE OF ts_dest with UNIQUE key bskey.
class-methods SY2RETURN
exporting
!ES_RETURN type BAPIRET2
changing
!CT_RETURN type BAPIRET2_T optional .
METHOD sy2return.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = sy-msgty
@alezhu
alezhu / class_decorator.ts
Last active July 9, 2018 08:18 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@alezhu
alezhu / ZCL_TVARVC.abap
Last active April 5, 2024 23:44
Class to work with TVARVC table (get value, get_range, check value equal)
class ZCL_TVARVC definition
public
abstract
final
create public .
public section.
class-methods CHECK_VALUE
importing
@alezhu
alezhu / zcl_call_fbl1n.abap
Created December 16, 2016 13:39
Call FBL1N with multi lifnr, bukrs, belnrs via batch input
CLASS zcl_call_fbl1n DEFINITION
PUBLIC
ABSTRACT
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
tt_bukrs TYPE STANDARD TABLE OF bukrs WITH DEFAULT KEY .
@alezhu
alezhu / GetCellPage.excel.vba
Created November 30, 2016 06:43
Page number for cell
Function GetCellPage(ra As range) As Long
Dim ws As Worksheet
GetCellPage = 0
Set ws = ra.Parent
Dim iRow As Long
If ws.HPageBreaks.Count > 0 Then
iRow = ra.Row
Do
GetCellPage = GetCellPage + 1