12-10-2008 5:53 AM
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
12-10-2008 6:25 AM
hello baljit ..You will get the postal code lenghts for vairous countires in config table T005.
Hope this helps .
Sampada
12-10-2008 6:03 AM
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.
12-10-2008 6:09 AM
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?
12-10-2008 6:16 AM
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'
12-10-2008 6:25 AM
hello baljit ..You will get the postal code lenghts for vairous countires in config table T005.
Hope this helps .
Sampada