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: 

CMD_EI_API modify to accept wrong address in customer creation

Former Member
0 Kudos
851

Hi,

I am using CMD_EI_API->MAINTAIN_BAPI to create customer master. I have a requirement, that during customer creation the check if postal code exists for a country, should be overwritten in case of an error. The standard customer creation works similarly, so a popup is displayed, that the postal code does not belong to the country, but the address can be created nevertheless. Using the BAPI does not allow this, so customer cannot be created in this case.

My only idea now is to copy the whole class with the methods to a z-class and modify the method adresses_complete where the check is happening. If you have any other idea, what can be done, please share.

Thanks,

Tim

1 ACCEPTED SOLUTION

Former Member
0 Kudos
194

The Function module ADDR_SUPPRESS_POSTALCODE_CHECK just returns parameter  SUPPRESS_POSTALCODE_CHECK but I do not see that it would suppress the CAM validation though

5 REPLIES 5

Private_Member_7726
Active Contributor
0 Kudos
194

Hi,

I'd be looking to extend, if necessary, the postal code check logic (which is not in CMD_EI_API, I believe). Do you have a message class and number for the error message?

Also, I have never tried it, but could it be that FM ADDR_SUPPRESS_POSTALCODE_CHECK suppresses the entire CAM (Central Address Management) postal code validation logic?

cheers

Janis

Message was edited by: Jānis B

0 Kudos
194

Hi,

thanks for your comments. Message class R5, number 510.

I will check the FM ADDR_SUPPRESS_POSTALCODE_CHECK , sounds promising. Any other idea is appreciated.

Thanks,

Tim

0 Kudos
194

Hi again,

there is actually another FM ADDR_ACCEPT_REG_DATA_ERROR which is called in the CMD_EI_API->ADDRESSES_COMPLETE which suppresses the error message when I set the flag in the debugger. But I don't know how to make use of this when executing my code.

Thanks for any help.

Tim

Former Member
0 Kudos
195

The Function module ADDR_SUPPRESS_POSTALCODE_CHECK just returns parameter  SUPPRESS_POSTALCODE_CHECK but I do not see that it would suppress the CAM validation though

0 Kudos
194

Ok, in that case (a regional data error), using ADDR_ACCEPT_REG_DATA_ERROR and ADDR_SET_DIALOG_FOR_REG_DATA seem to be a better choice.

I'd try to set up the flags prior to MAINTAIN_BAPI call - dialog = off, accept errors = on.

There does appear to be a way to control the CVI behaviour as described in 1399414 - Address checks acceptance during synchronization (via controlling CVI_API message 026 in transaction OBA5), but... if I had to write my own 'consistent' logic on top of CMD_EI_API, I'd try to control the flags directly, rather than relay on some 'obscure' (though rather more flexible, down even to individual users) customization.


cheers

Janis


Edit in: ADDR_SUPPRESS_POSTALCODE_CHECK should work, I believe, according to the same principle: pass in SUPPRESS_POSTALCODE_CHECK = 'X', prior to the API call. The only obvious argument against using these FMs IMO is: they do not appear to be 'released' to customers or 'properly' documented (or I'm unable to quickly find the documentation...). But that applies to ADDR_ACCEPT_REG_DATA_ERROR and ADDR_SET_DIALOG_FOR_REG_DATA as well - other than being mentioned in OSS Notes, I don't see SAP documenting their use for customers.

Message was edited by: Jānis B