on 07-30-2014 12:05 PM
Hello,
in my Gateway service, I have a function import CheckLeaveRequest which, among others, has the input parameter StartDate of type Edm.DateTime:
The service was generated when we were still on GW 2.0 SP6. Back then, everything worked fine when calling the function import
...CheckLeaveRequest?StartDate=datetime%272014-07-31T00%3A00%3A00.000%27&...
Later, we updated to SP7. By then, the function import was still working correctly as long as the service was no regenerated!
However, if the service is generated now, the function import does not work anymore, because the date and time input parameters are not getting converted! The input of method EXECUTE_ACTION now looks like this:
Before, in line 2 the value was already in internal ABAP format: 20140731.
Things I already tried that didn't help:
What is the trick to make the Gateway Framework convert my request parameters again?
Thanks,
Björn
Hello,
To get Date in ' YYYYMMDD ' format in the DPC class , please do the following.
1.Make date property Nullable as shown in screen shot.
2.Go to the ABAP Type Editor as shown in the screen shot and use Internal Type as DATE.
3.Do not change the EDM Core type which is Edm.DateTime. Let it be the same.
4.Regenerate RunTime Objects.
5.Clear /iwfnd/cache_cleanup , /iwbep/cache_cleanup & smicm cache.
With this u will get Date as expected YYYYMMDD format in DPC.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very strange:
If I look into the coding generated by SP6, it says
lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'StartDate' iv_abap_fieldname = 'StartDate' ).
lo_parameter->bind_data_element( 'BEGDA' ).
Code generated by SP8:
lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'StartDate' iv_abap_fieldname = 'StartDate' ). "#EC NOTEXT
lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_datetime( ).
If I manually add the line
lo_parameter->bind_data_element( 'BEGDA' ).
to the generated code, the input value does get converted!
Update:
I have found the corresponding SAP Note, which introduced this behaviour: 1818545
It says for program /IWBEP/I_SBMC_MPC_GEN_NEW
Delete block
@if new_actions-params-abaptype
@notinitial lo_parameter->bind_data_element( '$new_actions-params-abaptype$' )."#EC NOTEXT
@else
Unfortunately, I haven't found any followup note where this "correction" has been reverted". I guess I have to create a new OSS message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do not access the IT_PARAMETER directly.
Try using IO_TECH_REQUEST_CONTEXT->GET_PARAMETERS( ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.