cancel
Showing results for 
Search instead for 
Did you mean: 

Rounding off Debit/Credit amount on payments using FPE1

prince_isaac
Active Participant
0 Kudos

hie guys

i would like to round of on the total Dr/Cr amount as seen on transaction FPE1. i have implemented three user exits namely

 FKYA001X, FKYA002X FKYA003X 

but none of them seems to be triggered when user presses enter. I had just inserted break-points in them but none was fired. How then can i round off on that value each time the user enters another line item?

regards

Isaac Prince

Accepted Solutions (0)

Answers (2)

Answers (2)

prince_isaac
Active Participant
0 Kudos

Hie guys

I have managed to resolve that issue.

regrads

Isaac Prince

prince_isaac
Active Participant
0 Kudos

Hie

Forgot to close the thread.

Former Member
0 Kudos

Hello Prince,

Just check whether this exits are activated or not.

In case they are activated then you have to find some other Userxit or badi.

Steps to find User Exit.

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utillities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

OR GOTO smod -> click F4-> click Information System -> enter the package-> and press enter.

It will display all the userexit related to the tcode.

Hope this helps you. in case of any problem please revert back.

Cheers,

Suvendu

prince_isaac
Active Participant
0 Kudos

Hie guys

I have managed to locate where the screen field for totals is being pupulated and i have managed to impliment an enhacement point and carried out the rounding logic as per my requirement also i managed to populate correctly the field however, before the value is shown on screen the value reverts back before it was rounded off. I have tried to trace it through debug but i have not yet found it. I implimented enhancement spot in include

 LFKPPFS0 

the fields for totals are

 RFPE1-SUMMS_NEU & RFPE1-SUMMH_NEU 

. The code for the enhancement spot is


ENHANCEMENT 1  Z_ROUND_OFF_TOTALS.    "active version

DATA: v_result like RFPE1-SUMMS,
      x_result(20).


DATA: v_num_char(20) TYPE c,
v_deci(10) TYPE c,
v_fact(2) TYPE c,
x_fact(1).


v_num_char = RFPE1-SUMMS.

CONDENSE: v_num_char.
SPLIT v_num_char AT '.' INTO: v_deci v_fact.
x_fact = v_fact+1(1).

CONDENSE: v_deci, v_fact.

*round values down
IF x_fact EQ '1' OR x_fact EQ '2'.
  CONCATENATE v_deci '.' v_fact(1) INTO x_result.
*round values down to the nearest 5 cents
ELSEIF x_fact EQ '6' OR x_fact EQ '7'.
  CONCATENATE v_deci '.' v_fact(1) '5' INTO x_result.
*round values up, if v_fact eq 9 add one to v_deci
ELSEIF x_fact EQ '3' OR x_fact EQ '4'.
  IF v_fact(1) = '9'.
    v_deci = v_deci + 1.
    CONCATENATE v_deci '.' v_fact(1) INTO x_result.
  ELSE.
*otherwise round values up to the nearest 5 cents
    CONCATENATE v_deci '.' v_fact(1) '5' INTO x_result.
  ENDIF.
*round values up, if v_fact eq 9 add one to v_deci
ELSEIF  x_fact EQ '8' OR x_fact EQ '9'.
  IF v_fact(1) EQ '9'.
    v_deci = v_deci + 1.
    CONCATENATE v_deci '.' INTO x_result.
  ELSE.
*add one to v_fact to round off to the next higher number
*as a multiple of 5 cents
    v_fact(1) = v_fact(1) + 1.
    CONCATENATE v_deci '.' v_fact(1) '5' INTO x_result.
  ENDIF.
ENDIF.

CONDENSE x_result.
v_result = x_result.

RFPE1-SUMMS = v_result.

ENDENHANCEMENT.

but the value in RFPE1-SUMMS is shown as desired on screen but as the value before the rounding off. Would anyone be aware the processing of the program where my value is overwritten back to the value before rounding off??

regards

Isaac Prince