Application Development and Automation 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: 
Read only

settlement rules for WBS element

Former Member
0 Likes
2,713

Hi,

I have a requirement to create WBS with settlement rules. Is there an FM or BAPI to call to create the settlement rule?

Thanks.

Lalyn

Hi,

I have a requirement to create WBS with settlement rules. Is there an FM or BAPI to call to create the settlement rule?

Thanks.

Lalyn

4 REPLIES 4
Read only

Former Member
0 Likes
1,441

Hi

1. Maintain a Settlement profile where Cost Center is Valid Receiver object

2. Maintain the node 'Determine Strategy for Settlement Rule' . In the setting mention the required strategy, settlement profile created above and account assignment category as '2'/'3' - Your case.

3. Assign the Strategy Sequence 'SAP030' or 'SAP040' in your case on the settlement parameters of the WBS.

4. Execute T code CJB2/CJB1

BAPI_BUS2054_CREATE_MULTI

Also go through the link given below :

http://help.sap.com/saphelp_46c/helpdata/en/51/5829c0a44c11d189bf0000e829fbbd/frameset.htm

/thread/437678 [original link is broken]

With Regards

Nikunj Shah

Read only

Former Member
0 Likes
1,441

Hi Lalyn,

refer to the link for BAPI's:

http://www.sapbapi.com/bapi-list/

BAPI_CC1_DNLOAD_WBSELEMENT HR-PDC

Download Work Breakdown Structure Element

refer to the link for FM's:

http://www.erpgenie.com/abap/functions.htm

With luck,

Pritam.

Read only

Former Member
0 Likes
1,441

hi

good

types: begin of ty_objnr,

objnr like prps-objnr,

end of ty_objnr.

*.COBRA-Buffer (see FM KOBS)

types: begin of ty_cobra_buf.

include structure cobra.

types: uflag like dkobr-upd_flag,

end of ty_cobra_buf.

types: ty_t_cobra_buf type ty_cobra_buf occurs 10.

*.COBRB-Puffer mit Änderungsflag (see FM KOBS)

types: begin of ty_cobrb_buf.

include structure cobrb.

types: uflag like dkobr-upd_flag,

end of ty_cobrb_buf.

types: ty_t_cobrb_buf type ty_cobrb_buf occurs 10.

***********************************************************************

  • Internal tables *

***********************************************************************

data: it_abrechnug type standard table of ty_abrechnung,

it_objnr type standard table of ty_objnr,

it_cobra like table of cobra with header line,

it_cobrb like table of cobrb with header line.

***********************************************************************

  • Data *

***********************************************************************

data: wa_cobra_buf type ty_t_cobra_buf,

wa_cobrb_buf type ty_t_cobrb_buf,

wa_objnr like line of it_objnr,

wa_urzuo like cobrb-urzuo,

l_mem_cobrb like wa_cobrb_buf[],

l_mem_cobra like wa_cobra_buf[],

l_mem_cobrb_zeile like line of l_mem_cobrb,

l_mem_cobra_zeile like line of l_mem_cobra.

form urzuo_aendern using p_objnr p_pspnr p_urzuo.

data: c_objnr like prps-objnr,

c_pspnr like prps-pspnr,

c_urzuo like cobrb-urzuo.

c_objnr = p_objnr.

c_pspnr = p_pspnr.

c_urzuo = p_urzuo.

refresh: it_objnr,

it_cobra,

it_cobrb,

l_mem_cobra,

l_mem_cobrb.

wa_objnr = c_objnr.

append wa_objnr to it_objnr.

  • Reas settlement rule from the DM

call function 'K_SRULE_PRE_READ'

exporting

i_pflege = ' '

tables

t_sender_objnr = it_objnr

  • T_COBRA =

exceptions

wrong_parameters = 1

others = 2.

if sy-subrc 0.

perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

  • Fill internal buffer with settlement rules

call function 'K_SETTLEMENT_RULE_GET'

exporting

objnr = c_objnr

x_all = ' '

tables

e_cobra = it_cobra

e_cobrb = it_cobrb

exceptions

not_found = 1

others = 2.

if sy-subrc 0.

perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

  • Save settlement rule in ABAP-Memory

call function 'K_SRULE_EXPORT_IMPORT'

exporting

i_mode = 'EX'

exceptions

wrong_mode = 1

others = 2.

if sy-subrc 0.

perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

  • Read ABAP-Memory

import l_mem_cobra l_mem_cobrb from memory id 'K_SRULE'.

  • Change field URZUO and set Update-Flag

loop at l_mem_cobrb into l_mem_cobrb_zeile where urzuo is initial.

l_mem_cobrb_zeile-urzuo = p_urzuo.

l_mem_cobrb_zeile-uflag = 'U'. "Update Kennzeichen

modify l_mem_cobrb from l_mem_cobrb_zeile transporting urzuo uflag.

endloop.

  • Clear internal buffer

call function 'K_SETTLEMENT_RULE_REFRESH'

exporting

objnr = c_objnr.

  • Fill ABAP-Memory with new rules

export l_mem_cobra l_mem_cobrb to memory id 'K_SRULE'.

  • Fill internal buffer with new rules

call function 'K_SRULE_EXPORT_IMPORT'

exporting

i_mode = 'IM'

exceptions

wrong_mode = 1

others = 2.

if sy-subrc 0.

perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

  • SAve new rules

call function 'K_SETTLEMENT_RULE_SAVE'

exporting

dialog = 'X'

objnr = c_objnr

i_status_update = ' '

exceptions

no_rule_for_objnr = 1

others = 2.

if sy-subrc 0.

perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

commit work.

perform erfolg using c_pspnr.

endform. " URZUO_AENDERN

Thanks

mrutyun^

Read only

Former Member
0 Likes
1,441

Hi Gurus,

I am loading the REAl ESTATE data through LSMW-BAPI.

I need to load the settlement reciever as WBS elements.

While loading the data i am getting the error

WBS element does not exist even though it is existing in the client and master table as well.

KIndly let me know what can be done regarding this??