German: Probleme mit "Fortschreibungsregeln -> Start

Question: Hi togethrer!

I hope that someone speak German so that he can read the following lines:

Suche Hilfe für die Erstellung einer Fortschreibungsregel im SAP-BW durch
Nutzen der Startroutine und zusätzlichen Routinen für die Kennzahlen, welche
mit vorberechneten Werte aus der Startroutine berechnet werden.

kurzes Bsp.

Die DataSource bringt Buchungskreis, Sachkonto-Nr, Debit, Credit und
Balance.

Nun soll in der Startroutine bereits die Kennzahlen "Umsatz", "Bruttoertrag"
und noch weitere Kennzahlen berechnet werden, doch für dieses Beispiel
genügen diese zwei.

"Umsatz" = Sachkonto 600000 bis 630000
"Bruttoertrag" = Sachkonto 600000 bis 630000 plus 30000 (Warenaufwand)

In der Startroutine möchte ich nun quasi eine Tabelle erstellen mit den
jeweiligen Kennzahlen pro Buchungskreis und Periode, also etwa so:

Buchungskreis / Periode / "Umsatz" / "Warenaufwand" / etc

In der Routine für die Kennzahl "Bruttoertrag" soll dann auf die in der
Startroutine 'erstellte' Tabelle zugegriffen werden können und eben "Umsatz"
+ "Warenaufwand" gerechnet werden, was dann den Bruttoertrag ergibt. Oder
aber auch die Bruttoetragsmarge, welche dann lauten würde ("Umsatz" +
"Warenaufwand") / "Umsatz" * 100.

Dieses Beispiel ist relativ einfach aufgebaut, doch wenn mir jemand an
diesem erläutern könnte wie die Startroutine für Vorberechnungen und
anschliessende Weiterverwendung in den Kennzahlen-Routinen genutzt werden
kann, sollte ich es auch auf mein komplexeres Problem anwenden können.

Vielen Dank im voraus!
gruss
oliver

Answer:
Es folgt ein einfaches Codebeispiel, dass Sie anpassen koennen. Machen Sie Ihre Datendeklarationen (Types und Data) in den Globalen Routine-Teil, oben.

*BEISPIELSCODE FUER DIE STARTROUTINE
*alle benoetigte Felder Hier definieren, inklusiv Umsatz u. Bruttoertrag
TYPES: begin of struct,
X(10) type c, xxx(10) type c,
end of struct.

*xyz abc mit eindeutigen Schluesselfeldern ersetzen, (wahrscheinlich *Buch-kreis, KontoNr, Periode)
DATA: i_TAB type hashed table of struct
with header line with unique key xyz abc.

REFRESH: i_TAB.
CLEAR: i_TAB.

*Sie muessen mindestens auch alle Schluesselfelder fuellen (Hier *Beispielhaft nur Buchungkreis)
loop at DATA_PACKAGE into i_TAB.
if DATA_PACKAGE-SACHKONTO between 600000 AND 630000.
move data_package-BALANCE to i_tab-umsatz.
move data_package-BALANCE to i_tab-bruttoertrag.
move data_package-Buchungskreis to itab-Buchungskreis.
insert table i_TAB.
endif.
if DATA_PACKAGE-SACHKONTO = '30000'.
move data_package-BALANCE to i_tab-bruttoertrag.
move data_package-Buchungskreis to itab-Buchungskreis.
endif.
endloop.

*ENDE DER STARTROUTINE


*IN DER KENNZAHLROUTINE FUER UMSATZ KOENNEN SIE DANN SO *VORGEHEN:
read table i_TAB with table key xyz = COMM_STRUCTURE-xyz abc = COMM_STRUCTURE-abc.
* result value of the routine
if sy-subrc = 0.
RESULT = i_TAB-umsatz.
endif.

Answer:
Erstmal herzlichen Dank ! Leider aber funktioniert die Startroutine noch nicht so wie sie sollte. Hier was ich eingegeben habe zusammen mit dem „Prüfen“-Kommentar:

PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...

TYPES: BEGIN OF STRUCT,
bukrs(4),
umsatz(10) TYPE c,
warenaufw(10) TYPE c,
bgewinn(10) TYPE c,
bgewmarge(10) TYPE c,
END OF STRUCT.

DATA: i_TAB TYPE HASHED TABLE OF STRUCT
WITH HEADER LINE WITH UNIQUE KEY bukrs, periode.

REFRESH: i_TAB.
CLEAR: i_TAB.

loop at DATA_PACKAGE into i_TAB.
if DATA_PACKAGE-gl_account between '0000611000' AND '0000613001'.
move DATA_PACKAGE-credit to i_tab-umsatz.
move DATA_PACKAGE-debit to i_tab-umsatz.
move DATA_PACKAGE-comp_code to i_tab-bukrs.
insert table i_TAB.
endif.
if DATA_PACKAGE-gl_account = '0000313000'.
move DATA_PACKAGE-credit to i_tab-warenaufw.
move DATA_PACKAGE-debit to i_tab-warenaufw.
move DATA_PACKAGE-comp_code to i_tab-bukrs.
insert table i_TAB.
endif.
endloop.



*$*$ end of global - insert your declaration only before this line *-*

* The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0FI_GL_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
* to make monitor entries

* if abort is not equal zero, the update process will be canceled
ABORT = 0.

*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.


„Prüfen“-Kommentar:
E:Feld "DATA_PACKAGE" unbekannt. Es ist weder in einer der angegebenen
Tabellen enthalten noch durch eine "DATA"-Anweisung definiert.

Ich hab’ dann den unten folgenden Teil (welcher eigentlich erst nach der Globalen Routine kommt) nach oben gezogen:

* The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0FI_GL_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

Die Gesamtroutine sieht nun so aus:

PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...

* The follow definition is new in the BW3.x

TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0FI_GL_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

TYPES: BEGIN OF STRUCT,
bukrs(4),
umsatz(10) TYPE c,
warenaufw(10) TYPE c,
bgewinn(10) TYPE c,
bgewmarge(10) TYPE c,
END OF STRUCT.

DATA: i_TAB TYPE HASHED TABLE OF STRUCT
WITH HEADER LINE WITH UNIQUE KEY bukrs, periode.

REFRESH: i_TAB.
CLEAR: i_TAB.

loop at DATA_PACKAGE into i_TAB.
if DATA_PACKAGE-gl_account between '0000611000' AND '0000613001'.
move DATA_PACKAGE-credit to i_tab-umsatz.
move DATA_PACKAGE-debit to i_tab-umsatz.
move DATA_PACKAGE-comp_code to i_tab-bukrs.
insert table i_TAB.
endif.
if DATA_PACKAGE-gl_account = '0000313000'.
move DATA_PACKAGE-credit to i_tab-warenaufw.
move DATA_PACKAGE-debit to i_tab-warenaufw.
move DATA_PACKAGE-comp_code to i_tab-bukrs.
insert table i_TAB.
endif.
endloop.



*$*$ end of global - insert your declaration only before this line *-*

* The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CS0FI_GL_1.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
* to make monitor entries

* if abort is not equal zero, the update process will be canceled
ABORT = 0.

*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.


„Prüfen“-Kommentar :
E:Eine Zeile von "DATA_PACKAGE" und "I_TAB" sind nicht ineinander
konvertierbar. In einem Unicode-Programm muß "DATA_PACKAGE" unabhängig
von der Länge eines Unicode-Zeichens dasselbe Strukturlayoutwie "I_TAB"

Der Cursor positioniert sich dabei auf die Zeile „loop at DATA_PACKAGE into i_TAB.“

Tja, und nun wäre ich natürlich froh wenn ich nochmals Hilfe bekäme!!!

gruss
oliver

