SAP/node-rfc

SAP document listener in node js

apoorv-sharma opened this issue · 1 comments

Hi, I am looking to write a sap document listener using node-rfc which consumes the idoc and process it. Is it possible in node-rfc?

For parsing, I can write my own parser for idoc as my idoc are not complex. Something like following to get idoc would work?

const client = new Client({....})
async function checkForIDocs() {
      console.log(result.IDOC_DATA)
      const result = await client.call('Z_RECEIVE_IDOC', {
            IDOCTYPE: 'SOME_TYPE'
        });
        if (result.IDOC_DATA) {
            console.log(result.IDOC_DATA)
        }
}

// Start Polling
setInterval(checkForIDocs, 5000); // Check every 5 seconds