Showing results for 
Search instead for 
Did you mean: 

how to validate the contents of excel file after uploading it.

Active Contributor
0 Kudos

hi Experts,

we have a requirement in which we need to create business transactions with the data in the excel file after it was uploaded. we are creating this transactions(BP,LEAD..) in webui -marketing professional role-external lists. what i have to do is, after uploading the data from excel file, i need to check for the mandatory fields in the data ,if anything is missing then i need to display the error message to the user. i am new to this webclinet frame work. please help me in achieving this functioanlity.any code snippet would be very helpful.


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Pravin,

While you upload data for ELM there are few badis those are triggered. Just out a breakpoint and see behavior in method create_

business_partners of class cl_def_im_crm_mktlist_badi ( This class is for CRM_MKTLIST_BADI ).

Here SAP also does some checks on data.

If this is triggered for you then you can perform your checks here as well by creating custom implementation of this badi.

e Regards,


Former Member
0 Kudos

Hi ,

Try with the below code.

in the upload class ihn attributes declare


level static

visibility public


in the event for upload

lo_core = cl_crm_bol_core=>get_instance( ).

go_messages = lo_core->get_global_message_cont( ).

go_messages->reset( ).

REFRESH : t_return.

create a function module to validate the mandatory fields.

loop at i_table

call a function module


In function module validate the mandatory fields if empty fill a error message and append to internal table.

loop at t_return INTO st_return WITH KEY type = 'E'.

CALL METHOD go_messages->add_message


iv_msg_type = st_return-type

iv_msg_id = st_return-id

iv_msg_number = st_return-number

iv_msg_v1 = st_return-message_v1

iv_msg_v2 = st_return-message_v2

iv_msg_v3 = st_return-message_v3

iv_msg_v4 = st_return-message_v4

iv_show_only_once = abap_true.