09-26-2008 9:55 AM
Hello Experts,
I want to uplaod data from excel .I want to put validation that If the name1 already exists in database table LFA1, then that particular record in which that name exists will be fetched in one error internal table.
I want to match full name,irrespective of case.
Suppose We are again uploading Ran Avtar or ram avtar, this record get appended in error internal table
Is any function module exists for this.
or suggest me some other solution.
Aastha
09-26-2008 10:08 AM
LOOP AT it_file INTO wa_file.
SELECT SINGLE name1 FROM lfa1 INTO w_name WHERE lifnr = wa_file-lifnr.
IF sy-subrc EQ 0.
CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
EXPORTING
i_input = wa_file-name1
i_langu = 'E'
IMPORTING
e_output = wa_file-name1.
CALL FUNCTION 'AIPC_CONVERT_TO_UPPERCASE'
EXPORTING
i_input = w_name
i_langu = 'E'
IMPORTING
e_output = w_name.
IF wa_file-name1 EQ w_name.
wa_error-lifnr = wa_file-lifnr.
wa_error-name1 = wa_file-name1.
APPEND wa_error TO it_error.
ELSE.
* Your action
ENDIF.
ELSE.
wa_error-lifnr = wa_file-lifnr.
wa_error-name1 = wa_file-name1.
APPEND wa_error TO it_error.
ENDIF.
ENDLOOP.
Regards,
Valter Oliveira.