06-26-2007 6:57 AM
hi all,
I have to select the data from COEP table based on OBJNR.i don't have any other key information.so i have to select the data based on OBJNR only.
can any one please tell me is there any function to get the data from this table.
Thanks.
06-26-2007 7:04 AM
Hi
Try the fun module
K_CO_OBJECT_BALANCE_GET
see the sample select statement for COEP
clear cobrb_tab.
refresh cobrb_tab.
select objnr " Object No
rec_objnr1 " Ref Object No
bureg " Dostribution Rule
lfdnr " Sequence No
perbz " Settlement Rule
konty " Acct Assign Category
bukrs " Company Code
kostl " Cost Center
into table cobrb_tab
from cobrb
where kostl in rn_kostl.
sort cobrb_tab by objnr rec_objnr1.
delete adjacent duplicates from cobrb_tab comparing objnr.
Get the Settlement Costs from COEP Table
clear it_set_tab.
refresh it_set_tab.
if not cobrb_tab[] is initial.
select kokrs " Controlling Area
belnr " Acc Document
buzei " Line Item
perio " Period Block
wkgbtr " Value in CO Curr
lednr " Ledger No
objnr " Object No
gjahr " Fiscal Year
wrttp " Actuals
versn " Version
kstar " Cost Element
beknz " Dr/Cr Indicator
parob1 " Partner Object
into table it_set_tab
from coep
for all entries in cobrb_tab
where lednr = c_lednr and
wrttp = c_wrttp2 and
versn = c_versn and
gjahr = p_gjahr and
objnr = cobrb_tab-objnr and
parob1 = cobrb_tab-rec_objnr1 and
beknz in (c_o, c_a).
endif.
Reward points for useful Answers
Regards
Anji
06-26-2007 7:08 AM
Hello Reddy
There are several function modules available that have the COEP within their names: However, I am not sure if these function modules are the right ones.
I think that the methods of class <b>CL_REEX_COEP</b> are most suitable for your purposes. For example, using the static method <b>GET_LIST_BY_OBJNR</b> returns all COEP entries for a given OBJNR.
Regards
Uwe
06-26-2007 7:24 AM
hi all
Thank You for your replys.
problem solved.
Message was edited by:
CS Reddy
06-26-2007 7:48 AM
Hello Reddy
When calling methods always use the <b>pattern</b> button (Option <i>Pattern for ABAP Objects</i>).
REPORT zus_sdn_read_coep.
DATA:
gt_list TYPE re_t_coep.
PARAMETERS:
p_kokrs TYPE kokrs,
p_objnr TYPE j_objnr.
START-OF-SELECTION.
CALL METHOD cl_reex_coep=>get_list_by_objnr
EXPORTING
id_kokrs = p_kokrs
id_objnr = p_objnr
* IF_BYPASSING_BUFFER =
* IF_RESET_BUFFER =
* ID_MAX_BUFFER_SIZE = 1000
IMPORTING
et_list = gt_list.
END-OF-SELECTION.
Regards
Uwe
07-06-2011 11:14 AM