SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Saving a editted BBP

Former Member
0 Kudos
288

Hello experts,

I'am working for a dutch utilities company.

They asked me to change an entry on a budget billing plan (just one).

Well I've made the following code:

  • Get BBP's for CR

SELECT eabpvertrag eabpopbel

FROM eabp

INNER JOIN dfkkmop ON eabpopbel = dfkkmopopbel

INTO TABLE IT_BBP

WHERE eabp~vkonto IN s_vkont

AND eabp~aedat EQ p_cdate

AND eabp~aenam EQ p_user

AND dfkkmop~solldat EQ p_date.

SORT it_bbp BY vertrag opbel.

DELETE ADJACENT DUPLICATES FROM it_bbp COMPARING vertrag opbel.

DESCRIBE TABLE it_bbp LINES lv_sel.

CLEAR: lv_bedrag, lv_success, lv_error, wa_bbp.

LOOP AT it_bbp INTO wa_bbp.

CLEAR: lv_date, lv_month, wa_obj.

REFRESH: it_obj, it_obj2, it_success, it_error.

  • Get previous date for bbp (place in lv_date)

lv_month = p_date+4(2) - 1.

CONCATENATE '0' lv_month INTO lv_month.

CONCATENATE p_date(4)

lv_month

p_date+6(2)

INTO lv_date.

  • Get bbp for date 15-05-2007

CALL FUNCTION 'ISU_O_BUDBILPLAN_OPEN'

EXPORTING

x_vertrag = wa_bbp-vertrag

x_opbel = wa_bbp-opbel

x_edatum = lv_date

x_wmode = co_display

  • X_UPD_ONLINE =

  • X_NO_DIALOG =

  • X_AUTO =

  • X_NO_CHANGE =

  • X_NO_OTHER =

  • X_VORAUSZDAT = '00000000'

  • X_EP_PERIOD =

  • X_LOG_OBJECT =

IMPORTING

y_obj = wa_obj2

  • Y_AUTO =

EXCEPTIONS

not_found = 1

existing = 2

foreign_lock = 3

invalid_key = 4

number_error = 5

system_error = 6

internal_error = 7

not_created_noduedate = 8

billing_error = 9

not_authorized = 10

OTHERS = 11.

IF sy-subrc <> 0.

CONCATENATE wa_bbp-vertrag wa_bbp-opbel

sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

INTO it_error-msg

SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

APPEND it_error.

CONTINUE.

ENDIF.

  • selecteer alle posities voor de eerste datum voor 15-06-2007 en

  • sommeer betrw, dit is je cumulatieve vorige bedrag

CALL FUNCTION 'ISU_BBP_GET_CURRENT_AMOUNT'

EXPORTING

x_opbel = wa_bbp-opbel

x_vertrag = wa_bbp-vertrag

x_datum = lv_date

x_obj = wa_obj2

IMPORTING

  • X_ACT_BETRW =

x_act_kumbetrw = lv_bedrag.

  • Get bbp for date 15-05-2007

CALL FUNCTION 'ISU_O_BUDBILPLAN_OPEN'

EXPORTING

x_vertrag = wa_bbp-vertrag

x_opbel = wa_bbp-opbel

x_edatum = p_date

x_wmode = co_change

x_upd_online = 'X'

  • X_NO_DIALOG =

  • X_AUTO =

  • X_NO_CHANGE =

  • X_NO_OTHER =

  • X_VORAUSZDAT = '00000000'

  • X_EP_PERIOD =

  • X_LOG_OBJECT =

IMPORTING

y_obj = wa_obj

  • Y_AUTO =

EXCEPTIONS

not_found = 1

existing = 2

foreign_lock = 3

invalid_key = 4

number_error = 5

system_error = 6

internal_error = 7

not_created_noduedate = 8

billing_error = 9

not_authorized = 10

OTHERS = 11.

IF sy-subrc <> 0.

CONCATENATE wa_bbp-vertrag wa_bbp-opbel

sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

INTO it_error-msg

SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

APPEND it_error.

CONTINUE.

ENDIF.

  • Change value for bbp with solldat p_date (15-06-2007)

CALL FUNCTION 'ISU_BBP_CHANGE_CUM_AMOUNT'

EXPORTING

x_abanpdatum = p_date

x_kumamount = lv_bedrag

CHANGING

xy_obj = wa_obj

EXCEPTIONS

no_valid_date = 1

OTHERS = 2.

IF sy-subrc <> 0.

CONCATENATE wa_bbp-vertrag wa_bbp-opbel

sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

INTO it_error-msg

SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

APPEND it_error.

CONTINUE.

ENDIF.

IF p_test NE 'X'.

  • Update the database

CALL FUNCTION 'ISU_BBP_UPDATE_CHANGE'

  • EXPORTING

  • NO_REPRINT =

  • X_MASS = ' '

  • X_UPD_TASK = ' '

CHANGING

xy_obj = wa_obj

EXCEPTIONS

update_incomplete = 1

OTHERS = 2.

IF sy-subrc <> 0.

CONCATENATE wa_bbp-vertrag wa_bbp-opbel

sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4

INTO it_error-msg

SEPARATED BY cl_abap_char_utilities=>horizontal_tab.

APPEND it_error.

CONTINUE.

ENDIF.

ENDIF.

It went through correctly but it didn't write anyting into ISU. EABP and DFKKMOP are unchanged.

How do I save wa_obj into ISU?

kind regards,

Wim

3 REPLIES 3

Former Member
0 Kudos
223

Hi:

Try to commit it locally.

Regards

Shashi

Former Member
0 Kudos
223

I've decided to do it another way. This issue is not answered but also not usefull anymore.

Closed.

kind regards,

Wim

0 Kudos
223

Hi Wim,

I have some similar requirement but in my case i need to change the budget bill dates (SOLLDAT) field.

Could you suggest me the way you solved the previous issues.

It will be of great help.

Thanks.

Kapil