on 01-27-2015 9:16 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.