Skip to Content
avatar image
Former Member

How to use BAPI_LOAN_CONTRACT_CREATE

I am currently trying to use the bapi 'BAPI_LOAN_CONTRACT_CREATE'.

I get an error "Error in numbering" (ID 67, Number 015, Parameter LOAN) "

-1 E 67 015 Fehler bei der Nummernvergabe 000000 LOAN 0

What I am doing wrong? How can I specify the Master_No on creation?

My code:

DATA: ls_loan TYPE bapiloan_create,
      ls_conditionheader TYPE bapicondhead_create,
      lt_partner TYPE TABLE OF bapirel_bpobj,
      lt_conditions TYPE TABLE OF bapicondition_create,
      lt_return TYPE TABLE OF bapiret2,
      ls_user TYPE BAPILOAN_USERFIELDS.


DATA: ls_partner LIKE LINE OF lt_partner,
      ls_condition LIKE LINE OF lt_conditions.


DATA: ls_loannumber LIKE bapiloan_get-contract_no.


"APPEND ls_condition TO lt_conditions.


"RANLSTAMNR / master_no


ls_loan-comp_code = '0020'. "Buchungskreis
ls_loan-status = 10.
ls_loan-prod_type = 'HYP'. "Produktart HYP/HYM
ls_loan-currency = 'EUR'.
ls_loan-currency_iso = 'EUR'.
"ls_loan-FIN_PROJ = 1000000113.
"ls_loan-contract_no = 100000011301. "Externe Nummernvergabe?


ls_conditionheader-condition_valid_from = sy-datum.
ls_conditionheader-comm_cap = '0.01'.
ls_conditionheader-currency = 'EUR'.
ls_conditionheader-currency_iso = 'EUR'.


ls_partner-partner = 1000030986.
"ls_partner-comp_code = '0020'.
ls_partner-role_type = 'TR0100'. "
ls_partner-role_sbtyp = 'DN1'. "
ls_partner-object_no = 1000000113.
APPEND ls_partner TO lt_partner.


CALL FUNCTION 'BAPI_LOAN_CONTRACT_CREATE'
  EXPORTING
    loan             = ls_loan    " Anlage Darlehensvertragsdaten
    conditionheader  = ls_conditionheader    " Anlage Konditionskopfdaten
*   correspondence   =     " Anlage Korrespondenzdaten
    userfields       = ls_user    " Benutzerfelder
    testrun          = abap_false   " Umschalten auf Simulations-Modus bei schreibenden BAPIs
*   refresh          = SPACE    " Auffrischen d. globalen Einstellungen bei schreibenden BAPIs
*   processextension = SPACE    " Kundenerweiterungen ausführen
*   steering         =     " Steuerparameter der Bapi Vertragsanlage
*   avoid_inner_join = SPACE    " Steuerparameter der Bapi Vertragsanlage
*   calln_appln      = 'INT' " Calling Application
*   link_dd2sf       =     " Calling Application
  IMPORTING
    loannumber       = ls_loannumber    " Vertragsnummer
*   error            =     " Fehlerkennzeichen bei BAPIs
  TABLES
    partner          = lt_partner    " Zuordnung Partner zum Vertrag
    conditions       = lt_conditions    " Anlage Konditionspositionen
*   formula          =     " Anlage Konditionendetails
*   objects          =     " Anlage Objektbeziehungsdaten
*   collaterals      =     " Anlage Sicherheitenbeziehungsdaten
*   encumbrances     =     " Darlehen: Grundpfandrecht - Anlegen
*   clerks           =     " Anlage Sachbearbeiterbeziehungsdaten
*   extension_in     =     " Bezugsstruktur für BAPI-Parameter ExtensionIn / ExtensionOut
    return           = lt_return    " Rückmeldungen der Ergebnisse
*   subfacility      =     " Rückmeldungen der Ergebnisse
*   subfacs_return   =      " Rückmeldungen der Ergebnisse
  .


WRITE sy-subrc.
WRITE ls_loannumber.


EXIT.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    May 15, 2017 at 07:42 AM

    Solution was:

    Remove all Number Componets in Customizing.

    Add comment
    10|10000 characters needed characters exceeded

  • May 10, 2017 at 12:24 PM

    Hi,

    This message has a long text with additional information:

    An error has occurred during number assignment. The number range object does not exist for this application.

    Kind regards, Rob Dielemans

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thank you, the question is which number range object needs to be created. I have got a number range '11' which is used when I create objects/loans via FNO1/FNI1.

      Debugging to the Function Call of NUMBER_GET_NEXT ends up with an number range id 'VD' for the Object FVVD_KOBJ (which is fine) and the FVVD_RANL but with an empty range id. So it is impossible to set it.

      Using a defined contract_no gives the error that the external numbering is not enabled for product type "hyp". Enabling it in Customizing for range id 11 is not possible.

  • May 10, 2017 at 12:03 PM
    -1

    Hi.

    Have you read the documentation ?

    Rich

    Add comment
    10|10000 characters needed characters exceeded