Dynamic Code

download Dynamic Code

of 5

Transcript of Dynamic Code

  • 8/13/2019 Dynamic Code

    1/5

    17 Apr

    Written by

    ukasz PgielPublished:

    17 April 2013

    Hits: 299

    ateg!ry:

    H!" t!###

    Creating editor for dynamic code (SE38

    like)

    $ags: %&'$A()H*+, -%.$//.A*%%, *$/-.$A*.W$H.%$A$4%,%AP54.%*$.64'$/'/*, P-*$$&.P-'$*-

    had a th!ught !ne day t! use a !de sa8ed in database table !r easy hange ! s!e

    alulati!n rules and ;8e prepared !de t! run %*3< like edit!r !r suh !de# =aybes!e ! y!u als! had suh need, s! t!day "ill e>plain briely h!" t! d! this# "ill use

    6= 'EDITOR_TABLE_WITH_STATUS' t! display an edit!r "hih y!u kn!" r!%*3

  • 8/13/2019 Dynamic Code

    2/5

    Ater "e reate status "e an reate the AAP !de:

    report editor_test.

    data: ft_code type standard ta!e of strin".data: fs_code type c#ar$%%.data: fs_&par type &par.data: f_ta!e type strin".data: f_fie!dnae type strin".data: f_s"()$*+ type c.data: "_pro"(,+ type c. -teporary pro"ra naedata: "_ocode type sy/0co.data: f_c#an"ed type c.

    start/of/se!ection.

    fs_code 1 '2RO3RA4 D56A4I7_8OR4S.'.append fs_code to ft_code.fs_code 1 'for test c#an"in" f_strin" type strin".'.append fs_code to ft_code.fs_code 1 'f_strin" 1 sy/0nae.'.append fs_code to ft_code.fs_code 1 'endfor.'.

  • 8/13/2019 Dynamic Code

    3/5

    append fs_code to ft_code.

    ca!! f0nction 'RS_6A9I3ATIO6_BREA'.

    ca!! f0nction 'EDITOR_TABLE_WITH_STATUS'e;portin"

    < DIS2LA5 1 ' '< 6A4E 1 ' ' pro"ra 1 sy/repid ca!!ac_0serco 1 'U7O44' ca!!ac_set_pfey 1 'SET_28' tit!e_te;t 1 'O0r test editor'iportin" c#an"ed 1 f_c#an"ed< SUBR7 1 SUBR7 ta!es content 1 ft_code .

    ? *.

    endif. endif.

  • 8/13/2019 Dynamic Code

    4/5

    endfor. -set_pf

    editor?/?"et_so0rce_instance( iportin" so0rce_oCect 1 fo

    _so0rce +. fo_so0rce/?"et_so0rce_ta( iportin" so0rce 1 ft_so0rceta +.

    ca!! f0nction '2RETT5_2RI6TER' e;portin" inctoo 1 space< I42ORTI63< I6DE6TATIO6_4A5BE_WRO63 1 I6DE6TATIO6_4A5BE_WRO63 ta!es nte;t 1 ft_so0rceta_pretty ote;t 1 ft_so0rceta e;ceptions enF0e0e_ta!e_f0!! 1 ) inc!0de_enF0e0ed 1 $ inc!0de_readerror 1 inc!0de_riteerror 1 G ot#ers 1 % . if sy/s0rc >? *. endif. fo_so0rce/?set_so0rce_ta( e;portin" so0rce 1 ft_so0rceta_pretty not_act0a!i&e_contro! 1 '' +. >editor?/?@is0a!i&e_so0rce( +. endcase.

  • 8/13/2019 Dynamic Code

    5/5

    s0ppress dia!o".

    endfor. -0co

    And here is !ur result :)@

    &!u sh!uld take are ab!ut sa8ing unti!n but that sh!uld n!t be a pr!ble as y!u

    already seen in the !de h!" t! get the table "ith the !de t! l!al table# &!u an als!add !re unti!ns !r e>aple: ;Where used list; 6= ;-%.$//.A*%%;@ !r synta>

    hek %&'$A()H*+@#

    When y!u ha8e y!ur inal !de y!u an then generate a tep!rary pr!gra r! it using

    synta> !und bel!" and then all dynaially y!ur !rs reated there#

    "enerate s0ro0tine poo! ft_code nae "_pro" essa"e f_s".