cancel
Showing results for 
Search instead for 
Did you mean: 

CCM - Settlement document with negative and positive values

dalmocosta1
Discoverer
0 Kudos
515

 

Hello,

I have a condition contract with various items, and a few have only returns, resulting in negative values in the generated settlement. Consequently, the document contains both negative and positive values. I have already set "6 - Change document type always" on document type 0S12 under "Handle negative amount." However, this only changes if the entire document is negative.

What we need is for the document to be split into two documents: one debit and one credit (0S12 and 0S16).

This is necessary because we send this document to e-billing, and the government validates the file, which cannot contain any negative values.

I have also tried the following:

WLFA > Settlement management > Condition Contract Management > Condition Contract Settlement > Define and Configure Profiles for Business Volume Determination > Split criteria.

I added the field SHKZG target ITEMCAT, but it did not perform the split.

Does anyone know how to achieve this split?

Best regards.

View Entire Topic
dalmocosta1
Discoverer
0 Kudos

hello yes i did!  there is two alternatives  alternative 1 - i didnt test this one Settlement Management   -> Condition Contract Management ->  Condition Contract Settlement -> Define and Configure Profiles for Business Volume Determination Move the value into an existing header field which you don’t use, e.g. WBRK-KIDNO. Alternatively create a new Z-field. Use the SHKZG to head.  And i did not know this at the time and the alternative that i did was ABAP.  I did it via enhancement WB2_CC_SETTL_CHANGE_FINALLY, I did the code below, if you need it. Code used:     READ TABLE ct_komzrke INTO ls_komzrke INDEX 1.     IF ls_komzrke-lfart = '0S12'.       LOOP AT ct_komzrpe INTO ls_komzrpe.         lv_oldnr = ls_komzrpe-oldnr.         IF ls_komzrpe-itemcat = 1.           ls_komzrpe-oldnr = ls_komzrpe-oldnr + 1.           MODIFY ct_komzrpe FROM ls_komzrpe INDEX sy-tabix.           LOOP AT ct_komlfkoec INTO ls_komlfkoec                                WHERE oldpo = ls_komzrpe-oldpo.             ls_komlfkoec-oldnr = ls_komzrpe-oldnr.             MODIFY ct_komlfkoec FROM ls_komlfkoec INDEX sy-tabix.           ENDLOOP.           READ TABLE ct_komzrke INTO ls_komzrke                                 WITH KEY oldnr = ls_komzrpe-oldnr.           IF sy-subrc <> 0.             READ TABLE ct_komzrke INTO ls_komzrke                         WITH KEY oldnr = lv_oldnr.             ls_komzrke-oldnr = ls_komzrpe-oldnr.             APPEND ls_komzrke TO ct_komzrke.           ENDIF.         ENDIF.       ENDLOOP.     ENDIF.