SAP4TECH

SAP and ABAP Free Tutorials
Menu
  • SAP Technical
    • ABAP Code Snippets
    • ABAP WebDynPro
    • SAP GW
    • SAP IDOC (ALE)
    • SAP PI (XI)
    • SAP Screen Personas
    • SAP Workflow
  • SAP Functional
    • SAP FI
    • SAP FSCM
    • SAP HR
    • SAP SD & SAP MM
    • SAP PM
    • SAP PP
    • SAP PS
    • SAP QM
    • SAP VIM
    • SAP WM
  • SAP Fiori
  • SAP HANA
  • SAP BW
  • SAP CRM
  • SAP SRM
  • SAP4TECH
    • About Us
    • Contact Us
    • Terms & Conditions
    • Privacy and Cookie Policy

SAP4TECH » Credit Limit for Customer in SAP SD

SAP SD & SAP MM

Credit Limit for Customer in SAP SD

March 31, 2016 John

Credit Limit for Customer in SAP SD post will detail all the important Data for Credit calculation for Customer in SAP SD .

It includes determination of credit control area, Calculation of Credit horizon date, and determination of Credit Exposure in SAP SD.

Table of Contents

  • Retriving Credit control area
  • Retrieving Risk Category for customer
  • SAP SD Credit Horizon Date
  • SAP SD Customer Credit Exposure
  • Credit Limit for SD Customer

Retriving Credit control area

Credit Control Area can be retrieve from the Company code.
The Value of Credit Control Area ( KKBER ) is stored in SAP Table T001-KKBER.

Here a sample ABAP Program to retrieve Credit Control Area for a SAP company code based on Sales Organisation:

ABAP
1
2
3
4
5
6
7
" SAP CUSTOMER CREDIT AREA CONTROL
SELECT SINGLE t001~kkber tvko~waers
    INTO (lv_kkber, lv_waers_comp)
    FROM tvko AS tvko
    INNER JOIN t001 AS t001
    ON tvko~bukrs = t001~bukrs
    WHERE tvko~vkorg = IV_VKORG.

Retrieving Risk Category for customer

The Risk Category classifies Customer on Credit risk exposure.
Technically it is stored in SAP Table KNKK Customer master credit management: Control area data
and the field CTLPC : Credit management: Risk category. This information is set by Risk Control Area

The field KNKK-CASHD Date of Last Payment is also a relevant field when dealing with Credit Limit.

Here a sample ABAP program code to retrieve Risk Category for SAP SD Customer:

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
" Retriving Risk Category for Customer in SAP SD
SELECT SINGLE ctlpc cashd
   INTO (lv_ctlpc, lv_cashd)
   FROM knkk
   WHERE kunnr = IV_KUNNR
     AND kkber = l_kkber.
 
" Get Currency of Risk Category
SELECT SINGLE waers
   INTO lv_waers
   FROM t014
   WHERE kkber = lv_kkber.

SAP SD Credit Horizon Date

In order to understand the calculation of SD credit Horizon Date check this OSS note 379007. This note explains the mechanism of horizon date calculation.

The SD Credit Horizon Date can be calculated with the following standard Function Module SD_CREDIT_HORIZON_DATE.

Here a sample ABAP Programs to retrieve this information:

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
13
" Calculate Credit Horizon Date ( Credit limit )
CALL FUNCTION 'SD_CREDIT_HORIZON_DATE'
          EXPORTING
            i_kkber         = lv_kkber
            i_ctlpc         = lv_ctlpc
            i_horizon_exist = 'X'
          IMPORTING
            e_horizon_date  = lv_horda.
 
" If no Credit Horizon Date found, set it to max date        
IF lv_horda IS INITIAL.
     lv_horda = '99991231'.
ENDIF.

This SCN Wiki page details the mechanism of Credit Horizon Date calculation. It is well written and step by step detailed.

SAP SD Customer Credit Exposure

SD Credit Exposure is the sum of Open Delivery, Open Invoice + Open Order.
The different values can be retrieve using the standard function module SD_CREDIT_EXPOSURE.

