Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAP document listener in node js #324

Open
apoorv-sharma opened this issue Apr 4, 2024 · 1 comment
Open

SAP document listener in node js #324

apoorv-sharma opened this issue Apr 4, 2024 · 1 comment

Comments

@apoorv-sharma
Copy link

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?

@apoorv-sharma
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant