cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate new address number using ADDR_NUMBER_GET

Former Member
0 Kudos

Can you please help me in finding the import parameters for the FM 'ADDR_NUMBER_GET'.

The addres handle which is supposed to be a temporary key is throwing an error

INVALID ADDRESS HANDLE. wat sort of data shud be passed to this address handle

Anil

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Solution:

CONCATENATE sy-sysid sy-mandt sy-uname gv_handle INTO gv_handle.

   CALL FUNCTION 'ADDR_INSERT'

     EXPORTING

       address_data              = gs_addr_data

       address_group             = 'ZANP'

       address_handle            = gv_handle

*     DATE_FROM                 = '00010101'

*     LANGUAGE                  = SY-LANGU

      check_empty_address       = ' '

*     CHECK_ADDRESS             = 'X'

    IMPORTING

      address_data              = gs_addr_data

      returncode                = gv_rc

*   TABLES

*     ERROR_TABLE               =

    EXCEPTIONS

      address_exists            = 1

      parameter_error           = 2

      internal_error            = 3

      OTHERS                    = 4

             .

   IF sy-subrc <> 0.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

   gs_ref-addr_group = 'ZANP'.

   gs_ref-appl_table = 'ADRC'.

   gs_ref-appl_field = 'ADDRNUMBER'.

   CALL FUNCTION 'ADDR_NUMBER_GET'

     EXPORTING

     address_handle                   = gv_handle

     address_reference                = gs_ref

*   PERSONAL_ADDRESS                 = ' '

*   NUMBERRANGE_NUMBER               = '01'

*   E071K_WA                         =

*   GENERATE_TRANSPORT_ENTRIES       =

*   OWNER                            = 'X'

*   TABLE_NAME                       =

*   FIELD_NAME                       =

*   OBJKEY                           =

  IMPORTING

    address_number                   = p_addr

*   RETURNCODE_NUMBERRANGE           =

* TABLES

*   E071K_TAB                        =

  EXCEPTIONS

    address_handle_not_exist         = 1

    internal_error                   = 2

    parameter_error                  = 3

    OTHERS                           = 4

            .

   IF sy-subrc <> 0.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   ENDIF.

ADDR_GROUP must exist in TSAD7 table!!!!

Former Member
0 Kudos

Hello,

I did as you described but now I got another error in function module ADDR_INSERT. With the EXCEPTIONS interface SY-SUBRC 2 came up and internal the error had been triggered by below coding.

 

 

FUNCTION addr_aesref_get .

*"----------------------------------------------------------------------

*"*"Lokale Schnittstelle:

*"  EXPORTING

*"     VALUE(AESREF) TYPE REF TO  CL_ADDRESS_ENHANCER

*"  EXCEPTIONS

*"      AESREF_NOT_EXIST

*"----------------------------------------------------------------------



  IF NOT ( gref_address_enhancer IS INITIAL ).

    aesref = gref_address_enhancer.

  ELSE.

    MESSAGE e521 RAISING aesref_not_exist.

  ENDIF.



ENDFUNCTION.

I have no idea to handle this. I check the parameter supply of ADDR_INSERT in different places it will be used but I can not find any significant difference to my coding.

May you have an idea.

Thank you

Regards

Norbert