@EndUserText.label : 'zfcal_holi_344'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #C
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zfcal_holi_344 {
key client : mandt not null;
key holiday_id : abap.char(30) not null;
month_of_holiday : abap.numc(2);
day_of_holiday : abap.numc(2);
changedat : timestampl;
config_deprecation_code : config_deprecation_code;
local_last_changed_at : timestampl;
created_by : syuname;
created_at : timestampl;
last_changed_by : syuname;
}
@EndUserText.label : 'ZFCAL_HOLTXT_344'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #C
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zfcal_holtxt_344 {
key client : mandt not null;
@AbapCatalog.textLanguage
key spras : spras not null;
key holiday_id : abap.char(30) not null;
fcal_description : abap.char(100);
}
{
"implementationType": "managed_semantic",
"namespace": "ZFCAL",
"suffix": "_344",
"prefix": "",
"package": "Z_CUST_344",
"datasourcetype": "table",
"bindingtype": "odata_v4_ui",
"draftenabled": true,
"transportrequest": "",
"iscustomizingtable": true,
"addbusinessconfigurationregistration": true,
"hierarchy": {
"entityName": "Holiday",
"dataSource": "zfcal_holi_344",
"drafttable": "zfcal_holid344",
"objectId": "holiday_id",
"lastChangedAt": "changedat",
"lastChangedBy": "last_changed_by",
"createdAt": "created_at",
"createdBy": "created_by",
"localInstanceLastChangedAt": "local_last_changed_at",
"children": [
{
"entityName": "HolidayText",
"dataSource": "zfcal_holtxt_344",
"drafttable": "zfcal_holtxtD344",
"objectId": "holiday_id",
"localInstanceLastChangedAt": "local_last_changed_at"
}
]
}
}
"implementationType": "managed_semantic"
"namespace": "ZFCAL",
"suffix": "_003 "
"bindingtype": "odata_v4_ui",
"draftenabled": true,
"isCustomizingTable": true,
"addBusinessConfigurationRegistration": true,
CLASS zcl_rap_generator_cust_344 DEFINITION
PUBLIC
INHERITING FROM cl_xco_cp_adt_simple_classrun
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS: main REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_rap_generator_cust_344 IMPLEMENTATION.
METHOD main.
DATA(json_string) = '{' && |\r\n| &&
' "implementationType": "managed_semantic",' && |\r\n| &&
' "namespace": "ZFCAL",' && |\r\n| &&
' "suffix": "_344",' && |\r\n| &&
' "prefix": "",' && |\r\n| &&
' "package": "Z_CUST_344",' && |\r\n| &&
' "datasourcetype": "table",' && |\r\n| &&
' "bindingtype": "odata_v4_ui",' && |\r\n| &&
' "draftenabled": true,' && |\r\n| &&
' "transportrequest": "",' && |\r\n| &&
' "iscustomizingtable": true,' && |\r\n| &&
' "addbusinessconfigurationregistration": true,' && |\r\n| &&
' "hierarchy": {' && |\r\n| &&
' "entityName": "Holiday",' && |\r\n| &&
' "dataSource": "zfcal_holi_344",' && |\r\n| &&
' "drafttable": "zfcal_holid344",' && |\r\n| &&
' "objectId": "holiday_id",' && |\r\n| &&
' "lastChangedAt": "changedat",' && |\r\n| &&
' "lastChangedBy": "last_changed_by",' && |\r\n| &&
' "createdAt": "created_at",' && |\r\n| &&
' "createdBy": "created_by",' && |\r\n| &&
' "localInstanceLastChangedAt": "local_last_changed_at",' && |\r\n| &&
' "children": [' && |\r\n| &&
' {' && |\r\n| &&
' "entityName": "HolidayText",' && |\r\n| &&
' "dataSource": "zfcal_holtxt_344",' && |\r\n| &&
' "drafttable": "zfcal_holtxtD344",' && |\r\n| &&
' "objectId": "holiday_id",' && |\r\n| &&
' "localInstanceLastChangedAt": "local_last_changed_at"' && |\r\n| &&
' }' && |\r\n| &&
' ]' && |\r\n| &&
' }' && |\r\n| &&
'}'.
DATA(rap_generator) = NEW /dmo/cl_rap_generator( json_string ).
DATA(todos) = rap_generator->generate_bo( ).
DATA(rap_bo_name) = rap_generator->root_node->rap_root_node_objects-service_binding.
out->write( |RAP BO { rap_bo_name } generated successfully| ).
out->write( |Todo's:| ).
LOOP AT todos INTO DATA(todo).
out->write( todo ).
ENDLOOP.
ENDMETHOD.
ENDCLASS.
RAP BO ZFCALUI_Holiday_344_O4 generated successfully
Todo's:
Messages from XCO framework
Type: BDEF Object name: ZFCALC_HOLIDAY_344 Message: The field "HOLIDAYID" is used for "parent" dependency (in the ON clause
Type: BDEF Object name: ZFCALC_HOLIDAY_344 Message: of the association "_Holiday"). This means it should be flagged as
Type: BDEF Object name: ZFCALC_HOLIDAY_344 Message: "readonly / readonly:update".
Type: BDEF Object name: ZFCALI_HOLIDAY_344 Message: The field "HOLIDAYID" is used for "parent" dependency (in the ON clause
Type: BDEF Object name: ZFCALI_HOLIDAY_344 Message: of the association "_Holiday"). This means it should be flagged as
Type: BDEF Object name: ZFCALI_HOLIDAY_344 Message: "readonly / readonly:update".
Messages from XCO framework (Service Binding)
Type: Object name: Message: To enable publish of local service endpoint, activate the Service Binding
Messages from business configuration registration
ZFCALI_Holiday_344 registered successfully.
CLASS lcl_handler IMPLEMENTATION.
METHOD get_instance_features.
ENDMETHOD.
METHOD val_transport.
CHECK lines( keys ) > 0.
DATA table_keys TYPE TABLE OF zfcal_holi_344 .
table_keys = VALUE #( FOR key IN keys (
holiday_id = key-HolidayID
) ).
TRY.
cl_a4c_bc_factory=>get_handler( )->add_to_transport_request(
EXPORTING
iv_check_mode = abap_true
it_object_tables = VALUE #( ( objname = 'ZFCAL_HOLI_344'
tabkeys = REF #( table_keys ) ) )
iv_mandant_field_name = 'CLIENT'
IMPORTING
rt_messages = DATA(messages)
rv_success = DATA(success) ).
CATCH cx_a4c_bc_exception INTO DATA(exc).
success = abap_false.
ENDTRY.
IF success NE 'S'.
failed-Holiday = CORRESPONDING #( keys ).
DATA report LIKE LINE OF reported-Holiday.
report = CORRESPONDING #( keys[ 1 ] ).
IF exc IS BOUND.
report-%msg = new_message_with_text( text = exc->get_text( ) ).
INSERT report INTO TABLE reported-Holiday.
ENDIF.
LOOP AT messages ASSIGNING FIELD-SYMBOL(<msg>).
report-%msg = new_message(
id = <msg>-msgid
number = <msg>-msgno
severity = CONV #( <msg>-msgty )
v1 = <msg>-msgv1
v2 = <msg>-msgv2
v3 = <msg>-msgv3
v4 = <msg>-msgv4 ).
INSERT report INTO TABLE reported-Holiday.
ENDLOOP.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_saver IMPLEMENTATION.
METHOD save_modified.
DATA table_keys TYPE TABLE OF zfcal_holi_344.
DATA object_tables TYPE if_a4c_bc_handler=>tt_object_tables.
table_keys = VALUE #( FOR key IN create-Holiday (
holiday_id = key-HolidayID
) ).
LOOP AT update-holiday ASSIGNING FIELD-SYMBOL(<update>).
INSERT VALUE #(
holiday_id = <update>-HolidayID
) INTO TABLE table_keys.
ENDLOOP.
LOOP AT delete-Holiday ASSIGNING FIELD-SYMBOL(<delete>).
INSERT VALUE #(
holiday_id = <delete>-HolidayID
) INTO TABLE table_keys.
ENDLOOP.
IF table_keys IS NOT INITIAL.
INSERT VALUE #( objname = 'ZFCAL_HOLI_344'
tabkeys = REF #( table_keys ) ) INTO TABLE object_Tables.
ENDIF.
CHECK object_tables IS NOT INITIAL.
TRY.
cl_a4c_bc_factory=>get_handler( )->add_to_transport_request(
EXPORTING
iv_check_mode = abap_false
it_object_tables = object_tables
iv_mandant_field_name = 'CLIENT'
IMPORTING
rv_success = DATA(success) ).
CATCH cx_a4c_bc_exception.
success = abap_false.
ENDTRY.
ASSERT success = 'S'. "point of no return - previous validation must catch all exceptions
ENDMETHOD.
ENDCLASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
24 | |
21 | |
13 | |
9 | |
9 | |
9 | |
9 | |
8 | |
8 |