Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding ADDR_INSERT function module

Former Member
0 Likes
3,576

Hi Experts.

When i am trying to create a address using the function module ADDR_INSERT , i am unable to understand the parametes

ADDRESS_HANDLE . I am pasting my code below. Can u tell me how can i give the input ADDRESS_HANDLE and ADDRESS NUMBER once it has been created successfully.

DATA: GV_ADDRESS_DATA LIKE ADDR1_DATA,

GT_ADDR_ERROR LIKE ADDR_ERROR OCCURS 0 WITH HEADER LINE,

GT_ADDR1_DATA LIKE ADDR1_DATA OCCURS 0 WITH HEADER LINE,

RETURNCODE LIKE SZAD_FIELD-RETURNCODE OCCURS 0 WITH HEADER LINE,

LV_MSG(60) TYPE C.

START-OF-SELECTION.

GV_ADDRESS_DATA-CITY1 = 'HORIZON VIEW EXT.4'.

GV_ADDRESS_DATA-POST_CODE1 = '2134'.

GV_ADDRESS_DATA-STREET = 'Ontdekkers road'.

GV_ADDRESS_DATA-HOUSE_NUM1 = '23'.

GV_ADDRESS_DATA-COUNTRY = 'ZA'.

GV_ADDRESS_DATA-REGION = 'GP'.

CALL FUNCTION 'ADDR_INSERT'

EXPORTING

ADDRESS_DATA = GV_ADDRESS_DATA

ADDRESS_GROUP = 'ES01'

ADDRESS_HANDLE =

  • DATE_FROM = '00010101'

LANGUAGE = SY-LANGU

CHECK_EMPTY_ADDRESS = 'X'

CHECK_ADDRESS = ' '

IMPORTING

ADDRESS_DATA = GT_ADDR1_DATA

RETURNCODE = RETURNCODE

TABLES

ERROR_TABLE = GT_ADDR_ERROR.

  • 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.

ELSE.

COMMIT WORK.

ENDIF.

Regards,

suresh

5 REPLIES 5
Read only

former_member404244
Active Contributor
0 Likes
1,910

Hi,

Check the include MM06EFAD_ADDRESS_PREPARE, and line number and line No-91.

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,910

Hi,

Some standard programs use '0001'.

You can use a counter for that.

Also, you can use this BAPI: BAPI_ADDRESSORG_CHANGE

Regards,

Read only

0 Likes
1,910

got resolved on my own.

Thanx guys

Read only

0 Likes
1,910

Hi ,

I have the same issue. can you please let me know what was the solution. ? I am not able to create entry in ADRC table using FM 'ADDR_INSERT'.

Thanks

Arvind

Read only

0 Likes
1,910

You could call function module ADDR_MAINTAIN_COMPLETE, using updateflag = 'I'. The ADRNR is in the return structure ADDR1_COMPLETE_OUT.