on 11-22-2012 2:36 PM
Hi ABAP expert
I have developed a field routine.
I try to "cross-check" and compare the value of a text field which is in table /BI0/TORGUNIT, needed field is TXTSH.
The "comparison" takes place with a key field of another characteristic, ZORG_ABC.
When doing the syntax check following message is given: Das Datenobjekt "SOURCE_FIELDS-/BI0/TORGUNIT-TXTSH" besitzt keine Komponente mit Namen "".
English: The data object "SOURCE_FIELDS-/BI0/TORGUNIT-TXTSH" doesn't have a component with naming "".
Where ist the problem in the coding below?
METHOD compute_ZORG_ABC.
* IMPORTING
* request type rsrequest
* datapackid type rsdatapid
* SOURCE_FIELDS-ORGUNIT TYPE /BI0/OIORGUNIT
* EXPORTING
* RESULT type _ty_s_TG_1-/BIC/ZORG_ABC
DATA:
MONITOR_REC TYPE rsmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.
... "to skip a record
* raise exception type CX_RSROUT_SKIP_RECORD.
... "to clear target fields
* raise exception type CX_RSROUT_SKIP_VAL.
SELECT SINGLE /BIC/ZORG_ABC "enthält die Buchstaben-Kolonne
FROM /BIC/TZORG_ABC
INTO RESULT
WHERE /BIC/ZORG_ABC EQ SOURCE_FIELDS-/BI0/TORGUNIT-TXTSH.
.
Hi
SOURCE_FIELDS-/BI0/TORGUNIT is the field that is available in the routine. No other field will be available.
If you want to compare TXTSH of ORGUNIT, you need to first select it based on SOURCE_FIELDS-/BI0/TORGUNIT from ORGUNIT P table and then pass the result in the select query.
Your code should be something like below.
DATA: VAR_TXTSH TYPE /BI0/TORGUNIT-TXTSH.
SELECT SINGLE TXTSH
FROM /BI0/TORGUNIT
INTO VAR_TXTSH
WHERE ORGUNIT EQ SOURCE_FIELDS-ORGUNIT.
SELECT SINGLE /BIC/ZORG_ABC "enthält die Buchstaben-Kolonne
FROM /BIC/TZORG_ABC
INTO RESULT
WHERE /BIC/ZORG_ABC EQ VAR_TXTSH.
Regards
Murthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Murthy
The code works, but I have also time dependency. I have added DATETO and DATEFROM into the field routine.
0ORGUNIT: This characterstic is time dependent and has additionally to be filled up by ZORG_ABC.
ZORG_ABC: This characteristic is also time-dependent.
How must I set the correct code at the second SELECT statement?
Many thanks.
METHOD compute_ZORG_ABC.
* IMPORTING
* request type rsrequest
* datapackid type rsdatapid
* SOURCE_FIELDS-ORGUNIT TYPE /BI0/OIORGUNIT
* SOURCE_FIELDS-DATETO TYPE /BI0/OIDATETO
* SOURCE_FIELDS-DATEFROM TYPE /BI0/OIDATEFROM
* EXPORTING
* RESULT type _ty_s_TG_1-/BIC/ZORG_ABC
DATA:
MONITOR_REC TYPE rsmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
* raise exception type CX_RSROUT_ABORT.
... "to skip a record
* raise exception type CX_RSROUT_SKIP_RECORD.
... "to clear target fields
* raise exception type CX_RSROUT_SKIP_VAL.
DATA: VAR_TXTSH TYPE /BI0/TORGUNIT-TXTSH.
SELECT SINGLE TXTSH
FROM /BI0/TORGUNIT
INTO VAR_TXTSH
WHERE ORGUNIT EQ SOURCE_FIELDS-ORGUNIT and DATETO EQ
SOURCE_FIELDS-DATETO.
SELECT SINGLE /BIC/ZORG_ABC "enthält die Buchstaben-Kolonne
FROM /BIC/TZORG_ABC
INTO RESULT
WHERE /BIC/ZORG_ABC EQ VAR_TXTSH.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.