Skip to Content
0

POSTING_INTERFACE_CLEARING - FB05, sgtxt, zuonr not transferred on cleared line item

Dec 19, 2017 at 11:33 AM

214

avatar image

Hello,

I am using POSTING_INTERFACE_CLEARING all goes great but the text and assignment in the cleared line item is coming empty for some reason. The text in the item that is not getting cleared is coming ok.

Any ideas?

Thank you,

SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

    WA_FTCLEAR-AGKOA = 'D'.

    WA_FTCLEAR-AGBUK = C_BUKRS.

    WA_FTCLEAR-XNOPS = 'X'.

    WA_FTCLEAR-XFIFO = 'X'.

    WA_FTCLEAR-AGKON = l_kunnr.

    WA_FTCLEAR-SELFD = 'BELNR'.

    WA_FTCLEAR-SELVON = INVOICE_NO.

    WA_FTCLEAR-SELBIS = INVOICE_NO.

    APPEND WA_FTCLEAR TO T_FTCLEAR.


*************************************

    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-BLDAT'.

    REPLACE ALL OCCURRENCES OF '-' in INVOICE_DATE WITH ''.

    year = INVOICE_DATE(4).

    month = INVOICE_DATE+4(2).

    day = INVOICE_DATE+6(2).

    CONCATENATE day month year INTO WA_FTPOST-FVAL SEPARATED BY '.'.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-BUDAT'.

    CONCATENATE day month year INTO WA_FTPOST-FVAL SEPARATED BY '.'.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-BUKRS'.

    WA_FTPOST-FVAL = C_BUKRS.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-XBLNR'.

    WA_FTPOST-FVAL = tmp_billing."C_XBLNR.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-BKTXT'.

    WA_FTPOST-FVAL = explanation."C_BKTXT.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-BLART'.

    WA_FTPOST-FVAL = C_BLART.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'K'.   "Header

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BKPF-WAERS'.

    WA_FTPOST-FVAL = WA_LINEITEMS-CURRENCY.

    APPEND WA_FTPOST TO T_FTPOST.





*   Line Item

    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'RF05A-NEWKO'.

    WA_FTPOST-FVAL = C_CASH.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'RF05A-NEWBS'.

    WA_FTPOST-FVAL = '40'.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BSEG-ZUONR'.

    WA_FTPOST-FVAL = JCC."C_ZUONR2.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BSEG-VALUT'.

    CONCATENATE day month year INTO WA_FTPOST-FVAL SEPARATED BY '.'.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BSEG-SGTXT'.

    WA_FTPOST-FVAL = name1.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR: WA_FTPOST.

    WA_FTPOST-STYPE = 'P'.   "Line

    WA_FTPOST-COUNT = 1.

    WA_FTPOST-FNAM = 'BSEG-WRBTR'.

    WA_FTPOST-FVAL = tmp_amnt.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR WA_FTPOST.

    WA_FTPOST-stype = 'P'.   "Line Item

    WA_FTPOST-count = 2.

    WA_FTPOST-fnam = 'RF05A-NEWBS'.

    WA_FTPOST-fval = '15'.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR WA_FTPOST.

    WA_FTPOST-stype = 'P'.   "Line Item

    WA_FTPOST-count = 2.

    WA_FTPOST-fnam = 'RF05A-NEWKO'.

    WA_FTPOST-fval = l_kunnr.

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR WA_FTPOST.

    WA_FTPOST-stype = 'P'.   "Line Item

    WA_FTPOST-count = 2.

    WA_FTPOST-fnam = 'BSEG-ZUONR'.

    WA_FTPOST-fval = JCC.   "Logistics billing document

    APPEND WA_FTPOST TO T_FTPOST.



    CLEAR WA_FTPOST.

    WA_FTPOST-stype = 'P'.   "Line Item

    WA_FTPOST-count = 2.

    WA_FTPOST-fnam = 'BSEG-SGTXT'.

    WA_FTPOST-fval = explanation."C_SGTXT2.

    APPEND WA_FTPOST TO T_FTPOST.





    CALL FUNCTION 'POSTING_INTERFACE_START'

      EXPORTING

        I_CLIENT           = SY-MANDT

        I_FUNCTION         = 'C'

        I_MODE             = 'N'

      EXCEPTIONS

        CLIENT_INCORRECT   = 1

        FUNCTION_INVALID   = 2

        GROUP_NAME_MISSING = 3

        MODE_INVALID       = 4

        UPDATE_INVALID     = 5

        OTHERS             = 6.

    IF SY-SUBRC <> 0.

      IS_ERROR = 'X'.

      MSG_ERROR = 'Error Starting'.

      EXIT.

    ENDIF.



    CALL FUNCTION 'POSTING_INTERFACE_CLEARING'

      EXPORTING

        I_AUGLV                          = 'EINGZAHL' "'UMBUCHNG'

        I_TCODE                          = 'FB05'

        I_SGFUNCT                        = 'C'

     IMPORTING

       E_MSGID                          = E_MSGID

       E_MSGNO                          = E_MSGNO

       E_MSGTY                          = E_MSGTY

       E_MSGV1                          = E_MSGV1

       E_MSGV2                          = E_MSGV2

       E_MSGV3                          = E_MSGV3

       E_MSGV4                          = E_MSGV4

       E_SUBRC                          = E_SUBRC

      TABLES

        T_BLNTAB                         = T_BLNTAB

        T_FTCLEAR                        = T_FTCLEAR

        T_FTPOST                         = T_FTPOST

        T_FTTAX                          = T_FTTAX

      EXCEPTIONS

        CLEARING_PROCEDURE_INVALID       = 1

        CLEARING_PROCEDURE_MISSING       = 2

        TABLE_T041A_EMPTY                = 3

        TRANSACTION_CODE_INVALID         = 4

        AMOUNT_FORMAT_ERROR              = 5

        TOO_MANY_LINE_ITEMS              = 6

        COMPANY_CODE_INVALID             = 7

        SCREEN_NOT_FOUND                 = 8

        NO_AUTHORIZATION                 = 9

        OTHERS                           = 10

              .
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Bastiaan Jansen Dec 20, 2017 at 08:41 AM
0

If you want the text to be copied you need to customize the "clearing rules". I suspect at the moment it's also not working for manual clearing using FB05?

Show 1 Share
10 |10000 characters needed characters left characters exceeded

What I wanted is to be able to define the text in the line item, but as I can understand this is not doable. This solution partly does what I would like to do, but is better than an empty line.

Thnak you,

0
avatar image
Former Member Dec 19, 2017 at 08:07 PM
0

Do you get any error message in IMPORTING parameters E_MSG* of POSTING_INTERFACE_CLEARING?

You can also try to debug into POSTING_INTERFACE_CLEARING to get more than one error message. There should be a READ TABLE... INDEX 1 to fill single message into IMPORTING parameters E_MSG*.

WA_FTPOST-COUNT should be continuous numbering 1,2,3 not 1,1,2

Share
10 |10000 characters needed characters left characters exceeded
Orestis Xeni Dec 20, 2017 at 07:27 AM
0

Hi, thanks for your answer but the posting is done successfully, i get the message 'Document XXXXXXXXXX is posted succesfully in Company Code XXXX', but the text on the cleared item is not transferred.

Share
10 |10000 characters needed characters left characters exceeded