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: 

Default values during device replacement

marcin_cholewczuk
Active Contributor
0 Kudos
3,091

Hello all,

I would like to set default values when I execute device replacment. I've found user exit EDMDI001 (FM EXIT_SAPLE30D_001). Inside I'm able to set default values when I do device instalation, but not for replacement.

What I'm aming for is that during device replacement when I go to worklist (F9) and then when I go from menu to tarifdata so that I could fill tarifart then I would like to set default values in devicefields for new device.

When I try to do so in mentioned exit then on first screen I'm getting an error, that I've set field that should'nt be filled


xy_disp_input-tarifartgo = xy_disp_input-tarifartg = 'Tarifart-AAA'.
xy_disp_input-kondigrg = 'DEV'.
xy_disp_input-gverrechg0 = xy_disp_input-gverrechg = 'X'.

Any ideas?

Best regards

Marcin Cholewczuk

2 REPLIES 2

Former Member
0 Kudos
2,532

Hi Marcin,

I hope you have considered x_action parameter while you are assigning default values. Please note, following are possible values for x_action:

01 Full Installation

02 Full Removal

03 Replacement

04 Billing-Related Installation

05 Billing-Related Removal

06 Technical Installation

07 Technical Removal

08 Reversal of technical installation

09 Reversal of installation relevant to all data

10 Reversal of technical replacement

11 Reversal of technical installation, removal, replacement

Please include your code in if condition, may be your logic will work.

Regards,

Avinash

0 Kudos
2,532

Hi Avinash,

Yes I did, take that into consideration. My code looks like this


  IF x_action = '03'.
    xy_disp_input-tarifartgo = xy_disp_input-tarifartg = 'QWERT'.
    xy_disp_input-kondigrg = 'ABC'.
    xy_disp_input-gverrechg0 = 'X'.
    xy_disp_input-preisklag = 'PREIS'.
  ENDIF.

It works when I'm doing instalation, but not for replace. I'm getting an error that I've filled fields that should be left empty. I've looked in SAP code and found FM ISU_O_METER_REPLACE_INPUT that is called from module 'check_input'. Inside it form 'check_input_allowed' is executed and inside of it there is this code


WHEN co_install.
      IF NOT input-verbgl    IS INITIAL
      OR NOT input-verlos    IS INITIAL.
        error_flag = co_flag_marked.
      ENDIF.
.....
WHEN co_replace.
      IF NOT input-trenr     IS INITIAL
         ....
         OR NOT input-tarifartg IS INITIAL
         OR NOT input-preisklag IS INITIAL
         .....
              error_flag = co_flag_marked.
      ENDIF.

I can delete setting this 'tarifartg' and 'preisklag' fields from my code, but then nothing happens. Values that I want to set are taken from device that I'm uninstaling.

Here are steps that I take to do all operation.

1. I'm going to EG30 and filling all data http://pokazywarka.pl/1mei1l/

2. On next screen I'm filling reason for replacement and go worklist (F9) http://pokazywarka.pl/hsep93/

If I'm trying to change those fields that SAP forbid to change (as I explaind above) here I'm getting an error.

3. I'm going to tarif data http://pokazywarka.pl/zpz5ok/

4. Here I would like to set these fields in red rectangle http://pokazywarka.pl/bb93z3/

I would be grateful for any tips.

Best regards

Marcin Cholewczuk

EDIT:

In the end I've changed variable 'local' that is visible on level above user exit. Not the best solution, but it works.