on 08-20-2015 8:47 AM
Hi ,
I am trying to set initial value for some of the MDG Screen fields using Governance API . I referred the MDG API manual and In the following example I am trying to set the company code by creating a enhancement in the feeder class
Still not able to get through it . Here is my Code : I need a syntax to initialize the Company Code Entity using Governance API
*******************************************************************************
**************** Initializing Company Code****Using MDG API********************
TRY
CALL METHOD LO_GOV_API->IF_USMD_GOV_API_ENTITY~CREATE_DATA_REFERENCE
EXPORTING
IV_ENTITY_NAME = 'BP_CUS_CC' "Entity Name to be Initialized
IV_STRUCT = LO_GOV_API->GC_STRUCT_KEY_ATTR
IMPORTING
ER_STRUCTURE = LR_CUST_data_STR
ER_TABLE = LR_CUST_data_TAB.
CATCH CX_USMD_GOV_API .
ENDTRY.
* Create data structre out of references
assign LR_CUST_KEY_STR->* to <LS_CUST_KEY>.
assign LR_CUST_KEY_TAB->* to <Lt_CUST_KEY>.
assign LR_CUST_data_STR->* to <LS_CUST_data>.
assign LR_CUST_data_TAB->* to <Lt_CUST_data>.
move-corresponding <LS_CUST_KEY> TO <LS_CUST_DATA>.
assign component 'BP_CUS_CC' of structure <LS_CUST_DATA> to <LV_VALUE>.
**************************************************************************
"Initialize the Company Code Data
<LV_VALUE> = '001'. " Throws an Error while Initializing Company Code '
insert <LS_CUST_DATA> into table <LT_CUST_DATA>.
*******************************************************************************
Write new entity into C/R with created data above
******************************************************************************
CALL METHOD LO_GOV_API->IF_USMD_GOV_API_ENTITY~WRITE_ENTITY
EXPORTING
IV_CREQUEST_ID = LO_CONV_API->MV_CREQUEST_ID
IV_ENTITY_NAME = 'BP_MLT_AS'
IT_DATA = <LT_CUST_DATA>
.
Regards,
Vicky
Hi, why not use the BAdIs USMD_RULE_SERVICE or USMD_RULE_SERVICE_CROSS_ET to set default values for an entity (first BAdI) or even create new entities (second BAdI)?
Regards, Ingo Bruß
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.