I am trying to call a BAPI in SAP Cloud SDK Java, not sure whats wrong with below code. Please help me here
final Destination destination =
DestinationAccessor.getDestination("MyErpSystem").asRfc()
.decorate(DefaultErpHttpDestination::new);
final BapiRequestResult result = new BapiRequest("BAPI_COSTCENTER_GETLIST1")
.withExporting("CONTROLLINGAREA", "BAPI0012_GEN-CO_AREA", "A000")
.withTable("COSTCENTERLIST", "BAPI0012_CCLIST").end().withTableAsReturn("BAPIRET2")
.execute(destination);
it shows syntax error at destination creation.