Answer:
I think you should write in english out of consediration for all the people using that forum that does not speak english.
If not, I can write in spanish, others in french, italian, and we can do lots of parallels forums.
You have to do a little effort to write in english (it does not matter if your english is not very polite, look at mine!), because any other people could be interested in your problem and solution.

Answer:
Hallo Oliver,
Ich habe's auf die Schnelle gemacht, und habe gerade ein Fehler entdeckt: bitte den Teil 'into i_tab' entfernen (somit nun nur: loop at data_package.) .
Dazu muss den Teil loop at data_package... bis ...endloop. in den unteren Teil der Routine liegen, i.e. nach :
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
* to make monitor entries
loop at.....
..
endloop.
Schau mal die 'Routines Info' Knopf oben Rechts fuer weitere Beispiele...
Ciao,
MariaCc

Answer:
Hi SpanisMaster,
Agree with you that we all want to make the effort to use a common language in order to share knowledge. However, I think it's not fair excluding people just because they can't speak english, no?

Answer:
I think anybody can write in his language, but anybody can use a simple translator, almost to give an idea of the content. You can see lots of messages in this forum from people that does not speak english and write messages making an effort.
Moreover, people who answer does not speak english either?
But, It was only one suggestion and I'm sorry for any incovenience in my message, but I hope in future this forum continues being an english-spoken forum (still I'd prefere spanish-spoken).

Answer:
Ok, like I wrote to SpanishMaster via personal-message, I will try to writte in English, but to finish this topic with MariaCc, I continue in German.

Hi Maria!!

Ich hab' die Startroutine geändert wie angewiesen und hab' keinen "Prüfen"-Fehler mehr gemeldet bekommen. Leider aber in der Routine für die Kennzahl:

PROGRAM UPDATE_ROUTINE.
*$*$ begin of global - insert your declaration only below this line *-*
* TABLES: ...
* DATA: ...

* The follow definition is new in the BW3.x

TYPES: BEGIN OF STRUCT,
bukrs(4),
umsatz(10) TYPE c,
warenaufw(10) TYPE c,
bgewinn(10) TYPE c,
bgewmarge(10) TYPE c,
END OF STRUCT.

DATA: i_TAB TYPE HASHED TABLE OF STRUCT
WITH HEADER LINE WITH UNIQUE KEY bukrs.

REFRESH: i_TAB.
CLEAR: i_TAB.

*$*$ end of global - insert your declaration only before this line *-*


FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
RESULT_TABLE STRUCTURE /BIC/VZWW_CISTT
USING COMM_STRUCTURE LIKE /BIC/CS0FI_GL_1
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
ICUBE_VALUES LIKE /BIC/VZWW_CISTT
CHANGING RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
*
*$*$ begin of routine - insert your code only below this line *-*
* fill the internal table "MONITOR", to make monitor entries

read table i_TAB with table key bukrs = COMM_STRUCTURE-comp_code.

if sy-subrc = 0.
RESULT = i_TAB-bgewinn.
endif.


* if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
* if abort is not equal zero, the update process will be canceled
ABORT = 0.

*$*$ end of routine - insert your code only before this line *-*
*
ENDFORM.


Der "Prüfen"-Kommentar lautet:
E:Feld "RESULT" unbekannt. Es ist weder in einer der angegebenen Tabellen enthalten noch durch eine "DATA"-Anweisung definiert.

Ich denke es ist nur noch eine kleine Korrektur notwendig - wäre schön wenn Du auch diese noch heraustüffteln könntest. Jedoch schon an dieser Stelle ein herzliches Dankeschön!!!

gruss
oliver

Answer:
- NOTE FROM A MODERATOR -

This is a english speaking board, so everybody should stick to english and be aware that I delete postings that are not written in this language (or at least in an approaching idiom )

I let this one going on in german just because I though the initial problem was to understand a standard message that was only written in German... and because I didn't read the whole discussion...

Ch
Copyright ?2007 - 2008 www.jt77.com