You can either go for some tools like SAPlink in this case. SAPlink will let you export custom objects. In case if you want to package them, it is possible to use SAPlink, however, I doubt that it covers all types.
Another way using basis is that you can configure to add the required objects to a Transport in SAP system, set the destination where you want the backup objects to be stored and then release them to apply the transport. You can programmatically (or manually) take the transported files and do whatever you want.