Skip to Content
author's profile photo
Former Member

ABAP problem with characteristic and start routine

Dear all,

I need to transfer attribute to characteristic. So I read several threats and created start routine for filling values into internal table and characteristics routine for reading master data from internal table and filling infoobject with attribute value

InfoObject = 0CRM_PROD, attribute = 0CRM_PREF

I'm new to ABAP, please help me

Start routine code has no syntax errors:

===============

TYPES:

BEGIN OF lt_prod,

CRM_PROD TYPE /BI0/PCRM_PROD,

CRM_PRREF TYPE /BI0/PCRM_PROD,

END OF lt_prod.

DATA:

t_prod TYPE HASHED TABLE OF lt_prod

WITH UNIQUE KEY CRM_PROD.

DATA:

fl_prod type lt_prod.

select CRM_PROD

CRM_PRREF

from /BI0/PCRM_PROD

into table t_prod

for all entries in SOURCE_PACKAGE

where CRM_PROD = SOURCE_PACKAGE-CRM_PROD

and objvers = 'A'.

===============

Characteristic routine code has error "Field "FL_PROD" is unknown"

===============

clear fl_prod.

READ TABLE t_prod INTO fl_prod

WITH TABLE KEY CRM_PROD = SOURCE_FIELDS-CRM_PROD.

RESULT = fl_prod-CRM_PREF.

===============

Please help me, where is a mistake? Why internal table fl_prod declared in start routine is not available in characteristic routine?

Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on May 05, 2011 at 01:01 PM

    Hi oleg,

    maybe you have to insert all declarations into global declaration (in the first part of start routine). If you insert them in global declaration, you can use fl_prod in characteristic routine code and end routine too.

    Hope it helps.

    Regards.

    Simone.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Solved

      It works, the code is following:

      Start routine:

      ===================

      select CRM_PROD

      CRM_PRREF

      from /BI0/PCRM_PROD

      into table t_prod

      for all entries in SOURCE_PACKAGE

      where CRM_PROD = SOURCE_PACKAGE-CRM_PROD

      and objvers = 'A'.

      ===================

      Characteristic routine:

      ===================

      clear fl_prod.

      READ TABLE t_prod INTO fl_prod

      WITH TABLE KEY CRM_PROD = SOURCE_FIELDS-CRM_PROD.

      RESULT = fl_prod-CRM_PRREF.

      ===================

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 01:15 PM

    Start routine code has no syntax errors:

    ===============

    TYPES:

    BEGIN OF lt_prod,

    CRM_PROD TYPE /BIC/OI0CRM_PROD,

    CRM_PRREF TYPE /BIC/OI0CRM_PREF,

    END OF lt_prod.

    DATA: t_prod TYPE Standard TABLE OF lt_prod,

    fl_prod type lt_prod.

    select CRM_PROD

    CRM_PRREF

    from /BI0/PCRM_PROD

    into table t_prod

    for all entries in SOURCE_PACKAGE

    where CRM_PROD = SOURCE_PACKAGE-CRM_PROD

    and objvers = 'A'.

    ===============

    Characteristic routine code has error "Field "FL_PROD" is unknown"

    ===============

    clear fl_prod.

    READ TABLE t_prod INTO fl_prod

    WITH KEY CRM_PROD = SOURCE_FIELDS-CRM_PROD.

    RESULT = fl_prod-CRM_PREF.

    Please use the above code

    regards,

    Arvind.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      While defining the structure for internal table the fields can be defined as:

      table-field,

      Info object structure.

      /BIC/OI0CRM_PREF

      /BIC/OI0CRM_PROD both these objects are database structures for 0CRM_PREF or 0CRM_PROD.

      you can write the same code as

      /BI0/PCRM_PROD-0CRM_PROD

      /BI0/PCRM_PROD-0CRM_PREF

      Try the code, it won't throw error, debug to see if it returns the desired result.

      regards,

      Arvind.

  • author's profile photo
    Former Member
    Posted on May 05, 2011 at 05:11 PM

    answered

    Add comment
    10|10000 characters needed characters exceeded