*Logic:

*

* One customer in order to be ready from standardsap

* to be cleared via the transaction f-32 must have

* one from 2 cases:

*

*

*   1) dont have any open item … so zero balance

*   2) have a small amount that can be tolerated form fi customizing

*

*   so…

*   if the differece of the amount from the credit debit

*   is smaller-equal from the BETRS-H we set in the system

*   and the diffrence / big amount is smaller than PROZS-H

*   in table T043T

For that reason i made this function:

1.JPG

2.JPG

3.JPG

5.JPG

TABLES: T043T.

   DATA:

         AMOUNT_DIFF TYPE BAPI3007_2AMT_DOCCUR,

         AMOUNT_PERC TYPE BAPI3007_2AMT_DOCCUR,

         LV_BETR_IND    TYPE T043TBETRS,

         LV_PROZ_IND    TYPE T043TPROZS.

   CLEAR:

         AMOUNT_DIFF, AMOUNT_PERC, LV_BETR_IND, LV_PROZ_IND.

   CLEAR:

         SUCCESS_INDICATO, T043T.

   IF PBUKRS IS INITIAL.

     RAISE BUKRS_NOT_FOUND.

   ENDIF.

   CALL FUNCTION ‘COMPANY_CODE_READ’

     EXPORTING

       I_BUKRS           = PBUKRS

     IMPORTING

       E_T043T           = T043T

     EXCEPTIONS

       COUNTRY_NOT_FOUND = 1

       NO_SUCH_CODE      = 2

       SPACE_INPUT       = 3

       WRONG_KKBER       = 4

       OTHERS            = 5.

   IF SYSUBRC <> 0.

     RAISE BUKRS_NOT_FOUND.

   ENDIF.

   CASE CRED_DEB.

     WHEN ‘H’.

       LV_BETR_IND = T043TBETRH.

       LV_PROZ_IND = T043TPROZH.

     WHEN ‘S’.

       LV_BETR_IND = T043TBETRS.

       LV_PROZ_IND = T043TPROZS.

     WHEN OTHERS.

       RAISE CRED_DEB_WRONG_VALUE.

   ENDCASE.

   AMOUNT_DIFF = BIG_AMOUNT SMALL_AMOUNT.

   AMOUNT_PERC = AMOUNT_DIFF / BIG_AMOUNT.

   AMOUNT_PERC = AMOUNT_PERC * 100.

   IF AMOUNT_DIFF <= LV_BETR_IND.

     IF AMOUNT_PERC < LV_PROZ_IND.

       SUCCESS_INDICATO = ‘X’.

     ELSE.

       SUCCESS_INDICATO = SPACE.

     ENDIF.

   ELSE.

     SUCCESS_INDICATO = SPACE.

   ENDIF.

if SUCCESS_INDICATO is ‘X’ then the customer’s open items can be cleared.


To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply