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

How to Validate Customer Data

Former Member
0 Likes
714

Hi,

I will get a Customer Record from an Application server.

I have a requirement to Validate Complete customer data before create a customer(First I want to Confirm whether the Provided data is valid, If the errors are there i need to show else i need to show Success message to go ahead and Create).

Is there any option to validate the data using XD01 or

to Validate using Call Transaction Method and Transaction Roll Back? Please give me possible ways..

Thanks,

Sekhar.J

Hi,

I will get a Customer Record from an Application server.

I have a requirement to Validate Complete customer data before create a customer(First I want to Confirm whether the Provided data is valid, If the errors are there i need to show else i need to show Success message to go ahead and Create).

Is there any option to validate the data using XD01 or

to Validate using Call Transaction Method and Transaction Roll Back? Please give me possible ways..

Thanks,

Sekhar.J

2 REPLIES 2
Read only

Former Member
0 Likes
553

First of all use OPEN/READ/CLOSE DATASET to read the information from application server into an internal table.

Now you can make do your validation to check that all the necessary/mandatory fields ahve been provided by the file.

Next, you can also check if the customerwith those detauils is aready available in system, make use of BAPI_CUSTOMER_GETDETAIL1

Now,again to validate you can make use of BAPI_CUSTOMER_CREATEFROMDATA1 you will find a return parameters.

Call this BAPI, and loop on the returns parameters for "A" and 'E' (Abort/Error). If there are any errors then write these details to your summary error table.

If no errros have been returned then you can make use of BAPI_TRANSACTION_COMMIT to create the custoer in system.

If error have been returned then make use of BAPI_TRANSACTION_ROLLBACK

Hope this helps.

Read only

Former Member
0 Likes
553

HI Sekhar ,

U can create the customer using BDC call transaction , because in BDC , data is automaticaly validated.

Thanks

Shambhu