Skip to Content

                                               Field Status Group Logic:

Field status group for a GL account can be found in Create/bank/interest tab of GL master FS00. Using this FSG configuration, certain fields of Accounting document or other references of GL account can be suppressed, made required entry or also optional entry.  . For accounting document, Additional account assignments can be selected for a field status group.  

If we want to write a custom program to replicate accounting document posting through FB50 then we need to use BAPI_ACC_DOCUMENT_POST.This configuration detail is required in our program as BAPI_ACC_DOCUMENT_POST by passes this configuration and doesn’t read this configuration while posting accounting document, while FB50 uses this configuration while posting an accounting document. So it’s important to read this configuration in our custom program and put this validation manually while posting accounting document using BAPI_ACC_DOCUMENT_POST. This configuration can’t be found directly in any standard table but we need to write some logic for the same. The technical logic to fetch the necessary configuration details is below:

  1. 1.Use FM FI_FIELD_SELECTION_DETERMINE to fetch the field selection pattern FAUS1 by passing BSCHL, BUKRS, SAKNR and FSTAG i.e. Field status group of GL account. Field status group(FSTAG) of a GL account can be fetched from table SKB1 by passing BUKRS and SAKNR i.e. GL account.
  2. 2. FAUS1 is a string containing dots, plus sign and dashes which indicate nothing but field status group configuration. Now we need to find the exact position for different fields.
  3. 3. We can query TMODU table to fetch MODIF( Position of configuration indicator)by passing FAUNA as SKB1-FAUS1, tabnm as BSEG, FELDNM as field name e.g. PRCTR for profit center, AUFNR for internal orders etc.
  4. 4. The position of configuration indicator on string FAUS1 is field MODIF from TMODU table.
  5. 5. a. If  position MODIF of string  FAUS1 is a dash then it’s a suppressed field.  b. If position MODIF of string  FAUS1 is a dot  then it’s an optional field. c. If  position MODIF of string  FAUS1 is a plus  then it’s a mandatory field.

Note: rt_lt_postings_temp  contains the GL Account, company code, profit center etc.

            DATA:  lv_fstag          TYPE   stag,

          lv_faus1 TYPE faus1.

SELECT modif feldn FROM tmodu INTO TABLE lt_tmodu
                 WHERE fauna EQ ‘SKB1-FAUS1’
                  AND tabnm EQ ‘BSEG’
                   AND feldn EQ ‘PRCTR’
                   AND  koart EQ ‘S’.

  LOOP AT rt_lt_postings_temp INTO w_postings.
    SELECT SINGLE fstag FROM skb1 INTO lv_fstag
                                  WHERE bukrs EQ w_postings-company
                                   AND  saknr EQ w_postings-account.
    IF sy-subrc = 0.

      CALL FUNCTION ‘FI_FIELD_SELECTION_DETERMINE’
        EXPORTING
          i_bschl     = ’70’
          i_bukrs     = w_postings-company
          i_saknr     = w_postings-account
          i_fstag     = lv_fstag
        IMPORTING
          e_faus1     = lv_faus1
        EXCEPTIONS
          customizing = 1
          OTHERS      = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      lv_account = w_postings-account.
      IF w_postings-prcent IS NOT INITIAL.
        READ TABLE lt_tmodu INTO lw_tmodu WITH KEY feldn = c_prctr.
        IF sy-subrc = 0.
          lw_tmodu-modif = lw_tmodu-modif – 1.
          IF lv_faus1+lw_tmodu-modif(1) = c_dash.
            g_fsg_flag       = c_x.
           ERROR MESSAGE”An entry in field PRCTR is not permitted for                                  account 
          ENDIF.
        ENDIF.
      ENDIF.

    ENDIF.
  

To report this post you need to login first.

1 Comment

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

Leave a Reply