on 2012 Feb 01 9:36 AM
Hi,
I am trying to retreive context attribute value with type. I have a date field I would like to retreive to check if it is equal to SY-DATUM but I cannot find a function that let me do that. I first tried to use the get_property_as_string, but the format is dd.mm.yyyy and is not compliant with SY-DATUM type.
Is there anyway to retreive values from context with original type ?
Thanks in advance for your help.
Thibault
Hi Thibault,
This code will work.
DATA: lv_valid_from TYPE bu_datfrom.
TRY.
CALL METHOD ir_paym_entity->get_property_as_value(
EXPORTING
iv_attr_name = 'ALIDFROM' "#EC NOTEXT
IMPORTING
ev_result = lv_valid_from ).
CATCH cx_crm_cic_parameter_error.
ENDTRY.
IF lv_valid_from EQ sy-datum.
ENDIF.
Regards
Leon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In web ui if u give date into date field, internally it wil not take as SY_DATUM type. so, manually u have to convert into SY-DATUM type. once try the follwing code.
DATA: lv_year(4) type n,
lv_month(2) type n,
lv_day(2) type n.
if date is not initial.
lv_year = date+6(4).
lv_month = date+0(2).
lv_day = date+3(2).
concatenate lv_year lv_month lv_day into date.
endif.
check date = sy-datum.
Regards
Prameela
Edited by: ch.prameela on Feb 1, 2012 11:04 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thibault,
Try this it will work.
**********************************************************************
DATA lv_date TYPE sy-datum. "or type dats both will work.
DATA lr_bol_col TYPE REF TO if_bol_bo_property_access.
lr_bol_col = lr_coco->typed_context->result->collection_wrapper->get_current( ).
CALL METHOD lr_bol_col->get_property_as_value
EXPORTING
iv_attr_name = 'VALIDITY_FROM '
IMPORTING
ev_result = lv_date.
**********************************************************************
Best Regards,
Vishal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the static methods of this utility class for dates- CL_CRM_UIU_BT_DATE_TOOLS .
Regards,
Nithish-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.