Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read charcteristics attribute Values

Former Member
0 Likes
619

Hi,

I have to read Master Data Attribute Value throught this Function Module RSAU_READ_MASTER_DATA

Hier are the facts:

In my Transformation (DSO ----> Cube) I have mapping 0FUNCT_LOC---->0FUNCT_LOC.

In 0FUNCT_LOC, there exist an Attribute: 0PLANPLANT

Now, i want to read values of this Attribute and then filter on it. My goal ist to have Data on 0PLANPLANT Field in Cube.

I need your help on ABAP Coding; i am new on this technology

Hier ist my ABAP Coding using the function module RSAU_READ_MASTER_DATA.


DATA: FUNCT_LOC,
     PLANPLANT TYPE RSGENERAL-CHAVL.

     PLANPLANT = <SOURCE_FIELDS>-0PLANPLANT.
     " in an update rule, for instance

     CALL FUNCTION 'RSAU_READ_MASTER_DATA'
         EXPORTING
           I_IOBJNM                      = '0FUNCT_LOC'
           I_CHAVL                       = FUNCT_LOC
*   I_T_CHAVL                     =
*   I_DATE                        =
*   I_FLG_WHOLE_TABLE             =
           I_ATTRNM                      = '0PLANPLANT'
       IMPORTING
*   E_STRUCTURE                   =
*   E_TABLE                       =
           E_ATTRVAL                     = PLANPLANT
         EXCEPTIONS
           READ_ERROR                    = 1
           NO_SUCH_ATTRIBUTE             = 2
           WRONG_IMPORT_PARAMETERS       = 3
           CHAVL_NOT_FOUND               = 4
           OTHERS                        = 5.

     CASE SY-SUBRC.
       WHEN 0.

         LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

           IF ( <SOURCE_FIELDS>-PLANPLANT NE '55'
           AND <SOURCE_FIELDS>-PLANPLANT NE '56'
           AND <SOURCE_FIELDS>-PLANPLANT NE '57'
           AND <SOURCE_FIELDS>-PLANPLANT NE '58'
           AND <SOURCE_FIELDS>-PLANPLANT NE '59'
           AND <SOURCE_FIELDS>-PLANPLANT NE '60'
           AND <SOURCE_FIELDS>-PLANPLANT NE '61').

             DELETE SOURCE_PACKAGE.

             if sy-SUBRC = 0.

               RESULT = PLANPLANT.

               RETURNCODE = 0.

             ELSE.

               RETURNCODE = 1.

             ENDIF.
           ENDIF.

         ENDLOOP.

Many Thanksfull for your help

KmerSoft


Hi,

I have to read Master Data Attribute Value throught this Function Module RSAU_READ_MASTER_DATA

Hier are the facts:

In my Transformation (DSO ----> Cube) I have mapping 0FUNCT_LOC---->0FUNCT_LOC.

In 0FUNCT_LOC, there exist an Attribute: 0PLANPLANT

Now, i want to read values of this Attribute and then filter on it. My goal ist to have Data on 0PLANPLANT Field in Cube.

I need your help on ABAP Coding; i am new on this technology

Hier ist my ABAP Coding using the function module RSAU_READ_MASTER_DATA.


DATA: FUNCT_LOC,
     PLANPLANT TYPE RSGENERAL-CHAVL.

     PLANPLANT = <SOURCE_FIELDS>-0PLANPLANT.
     " in an update rule, for instance

     CALL FUNCTION 'RSAU_READ_MASTER_DATA'
         EXPORTING
           I_IOBJNM                      = '0FUNCT_LOC'
           I_CHAVL                       = FUNCT_LOC
*   I_T_CHAVL                     =
*   I_DATE                        =
*   I_FLG_WHOLE_TABLE             =
           I_ATTRNM                      = '0PLANPLANT'
       IMPORTING
*   E_STRUCTURE                   =
*   E_TABLE                       =
           E_ATTRVAL                     = PLANPLANT
         EXCEPTIONS
           READ_ERROR                    = 1
           NO_SUCH_ATTRIBUTE             = 2
           WRONG_IMPORT_PARAMETERS       = 3
           CHAVL_NOT_FOUND               = 4
           OTHERS                        = 5.

     CASE SY-SUBRC.
       WHEN 0.

         LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

           IF ( <SOURCE_FIELDS>-PLANPLANT NE '55'
           AND <SOURCE_FIELDS>-PLANPLANT NE '56'
           AND <SOURCE_FIELDS>-PLANPLANT NE '57'
           AND <SOURCE_FIELDS>-PLANPLANT NE '58'
           AND <SOURCE_FIELDS>-PLANPLANT NE '59'
           AND <SOURCE_FIELDS>-PLANPLANT NE '60'
           AND <SOURCE_FIELDS>-PLANPLANT NE '61').

             DELETE SOURCE_PACKAGE.

             if sy-SUBRC = 0.

               RESULT = PLANPLANT.

               RETURNCODE = 0.

             ELSE.

               RETURNCODE = 1.

             ENDIF.
           ENDIF.

         ENDLOOP.

Many Thanksfull for your help

KmerSoft


1 REPLY 1
Read only

Former Member
0 Likes
493

Check your code as like below. The FM is reading the Characteristic value of the Info object If possible take the ABAPer's help to find the issue.

call function 'RSAU_READ_MASTER_DATA'
               exporting
                 i_iobjnm  = '0VENDOR'
                 i_chavl   = <l_s_range>-low
                 i_attrnm  = '0DBGUDUNS'
               importing
                 e_attrval = l_s_range-low
               exceptions
                 others    = 1.

Thanks,

Kiran.