Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Validate Input in SAP CRM

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

method DO_VALIDATE_INPUT. CALL METHOD SUPER->DO_VALIDATE_INPUT EXPORTING global_messages = global_messages .

DATA: lr_entity TYPE REF TO cl_crm_bol_entity, lr_prop TYPE REF TO if_bol_bo_property_access, lv_zzafld000011 TYPE string, lv_zzafld000012 TYPE string, lv_oriid TYPE ZTCRM_DEST-ORIID, lv_destid TYPE ZTCRM_DEST-ORIID, lt_dest TYPE TABLE OF ZTCRM_DEST, ls_dest TYPE ZTCRM_DEST, lv_msgv1 TYPE SYMSGV, lr_msg_srv TYPE REF TO cl_bsp_wd_message_service, lv_number TYPE i. * add message to the message container lr_msg_srv = cl_bsp_wd_message_service=>get_instance( ). ** ** DATA: l7_msg_service TYPE REF TO cl_bsp_wd_message_service, ** lvsp_msg_v1 TYPE string VALUE 'Spare in Progress'. ** SELECT * INTO TABLE lt_dest FROM ZTCRM_DEST.

TRY . lr_entity ?= me->typed_context->zatab00001z->collection_wrapper->get_first( ). WHILE lr_entity IS BOUND. CLEAR: lv_zzafld000011,lv_zzafld000012, lv_oriid, ls_dest,lv_msgv1 . lv_zzafld000011 = lr_entity->get_property_as_string( 'ZZAFLD000011' ). lv_oriid = lv_zzafld000011. READ TABLE lt_dest INTO ls_dest WITH KEY oriid = lv_oriid. IF sy-subrc NE 0. lv_msgv1 = lv_oriid. lr_msg_srv->add_message( iv_msg_type = 'E' iv_msg_id = 'ZCRM_AVIMSG' iv_msg_number = '002' iv_msg_v1 = lv_msgv1 ). * CL_ADJREQ_UI_TOOLS=>set_message( iv_msg_id = 'ZCRM_AVIMSG' * iv_msg_number = '000' * iv_msg_v1 = lv_msgv1 ). lr_entity->deactivate_sending( ). RETURN. ENDIF. lv_zzafld000012 = lr_entity->get_property_as_string( 'ZZAFLD000012' ). lv_destid = lv_zzafld000012. CLEAR: ls_dest. READ TABLE lt_dest INTO ls_dest WITH KEY oriid = lv_destid. IF sy-subrc NE 0. lv_msgv1 = lv_destid. lr_msg_srv->add_message( iv_msg_type = 'E' iv_msg_id = 'ZCRM_AVIMSG' iv_msg_number = '003' iv_msg_v1 = lv_msgv1 ).

lr_entity->deactivate_sending( ). RETURN. ENDIF. lr_entity ?= me->typed_context->zatab00001z->collection_wrapper->get_next( ). ENDWHILE. CATCH cx_sy_move_cast_error cx_sy_ref_is_initial. ENDTRY. endmethod.a

You might also like