‎2006 Apr 25 2:32 AM
Hello experts,
I am having a problem with my function module below. What I want to do is to convert the werks found in my itab to their respective bukrs and put it in a range so I may later use them in my select statement. My code below does not run I dont know why. Help would be greatly appreciated. Thanks a lot and have a nice day!
LOOP AT it_equz.
CALL FUNCTION 'CF_TA_T001W_READ'
EXPORTING
t001w_exp = gv_bukrs
IMPORTING
werks_imp = it_equz-iwerk
EXCEPTIONS
not_found_werks = 1.
r_iwerk-sign = 'I'.
r_iwerk-option = 'EQ'.
r_iwerk-low = gv_bukrs.
APPEND r_iwerk.
CLEAR r_iwerk.
ENDLOOP.
‎2006 Apr 25 2:51 AM
hi viraylab,
r u trying to export gv_bukrs and get the plant value? looks like what you need and what you are trying is totally different.
Why dont you use normal select statements to achieve the same. I think there is a table which holds the relation between werks and bukrs.
I think in your code you are passing bukrs value to get plant value?
Regards
VJ
‎2006 Apr 25 2:51 AM
hi viraylab,
r u trying to export gv_bukrs and get the plant value? looks like what you need and what you are trying is totally different.
Why dont you use normal select statements to achieve the same. I think there is a table which holds the relation between werks and bukrs.
I think in your code you are passing bukrs value to get plant value?
Regards
VJ
‎2006 Apr 25 2:53 AM
Hi Vijayendra,
I solved my prblem. I instead used FM HRCA_PLANT_GET_COMPANYCODE and it worked fine. However, is there a way to just select all the distinct records in a particular field in an itab since I do not need duplicates.
‎2006 Apr 25 2:56 AM
Hi Viraylab,
You can select distinct fields from the database directly. I would prefer using delete adjacent duplicates after sorting the table. This makes it even faster.
Again it depends on which table you are using to select data from.
Cheers
VJ