Application Development 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: 

Post Code formatting for BAPI_BUPA_CREATE_FROM_DATA

Former Member
0 Kudos

Hello Friends,

I have made a program which uses the bapi BAPI_BUPA_CREATE_FROM_DATA to create a business partner. The program reads data from a file and creates a BP from this data. My problem is that the post code isn't always in the correct format, (when creating a BP through the Bapi, the bapi returns an error on the length of the post code) and the only way to format it, is in the program. i.e a norwegian post code 0435 might look like this 00435. And for other countries theres different lengths.. does anybody know where I can get the required length of the post code, so I can make this completely dynamic?

best regards Ballo

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hello baljit ..You will get the postal code lenghts for vairous countires in config table T005.

Hope this helps .

Sampada

4 REPLIES 4

Former Member
0 Kudos

data:tp type BAPIBUS1006_ADDRESS.

loop at gt_record into gs_record.

move gs_record-CITY1 to tp-CITY.

move gs_record-POST_CODE1 to tp-POSTL_COD1.

move gs_record-STREET to tp-STREET.

move gs_record-house_num1 to tp-HOUSE_NO.

move gs_record-COUNTRY to tp-COUNTRY.

move gs_record-REGION to tp-REGION.

CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'

EXPORTING

PARTNERCATEGORY = GC_TYPE_ORGAN

CENTRALDATA = v_test

ADDRESSDATA = tp

IMPORTING

BUSINESSPARTNER = V_parnum.

Commit work.

endloop.

0 Kudos

I get the BAPI to work, thats not the problem, the problem is the data I send in. the file I read from gets data from an old system which has additional fields in the post code, which creates problems. I have to format the post code to the correct format before sending it through the bapi. Any idea how to check the correct format for each country?

Former Member
0 Kudos

u can pass postcode to this format wa_addressdata-postl_cod1 = '82822'.

Addressdata

wa_addressdata-standardaddress = 'x'.

wa_addressdata-city = 'munich'.

wa_addressdata-postl_cod1 = '82822'.

wa_addressdata-countryiso = 'DE'.

wa_addressdata-street = 'exStreet'.

wa_addressdata-house_no = '123'.

wa_addressdata-langu = 'DE'

Former Member
0 Kudos

hello baljit ..You will get the postal code lenghts for vairous countires in config table T005.

Hope this helps .

Sampada