cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax check field routine and "naming"

Former Member
0 Kudos

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.

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi

Use the same time variable and pass it /BIC/TZORG_ABC to get the value.

SELECT SINGLE /BIC/ZORG_ABC "enthält die Buchstaben-Kolonne

       FROM /BIC/TZORG_ABC

       INTO RESULT

       WHERE /BIC/ZORG_ABC EQ VAR_TXTSH

AND DATETO EQ SOURCE_FIELDS-DATETO.

Regards

Murthy

Answers (0)