Domanda

We are creating customers on SAP CRM and replicate these customers to SAP ECC. User needs to filter postal codes by the district code they choose while creating customer. This functionality has provided by SAP ECC. But in CRM we couldnt find any relation between postal codes and district codes. How can we filter postal codes by district codes in SAP CRM?

È stato utile?

Soluzione

Take a look at get_v_postl_cod1 method of ZL_ICCMP_BP_BUPAADDRSTD_CN00 class, this is the getter method for post codes in account overview. Inside you'll find something like this:

country_id  = get_s_struct( attribute_path = 'STRUCT.COUNTRY'
                      component      = 'COUNTRY'
                      iterator       = iterator ).

...
...
...

SELECT * FROM  adrpstcode INTO TABLE lt_adrpost_code
WHERE country = country_id.

You can fetch region value in the same way as country value and modify select query to include your region data. These tables should provide with all required data: ADRPSTCODE, ADRCITY, ADRCITYT, ADRPCDCITY, ADRPOBOX, ADRCITYPRT, ADRSTREET, ADRSTREETT, and ADRSTRPCD.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top