REPORT znadar_pseudo .
TABLES: tstc, tstct.
PARAMETERS: prg LIKE d010sinf-prog,
yncludes AS CHECKBOX DEFAULT ' '. "Incluye includes ?
DATA: vin(255) OCCURS 0 WITH HEADER LINE,
vout(255) OCCURS 0 WITH HEADER LINE,
di(255),
si(255),
ax TYPE I,
bx(2) TYPE n,
ebx(2) TYPE n,
BEGIN OF itab OCCURS 0,
patron(255),
real(255),
cambia(255),
END OF itab,
BEGIN OF valores,
01(01), 02(02), 03(03), 04(04), 05(05), 06(06), 07(07), 08(08), 09(09),
10(10), 11(11), 12(12), 13(13), 14(14), 15(15), 16(16), 17(17), 18(18),
19(19), 20(20), 21(21), 22(22), 23(23), 24(24), 25(25), 26(26), 27(27),
28(28), 29(29), 30(30), 31(31), 32(32), 33(33), 34(34), 35(35), 36(36),
37(37), 38(38), 39(39),
END OF valores,
tree LIKE snode OCCURS 10 WITH HEADER LINE,
BEGIN OF vprog OCCURS 0,
vprog LIKE d010sinf-prog,
END OF vprog,
BEGIN OF TMPTAB OCCURS 0.
INCLUDE STRUCTURE TEXTPOOL.
DATA: END OF TMPTAB,
sytabix LIKE sy-tabix.
FIELD-symbols: <f>.
END-OF-selection.
CLEAR vprog.
REFRESH vprog.
vprog-vprog = prg. APPEND vprog.
PERFORM configurame.
LOOP AT vprog.
prg = vprog-vprog.
PERFORM load_prog.
CHECK sy-subrc EQ 0.
PERFORM lista_cabecera.
vout = '*'. APPEND vout.
vout = '* Documentación generada por DocumentThis! v0.1'.
APPEND vout.
vout = '* (C) CopyLeft 2004-2014'. APPEND vout.
vout = '*'. APPEND vout.
PERFORM engine.
PERFORM list_data.
ENDLOOP.
FORM lista_cabecera.
DATA: current_treename(32),
oname LIKE tree-name,
err(1).
CONCATENATE 'PG_' prg INTO current_treename.
CALL FUNCTION 'WB_TREE_ACTUALIZE'
EXPORTING
tree_name = current_treename
with_tcode_index = 'X'
IMPORTING
syntax_error = err.
IMPORT tree FROM DATABASE dwtree(tr) ID current_treename.
vout = 'Descripción rápida del programa'.
CLEAR vout. APPEND vout.
LOOP AT tree.
vout = tree-name.
CHECK oname <> tree-name.
CASE tree-TYPE.
WHEN 'OI '.
READ TABLE vprog WITH KEY vprog = tree-name.
IF sy-subrc NE 0 AND yncludes = 'X'.
vprog-vprog = tree-name.
APPEND vprog.
ENDIF.
SELECT SINGLE TEXT INTO vout FROM trdirt
WHERE name = tree-name AND
sprsl = sy-langu.
CONCATENATE tree-name ' - ' vout INTO vout
SEPARATED BY ' '.
WHEN 'OPD'.
IF tree-INCLUDE NE prg.
CONCATENATE vout ' (' tree-INCLUDE ')' INTO vout
SEPARATED BY ' '.
ENDIF.
WHEN 'OPZ'.
SELECT SINGLE TEXT INTO vout FROM rsmptexts
WHERE progname = prg
AND sprsl = sy-langu
AND obj_type = 'T'
AND obj_code = tree-name.
CONCATENATE tree-name ' - ' vout INTO vout
SEPARATED BY ' '.
WHEN 'OPT'.
SELECT SINGLE ddtext INTO vout FROM dd02t
WHERE tabname = tree-name
AND ddlanguage = sy-langu.
CONCATENATE tree-name ' - ' vout
INTO vout SEPARATED BY ' '.
WHEN 'OT'.
SELECT SINGLE * FROM tstc WHERE tcode = tree-name.
SELECT SINGLE * FROM tstct WHERE sprsl = sy-langu
AND tcode = tree-name.
CONCATENATE tstc-tcode ' - '
tstc-pgmna ' - '
tstc-dypno ' - '
tstct-ttext INTO vout SEPARATED BY ' '.
ENDCASE.
APPEND vout.
oname = tree-name.
CHECK tree-TYPE+0(1) = 'C'.
vout = '-------------------------------------------'. APPEND vout.
CLEAR vout. APPEND vout.
ENDLOOP.
READ TEXTPOOL PRG LANGUAGE SY-LANGU INTO TMPTAB.
LOOP AT tmptab.
AT FIRST.
vout = 'Textos'. APPEND vout.
vout = '-------------------------------------------'. APPEND vout.
ENDAT.
CLEAR vout.
IF tmptab-ID = 'I'. vout = 'TEXT-'. ENDIF.
CONCATENATE vout tmptab-KEY ':' tmptab-ENTRY INTO vout.
APPEND vout.
ENDLOOP.
ENDFORM.
FORM list_data.
LOOP AT vout. WRITE: / vout. ENDLOOP.
ENDFORM.
FORM load_prog.
CLEAR: vin, vout, di, ax, bx.
REFRESH: vin, vout.
READ REPORT prg INTO vin.
ENDFORM.
FORM engine.
CLEAR si.
DESCRIBE TABLE vout LINES ax.
APPEND LINES OF vin TO vout.
CLEAR ebx.
LOOP AT vout INTO di FROM ax.
sytabix = sy-tabix.
CHECK di+0(1) NA '*"' AND NOT di IS INITIAL.
TRANSLATE di TO LOWER CASE.
IF di CP '*form*'.
IF di NP '*perform*' AND
di NP '*endform*' AND
di NP '*format*'.
REPLACE 'form' WITH 'subrutina' INTO di.
ENDIF.
ENDIF.
IF di CP '*if *' AND di NP '*endif*'.
REPLACE 'if' WITH 'pregunta si' INTO di.
ENDIF.
LOOP AT itab.
CHECK di CP itab-patron.
bx = STRLEN( itab-cambia ).
CONCATENATE 'valores-' bx INTO si.
bx = STRLEN( itab-real ).
ASSIGN (si) TO <f>.
<f> = itab-cambia.
REPLACE itab-real length bx WITH <f> INTO di.
ENDLOOP.
MODIFY vout FROM di INDEX sytabix.
ENDLOOP.
ENDFORM.
FORM configurame.
* Los espacios y el orden es muy importante
* Tcalo bajo tu riesgo
PERFORM add_string USING:
'*like*' 'like' 'como',
'*type*' 'type' 'tipo',
'*loop at*' 'loop at' 'Bucle para',
'*endloop*' 'endloop' 'fin bucle',
'*check*' 'check' 'Continuar sólo si',
'*parameters*' 'parameters' 'parámetro de pantalla',
'*append*' 'append' 'añadir',
'*delete*' 'delete' 'borrar',
'*collect*' 'collect' 'añade sumando',
'*modify*' 'modify' 'modificar',
'*update*' 'update' 'actualizar',
'*insert*' 'insert' 'insertar',
'*end-of-selection*' 'end-of-selection' 'Evento: Fin Selección',
'*initialization*' 'initialization' 'Evento: Inicialización',
'*top-of-page*' 'top-of-page' 'Evento: Cabecera',
'*at user-command*' 'at user-command' 'Evento: Pulsación',
'*start-of-selection*' 'start-of-selection' 'Evento: Inicio Seleccin',
'*at line-selection*' 'at line-selection' 'Evento: Lnea seleccionada',
'* where *' 'where' 'donde',
'* from *' 'from' 'desde',
'*endselect*' 'select' 'fin consulta',
'*select*' 'select' 'consulta',
'*single*' 'single' 'primer registro',
'*write*' 'write' 'escribir',
'*is initial*' 'is initial' 'está inicializado',
'*describe table*' 'describe table' 'descripción de tabla',
'*read table*' 'read table' 'leer tabla',
'*read line*' 'read line' 'leer lnea',
'*dataset*' 'dataset' 'juego de datos',
'*open *' 'open' 'abrir',
'*data*' 'data' 'crea variable',
'* do.*' ' do.' 'repite',
'* do *' ' do ' 'repite',
'* times*' ' times' ' veces',
'*enddo*' 'enddo' 'fin repite',
'*perform*' 'perform' 'llamar a',
'*endform*' 'endform' 'fin de subrutina',
'*endif*' 'endif' 'fin pregunta',
'*while*' 'while' 'mientras',
'*endwhile*' 'endwhile' 'fin mientras',
'*clear*' 'clear' 'inicializa',
'*refresh*' 'refresh' 'limpia',
'*authority-check*' 'authority-check' 'Comprobar autorización',
'*replace*' 'replace' 'cambiar cadena',
'* cp *' ' cp ' ' contiene patrón ',
'* np *' ' np ' ' no contiene patrón ',
'* co *' ' co ' ' contiene sólo ',
'* cn *' ' cn ' ' no contiene nigún ',
'* ca *' ' ca ' ' contiene algún ',
'* ne *' ' ne ' ' difiere de ',
'* eq *' ' eq ' ' es igual a ',
'* na *' ' na ' ' no contiene algún ',
'* le *' ' le ' ' menor o igual ',
'* lt *' ' le ' ' menor ',
'* ge *' ' le ' ' mayor o igual ',
'* gt *' ' le ' ' mayor ',
'* eq *' ' le ' ' igual ',
'* <> *' ' <> ' ' diferente ',
'*and return' 'and return' 'y regresar',
'* and *' ' and ' ' y ',
'* or *' ' or ' ' o ',
'* with *' ' with ' ' con ',
'* into *' ' into ' ' meter en ',
'* to *' ' to ' ' a ',
'*header*line*' 'header line' 'cabecera',
'* occurs *' 'occurs' 'occurrencias',
'*begin of*' 'begin of' 'estructura' ,
'*end of*' 'end of' 'fin estructura' ,
'*call function*' 'call function' 'Llamar a función',
'*exporting*' 'exporting' 'pasándole',
'*importing*' 'importing' 'recibiendo',
'*exceptions*' 'exceptions' 'errores',
'*continue*' 'continue' 'siguiente bucle',
'*exit*' 'exit' 'abandona proceso',
'* not *' 'not' 'no cumple',
'* add *' 'add' 'suma',
'*substract*' 'substract' 'resta',
'*divide*' 'divide' 'dividir',
'*starting*' 'starting' 'comenzando',
'*ending*' 'ending' 'finalizando',
'*multiply*' 'multiply' 'multiplicar',
'*concatenate*' 'concatenate' 'juntar cadenas',
'*field-symbols*' 'field-symbols' 'puntero',
'*include*' 'include' 'incluir fuente',
'*assign*' 'assign' 'asignar',
'*using*' 'using' 'pasando',
'*message*' 'message' 'mensaje',
'*decimals*' 'decimals' 'decimales',
'*elseif*' 'elseif' 'sino pregunta si',
'*else*' 'else' 'sino',
'*when *' 'when' 'cuando',
'*endcase*' 'endcase' 'final casos',
'* case *' 'case' 'Pregunta casos de',
'*move-corresponding*' 'move-corresponding'
'copia campos similares de',
'*move *' 'move' 'copia contenido de',
'*move:*' 'move:' 'copia contenido de',
'*max( *' 'max(' 'valor máximo(' ,
'*min( *' 'min(' 'valor mínimo(' ,
'*count(*' 'count(' 'contar(' ,
'*table*' 'table' 'utilizar tabla',
'*begin of block*' 'begin of block' 'principio bloque' ,
'*comment*' 'comment' 'comentario' ,
'*new-page*' 'new-page' 'nueva pgina' ,
'*separated by*' 'separated by' 'separar por' ,
'*end of block*' 'end of block' 'fin bloque' ,
'*raise*' 'raise' 'finalizar con' ,
'*endselect*' 'endselect' 'fin consulta' ,
'*call transaction*' 'call transaction' 'llamar a transaccion',
'*submit*' 'submit' 'ejecutar' ,
'*and return*' 'and return' 'y regresa' ,
'*ranges*' 'ranges' 'rangos' ,
'*selection+screen*' 'selection-screen' 'pantalla' ,
'*select+options*' 'select-options' 'parmetro multiple' ,
'*break-point*' 'break-point' 'interrupcion' ,
'*translate*' 'translate' 'cambia',
'*changing*' 'changing' 'cambiando' ,
'* by *' ' by ' 'por ' ,
'*sort *' 'sort' 'ordena',
'*format*' 'format' 'formato',
'uline' 'uline' 'subraya',
'*rollback work*' 'rollback work' 'retrocesión BBDDs',
'*commit work*' 'commit work' 'Monitoreo de BBDDs',
'*leave program*' 'leave program' 'salir del programa',
'*set screen*' 'set screen' 'poner pantalla',
'*call screen*' 'call screen' 'ejecutar pantalla',
'*call method*' 'call method' 'ejecutar método',
'*client specified*' 'client specified' 'especificando mandante',
'*end-of-definition*' 'end-of-definition' 'final definición',
'*unpack*' 'unpack' 'desempaqueta',
'*pack*' 'pack' 'empaqueta',
'*found*' 'found' 'encontrado',
'*shift*' 'shift' 'desplaza',
'*import *' 'import ' 'importar ',
'*export *' 'export ' 'exportar ',
'*memory id*' 'memory id ' 'identificación de memoria',
'*left deleting leading*' 'left deleting leading'
'a la izquierda borrando',
'*right deleting trailing*' 'right deleting trailing'
'a la derecha borrando',
'*places*' 'places' 'sitios',
'*uline*' 'uline' 'pintar raya',
'*in program*' 'in program' 'en el programa',
'*skip*' 'skip' 'linea en blanco',
'*read textpool*' 'read textpool' 'leer textos',
'*lines*' 'lines' 'lineas',
'*currency*' 'currency' 'con moneda',
'* field *' ' field ' ' campo ',
'* if *' ' if ' 'pregunta si',
'* method *' 'method' 'método',
'class *' 'class' 'clase',
'* implementation*' 'implementation' ' implementación',
'* definition' 'definicion' ' definición',
'* create object *' 'create object' 'crear objeto',
'* receiving *' 'receiving' 'recibiendo',
'*endmethod*' 'endmethod' 'fin método',
'*get reference of*' 'get reference of' 'devuelve referencia de',
'* at *' ' at ' ' en '.
ENDFORM.
FORM add_string USING cad_01 cad_02 cad_03.
itab-patron = cad_01.
itab-real = cad_02.
itab-cambia = cad_03.
TRANSLATE itab-cambia to LOWER CASE.
APPEND: itab.
ENDFORM.