Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 150x 150x 34x 34x 116x 116x 116x 1x 88x 88x 41x 41x 47x 47x 1x 182x 182x 182x 182x 18x 18x 1x 1x 17x 18x 30x 30x 30x 30x 30x 30x 30x 30x 30x 30x 30x 30x 30x 17x 18x 28x 28x 28x 28x 28x 28x 17x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 182x 182x | import {xmlToArray} from "../xml_utils";
export type DynproField = {
name: string,
type: string,
contType: string,
contName: string | undefined,
length: number,
vislength: number,
line: number,
column: number,
height: number,
/** REF_FIELD, for tabstrip pushbuttons the name of the assigned subscreen area */
refField: string | undefined,
};
export type DynproContainer = {
type: string,
name: string,
elementOf: string | undefined,
};
export type DynproHeader = {
number: string,
description: string,
nextScreen: string,
type: string,
fields: DynproField[],
containers: DynproContainer[],
/** true if the flow logic is stored inline in the XML, as opposed to a separate screen file */
hasFlowLogic: boolean,
};
export type DynproList = DynproHeader[];
function parseNumber(value: string | undefined): number {
if (value === undefined) {
return 0;
}
return parseInt(value, 10);
}
function parseText(value: any): string | undefined {
if (typeof value !== "string" || value.trim() === "") {
return undefined;
}
return value;
}
export function parseDynpros(parsed: any): DynproList {
const dynpros: DynproList = [];
const xmlDynpros = parsed.abapGit?.["asx:abap"]?.["asx:values"]?.DYNPROS;
if (xmlDynpros !== undefined) {
for (const d of xmlToArray(xmlDynpros.item)) {
if (d?.HEADER === undefined) {
continue;
}
const fields: DynproField[] = [];
for (const f of xmlToArray(d.FIELDS?.RPY_DYFATC)) {
fields.push({
name: f.NAME,
type: f.TYPE,
contType: f.CONT_TYPE,
contName: parseText(f.CONT_NAME),
length: parseNumber(f.LENGTH),
vislength: parseNumber(f.VISLENGTH),
line: parseNumber(f.LINE),
column: parseNumber(f.COLUMN),
height: parseNumber(f.HEIGHT),
refField: parseText(f.REF_FIELD),
});
}
const containers: DynproContainer[] = [];
for (const c of xmlToArray(d.CONTAINERS?.RPY_DYCATT)) {
containers.push({
type: c.TYPE,
name: c.NAME,
elementOf: parseText(c.ELEMENT_OF),
});
}
dynpros.push({
number: d.HEADER?.SCREEN,
description: d.HEADER?.DESCRIPT,
nextScreen: d.HEADER?.NEXTSCREEN,
type: d.HEADER?.TYPE,
fields: fields,
containers: containers,
hasFlowLogic: xmlToArray(d.FLOW_LOGIC?.RPY_DYFLOW).length > 0,
});
}
}
return dynpros;
}
|