Application Development 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: 

Function module to get the details from table COEP

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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

uwe_schieferstein
Active Contributor
0 Kudos

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

0 Kudos

hi all

Thank You for your replys.

problem solved.

Message was edited by:

CS Reddy

0 Kudos

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

0 Kudos

This message was moderated.