In my previous post, I documented the way to fulfill bank account relation information by leveraging the standard extension: <Flow Builder Plus: extend standard logic for fetching bank account | SAP Blogs>

 

In this post, I will use the standard extension point to support the case that Downpayment Request was cleared by the downpayment.

 

By default, Flow Builder Plus supports only the clearing relationship between documents, including practical clearing cases. All those clearing relationship are located on document line item level, means, the specified document line item is cleared or not.

 

However, the clearing between downpayment request and downpayment request is something different because it is on document level:

  • Downpayment item are not selectable for clearing;
  • Downpayment request have been cleared;

 

To achieve so, you need create a BAdI implementation for BAdI IF_FQM_FLOW_ENHANCEMENTS_CORE, for its method ADJUST_FLOWS.

 

The following sample codes shows the way to support one of the clearing down payment request:

 

class ZFQM_BADI_ADJUSTFLOW_DOWNPAYMENT definition
  public
  final
  create public .

public section.

  interfaces IF_BADI_INTERFACE .
  interfaces IF_FQM_FLOW_ENHANCEMENTS_CORE .
protected section.
private section.
ENDCLASS.



CLASS ZFQM_BADI_ADJUSTFLOW_DOWNPAYMENT IMPLEMENTATION.


  METHOD if_fqm_flow_enhancements_core~adjust_flows.
  " ----------------------------------------------------------------------
  " This sample code only covers the following scenario:
  " - Down payment request cleared
  "   Same Vendor
  "   Invoice item item with Special G/L indicator: 'A'
  "   Down payment request item with Special G/L indicator: 'F'
  "   Down payment request item are cleared by the invoice document
  "
  " ----------------------------------------------------------------------
    SELECT a~fi_document_number, a~fi_fiscal_year, a~company_code, a~fi_account, a~line_number
      FROM @ct_flows AS a
        INNER JOIN bseg AS b
          ON a~fi_document_number = b~belnr
          AND a~fi_fiscal_year = b~gjahr
          AND a~company_code = b~bukrs
          AND a~fi_document_line_item = b~buzei
        WHERE a~certainty_level = 'PAY_N' AND a~origin_application = 'BSEGV'
          AND b~koart = 'K'
          AND b~umskz = 'A'
        INTO TABLE @DATA(lt_invoice_flows).
    IF lt_invoice_flows IS NOT INITIAL.
        SELECT a~line_number
          FROM @lt_invoice_flows AS a
            INNER JOIN bseg AS b
              ON  a~fi_document_number = b~augbl
                AND a~fi_fiscal_year = b~auggj
                AND a~company_code = b~bukrs
                AND a~fi_account = b~hkont
             WHERE b~koart = 'K' AND b~umskz = 'F'
         INTO TABLE @DATA(lt_line_number).

        IF lt_line_number IS NOT INITIAL.
          LOOP AT ct_flows INTO DATA(ls_flow).
            READ TABLE lt_line_number TRANSPORTING NO FIELDS
              WITH KEY line_number = ls_flow-line_number.
            IF sy-subrc EQ 0.
              DELETE ct_flows.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
  ENDMETHOD.
ENDCLASS.
Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x