Skip to Content

Report to search Org.-Elements by attribut value

Good day

How can i find all org.-elements with a attribute value  = xxxxx?

For exemple: i am looking for all org.-elements using attribut ANR = '600341'.

Thanks for answering

Beat

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 27, 2015 at 10:29 AM

    Hi Beat,

    You can use the function module BBP_READ_ATTRIBUTES and give the user name and the attribute or list of attribute in an internal table as the exporting parameter ( iv_user and it_attr_list), you will get the value of the corresponding attribute in importing table ( et_attr and et_attr_dft).

    Now,

    You can use the case statement for the attribute id and read the vlist parameter in et_attr with value as the key.


    Please find the code snippet below :

    ***********   Pass Attribute Values   *********************

           ls_attr_list-attr_id = 'CUR'

           APPEND ls_attr_list TO lt_attr_list.

           ls_attr_list-attr_id = 'PRCAT'.

           APPEND ls_attr_list TO lt_attr_list.

           CALL FUNCTION 'BBP_READ_ATTRIBUTES'

             EXPORTING

               iv_user                 = sy-uname

               t_attr_list            = lt_attr_list

             IMPORTING

               et_attr                 = lt_attr

             EXCEPTIONS

               object_id_not_found     = 1

               no_attributes_requested = 2

               attributes_read_error   = 3.


           IF lt_attr[] IS INITIAL.

              ***Error Message*****

           ENDIF.

            SORT lt_attr BY attr_id.

           LOOP AT lt_attr INTO ls_attr

                           WHERE attr_id IS NOT INITIAL.

             CASE ls_attr-attr_id.

    ***********   Product Category   *****************

               WHEN 'PRCAT'.

                 READ TABLE ls_attr-vlist INTO ls_vlist

                               WITH KEY value = **Your Value***

                 IF sy-subrc NE 0.

                        ***Error Message*****

                     CONTINUE.

                   ENDIF.

                 ENDIF.

    ***********   Company Code Currency   *****************

               WHEN 'CUR'.

                 READ TABLE ls_attr-vlist INTO ls_vlist

                                          WITH KEY value = ***Your Value**

                 IF sy-subrc NE 0.

                 ***Error Message*****

                   CONTINUE.

                 ENDIF.

               WHEN OTHERS.

             ENDCASE.

             CLEAR ls_vlist.

           ENDLOOP.

    Please reward points, if the answer is helpful.


    Thanks & Regards,

    Aakash Awasthi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Beat Fuchs

      Hi Beat,

      I dont think so you can get the details of all the org elements with attributes and values.

      Please go through the below link

      Also you can check the table BBPD_APPL_ATL.

      Please reward points, if the answer is helpful.


      Thanks & Regards,

      Aakash Awasthi