A sample ABAP Code to retrieve the Credit Exposure in order to calculate Credit Limit for a SAP Customer in SAP SD will be:
(check above how to retrieve Horizon Date HORDA and Credit Area Control KKBER )

ABAP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
" SD_CREDIT_EXPOSURE For SAP Customer
    CALL FUNCTION 'SD_CREDIT_EXPOSURE'
      EXPORTING
        flag_open_delivery = 'X'
        flag_open_invoice  = 'X'
        flag_open_order    = 'X'
        horizon_date       = lv_horda
        kkber              = lv_kkber
        knkli              = IV_KUNNR
      IMPORTING
        open_delivery      = lv_open_deliv
        open_invoice       = lv_open_inv
        open_order         = lv_open_ord.
  
" Credit Exposure is the sum of Open Delivery, Open Invoice + Open Order
LV_CREDIT_EXPOSURE = lv_open_deliv + lv_open_inv + lv_open_ord.

Credit Limit for SD Customer

The credit limit for SD Customer is set on SAP tcode/ Transaction FD32/FD33.
The corresponding field is KLIMK Customer’s credit limit in the table KNKK containing Customer master credit management: Control area data

The keys to retrieve Customer Credit Limit in SAP SD ( KNKK-KLIMK) are :

  • KNKK-KUNNR : Customer Number
  • KNKK-KKBER : Credit control area
Prev Article
Next Article
Tags:ABAP Sample Customer in SAP SAP Tables SAP Transaction Codes

Related Articles

SAP SD
Explicit PO Number: This post will explain how to create …

Create SAP PO with Explicit PO Number

SAP SD
List of Important SAP SD Tables (Sales and Distribution). In …

List of Important SAP SD Tables (Sales and Distribution)

Search on SAP4TECH

The Most Populars

  • The Most Important SAP ISU Tables
    The Most Important SAP ISU Tables
  • SAP Users Tables
    SAP Users Tables (for Personal, Logon, and Address Data)
  • List of SAP Purchase Order Tables in SAP MM SAP PO Tables
    SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • Full list of SAP Movement Types
    SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP GL Account Tcodes SAP GL Account Tables
    The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables
    SAP BOM Tables for BOM Header, Items and components and Category

Related Posts

  • ABAP Shared Memory
    What the different Types of Tables in SAP ? (Transparent, Pool and Cluster)
  • Convert String to Number and Quantity in ABAP
    Different Methods to Convert String to Integer, Quantity, Currency in SAP ABAP
  • ABAP Workbench
    SAP Refresh Buffer – All the Tcodes to refresh Buffer in SAP
  • sai kiran anagani 61187 unsplash 1
    HTML Template in ABAP
  • SAP Material
    Trigger MATMAS IDoc using BTE event

SAP4TECH

SAP and ABAP Free Tutorials

Trending Posts

  • The Most Important SAP ISU Tables
  • SAP Users Tables (for Personal, Logon, and Address Data)
  • SAP Purchase Order Tables: Main PO tables in SAP MM – SAP PO Tables
  • SAP Good Movement Types – Full list of SAP Movement Types
  • The Main SAP G/L Account Tcodes & SAP GL Account Tables
  • SAP BOM Tables for BOM Header, Items and components and Category

The Most Recents

  • The Most Important SAP ISU Tables
  • SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd Lecture
  • The Main SAP Dunning Transaction Codes
  • SAP Accounts Payable Tcodes & Accounts Receivable Tcodes ( SAP AP Tcodes & SAP AR Tcodes)
  • The Most Important SAP Payment Terms Tables (ZTERM, Text…)

Search

SAP Tutorials by Topics

  • SAP Tables
  • SAP Tcodes
  • SAP BAPI
  • ABAP Snippets
  • Top SAP Courses
  • Top SAP Books
Copyright © 2021 SAP4TECH

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
This website uses cookies to improve your experience. We'll assume you accept this policy as long as you are using this websiteAcceptView Policy