on 02-21-2014 8:05 PM
I have coded the changes to BADI as suggested by SAP how_to documentation..
I need some information, however.
The example data points to the MM data model and I am
wondering how to make sure I point to the FI data model, which is 0G instead of
MM and that the structure I used to return the account type and account data
was the correct one.
Is this something you can point me in the right direction
on?
I created enhancement implementation
ZMDG_BS_FI_BRF_CONTEXT_ACC of enhancement spot
USMD_SSW_SERVICE_PROCESSOR. All of the new code is in the class
ZMDG_BS_FI_BRF_CONTEXT_ACC.
As the structure for holding the change request data for FI I used:
DATA: ls_account TYPE /MDG/_SF_0G_PP_ACCOUNT.
Read_request method reads material data model
method READ_CREQUEST.
DATA: lr_model TYPE REF TO if_usmd_model_ext.
DATA: lt_sel TYPE usmd_ts_sel.
DATA: ls_sel TYPE usmd_s_sel.
DATA: lt_crequest TYPE usmd_ts_crequest.
CONSTANTS: lc_incl TYPE ddsign VALUE 'I'.
CONSTANTS: lc_equal TYPE ddoption VALUE 'EQ'.
CLEAR: es_crequest.
* Get read-only access to USMD model data
CALL METHOD cl_usmd_model_ext=>get_instance
EXPORTING
i_usmd_model = if_mdg_bs_mat_gen_c=>gc_model_mm
Have you tried to pass '0G' to the method cl_usmd_model_ext=>get_instance?
Somthing like:
CALL METHOD cl_usmd_model_ext=>get_instance
EXPORTING
i_usmd_model = '0G'
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Using the reference to '0G' definitely got access to the FI data model.
I defined the following to get the FI data.
The code finds the id for the element (lv_brf_expr_id )
but the CREATE_DATA method does not find data.
DATA: ls_account TYPE /MDG/_SF_0G_PP_ACCOUNT.
CALL METHOD read_crequest
EXPORTING
iv_cr_number = iv_cr_number
IMPORTING
es_crequest = lv_crequest.
* fill out the return table
get_element_id(
EXPORTING
iv_cr_type = lv_crequest-usmd_creq_type
iv_name = 'ACCOUNT_GROUP'
IMPORTING
ev_brf_expr_id = lv_brf_expr_id ).
ls_context-id = lv_brf_expr_id.
CREATE DATA ls_context-value TYPE USMDZ1_KTOKS.
ASSIGN ls_context-value->* TO <value>.
* <value> = ls_material-labor.
<value> = ls_account-accgrpacc.
APPEND ls_context TO et_rule_context_value.
The following code retrieves the guid for the field but does not retrieve the data. Any ideas as to why? e.g. lv_brf_expr_id is filled on import, but ls_account-accgrpacc returns empty table.
get_element_id(
EXPORTING
iv_cr_type = lv_crequest-usmd_creq_type
iv_name = 'ACCOUNT_GROUP'
IMPORTING
ev_brf_expr_id = lv_brf_expr_id ).
ls_context-id = lv_brf_expr_id.
CREATE DATA ls_context-value TYPE USMDZ1_KTOKS.
ASSIGN ls_context-value->* TO <value>.
* <value> = ls_material-labor.
<value> = ls_account-accgrpacc.
Following used instead.
CALL METHOD lr_model->read_entity_data_all
EXPORTING
i_fieldname = ld_field
if_active = abap_false
i_crequest =
iv_cr_number
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bob
Why you are using BADI for account type and account? Any specific reason? Based on that I can try to help.
Kiran
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 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.