View previous topic :: View next topic
Author
Message
admin Администратор Joined: 01 Sep 2007 Posts: 1640
Posted: Sat Oct 13, 2007 1:35 pm Post subject: Validate Customer number
The following simple report demonstrates the code used to validate a customer number.
Code: *&---------------------------------------------------------------------*
*& Report ZVALCUSTOMER *
*& *
*&---------------------------------------------------------------------*
*& Validate customer number *
*& *
*&---------------------------------------------------------------------*
REPORT ZVALCUSTOMER .
PARAMETERS: p_bukrs LIKE knb1-bukrs,
p_kunnr like knb1-kunnr.
DATA: it_debi TYPE STANDARD TABLE OF vf_debi INITIAL SIZE 0,
wa_debi TYPE vf_debi.
************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'FI_CUSTOMER_DATA'
EXPORTING
i_bukrs = p_bukrs
i_kunnr = p_kunnr
IMPORTING
e_debi = wa_debi
EXCEPTIONS
customer_missing = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE 'I'
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
CALL FUNCTION 'FI_ACCOUNT_CHECK'
EXPORTING
* I_AWTYP = ' '
i_account = wa_debi-kunnr
* I_RECACCOUNT = ' '
i_bukrs = wa_debi-bukrs
i_koart = 'D'
* I_TCODE = ' '
* I_WAERS = ' '
* X_DIALOG = ' '
* I_XNORECCHECK = ' '
EXCEPTIONS
ACCOUNT_LOCKED = 1
CURRENCY = 2
NO_RECONCILIATION_ACCOUNT = 3
RECONCILIATION_ACCOUNT = 4
RECONCILIATION_ACCOUNT_LOCKED = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE 'I'
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
IF NOT wa_debi-knrze IS INITIAL.
CALL FUNCTION 'FI_ACCOUNT_CHECK'
EXPORTING
* I_AWTYP = ' '
i_account = wa_debi-knrze
* I_RECACCOUNT = ' '
i_bukrs = wa_debi-bukrs
i_koart = 'D'
* I_TCODE = ' '
* I_WAERS = ' '
* X_DIALOG = ' '
* I_XNORECCHECK = ' '
EXCEPTIONS
ACCOUNT_LOCKED = 1
CURRENCY = 2
NO_RECONCILIATION_ACCOUNT = 3
RECONCILIATION_ACCOUNT = 4
RECONCILIATION_ACCOUNT_LOCKED = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid
TYPE 'I'
NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
ENDIF.
ENDIF.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.