RE:[sap-log-sd] Credit Customer Blocked

Posted by srikant (SAP SD Senior Cnsultant)
on Aug 4 at 5:37 AM
Hi Tung Ho

As per your request below is the code for the credit check
* DATA : lc_cramt LIKE knkk-klimk.
* DATA : lc_amt LIKE knkk-klimk.
* LOOP AT int_accept WHERE shopcode(1) = 'S'
** AND ( orderno(1) = 'S' OR orderno(1) = 'G' ) "*00-048-A
* AND ( delorderno(2) = 'SS' OR delorderno(1) = 'G' )
* AND matnr(1) <> 'A'.
* MOVE-CORRESPONDING int_accept TO int_accept1.
* COLLECT int_accept1.
* ENDLOOP.
* CLEAR int_errtab.
* LOOP AT int_accept1.
* CLEAR knkk.
* SELECT SINGLE * FROM knkk WHERE kunnr = int_accept1-shopcode
* AND kkber = p_kkber.
* IF sy-subrc = 0.
*
* CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
* EXPORTING
* date = sy-datum
* foreign_amount = int_accept1-price
* foreign_currency = 'SGD'
* local_currency = 'USD'
* rate = 0
* type_of_rate = 'M'
* IMPORTING
* local_amount = lc_amt
* EXCEPTIONS
* no_rate_found = 1
* overflow = 2
* no_factors_found = 3
* no_spread_found = 4
* derived_2_times = 5
* OTHERS = 6.
*
** lc_cramt = knkk-skfor + int_accept1-price.
* lc_cramt = knkk-skfor + lc_amt.
* IF lc_cramt > knkk-klimk.
* MOVE : int_accept1-delorderno TO int_errtab-delorderno,
** int_accept1-maktx to int_errtab-maktx,
** int_accept1-matnr to int_errtab-matnr,
* int_accept1-shopcode TO int_errtab-shopcode,
* int_accept1-custcomp TO int_errtab-custcomp,
** int_accept1-qty to int_errtab-qty,
* int_accept1-price TO int_errtab-price,
* 'Credit Limit Exceeds'(031) TO int_errtab-text.
** '2' to int_errtab-rec_type.
* APPEND int_errtab.
* ENDIF.

We use the customised transaction to create sales order

Thanks
srikant

---------------Original Message---------------
From: Tung Ho
Sent: Wednesday, August 03, 2011 1:03 PM
Subject: Credit Customer Blocked

Can you send your auto create code?

__.____._
Copyright © 2011 Toolbox.com and message author.

Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
Mark as helpful
View this online
  
srikant
SAP Logistics Sales and Distribution Enthusiast

Contributed 100 posts in a group to earn a Bronze Achievement
Popular White Papers

In the Spotlight
Share Knowledge About SAP Scripting. Join the Discussion Group
_.____.__