Giter VIP home page Giter VIP logo

Comments (12)

bsrdjan avatar bsrdjan commented on September 17, 2024 1

The question can be discussed with Functional/ABAP Consultant. node-rfc support can help with technical and integration issues, related to Python RFC connections. For questions about particular BAPIs it is recommended to reach out to Functional Consultants or SAP ABAP Community.

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

Could you please send the screenshot of the selection data used in SAPGUI, like how the key 000070001048 looks in HUOBJECTS table record in SAPGUI:
Screenshot 2023-09-01 at 11 07 04

You can also set the external breakpoint at the beginning of BAPI_HU_GETLIST and see in ABAP debugger if difference in selection data from SAPGUI and from Node.js. More info here: RFM call results differ from expected

To check if ABAP User Exit used for selection field, you can useabap utility from SAP/fundamental tools

mkdir tmp
cd tmp
npm init -y
npm install abap-api-tools
# create sapnwrfc.ini file, here in tmp folder, with your system connection parameters
# like
# sysId
# DEST=mySysId
# USER=demo
# PASSWD=welcome
# ASHOST=coevi51
# SYSNR=00
# CLIENT=620
# LANG=EN

# get ABAP metadata of your function module
abap get yourSysMME BAPI_HU_GETLIST

# inspect fields with user exits, search for ALPHA in editor, or from command line
grep ALPHA api/bapi_hu_getlist.js

It would help find out if selection field(s) have user-exits and if leading zeroes for example should be sent from Node.js

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

Hi @bsrdjan ,
Thanks for the quick response on this.

From sap GUI too, I'm providing the leading zeros.
image

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

I tested with the latest and older node-rfc versions and in remote enabled debugger the selection data look the same, no matter if called from node-rfc or from SAPGUI:

SAPGUI

I would suggest to get in touch with Functional Consultant to check if any configuration in the system has influence on RFC call of this particular BAPI.

If no progress could you please open customer incident for BC-MID-RFC-SDK component, provide the url of this issue there and also update this issue with the incident number.

Customer incident helps that more experts can analyse if needed. Next three weeks I am on vacation with very limited access to system.

With customer incident we can also get access and test in your system.

In my test system the OBJKEY 000070001048 does not exist and the correct error message is returned.

test.mjs

import { Client } from "node-rfc";

(async () => {
  const client = new Client({ dest: "MME" });
  await client.open();

  const R = await client.call("BAPI_HU_GETLIST", {
    HUOBJECTS: [
      {
        OBJECT: "09",
        OBJKEY: "000070001048",
      },
    ],
  });

  console.log(R);
})();

Console output

node test.mjs
{
  NOTEXT: '',
  ONLYKEYS: '',
  HIGHESTLEVEL: [],
  HUHEADER: [],
  HUHISTORY: [],
  HUITEM: [],
  HUKEY: [],
  HUNUMBERS: [],
  HUOBJECTS: [ { OBJECT: '09', OBJKEY: '000070001048' } ],
  NOTFOUNDHUS: [],
  RETURN: [
    {
      TYPE: 'E',
      ID: 'HUSELECT',
      NUMBER: '009',
      MESSAGE: 'No handling units for required objects',
      LOG_NO: '',
      LOG_MSG_NO: '000000',
      MESSAGE_V1: '',
      MESSAGE_V2: '',
      MESSAGE_V3: '',
      MESSAGE_V4: '',
      PARAMETER: '',
      ROW: 0,
      FIELD: '',
      SYSTEM: ''
    }
  ]
}

We need to check the behaviour in your system.

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

Hi @bsrdjan ,
This error you are getting because the process order is not there.

  1. You must first create the process order using the cor1 transaction code.
    image

  2. Then, by using cowbpack transaction code, you have to create the handling units.
    image

  3. Then you have to provide the 09 and the objkey = your process order number that you have created.

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

Hi @bsrdjan If you want, we can set up a call and check the behavior in my system.

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

Thank you for detailed steps. My point was that when HU not found, the error message is correct and in your system there is no result and no error message.

My test system is plain Basis system in which I can't test steps to reproduce. We need to test the behaviour in your system, with customizing applied there. For that we need a customer incident and from EoD today I am anyway out of office.

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

Hi @bsrdjan
The root cause of this issue is when we pass any return parameter. Suppose you are passing a message to this to return then in that at the line n0 89 getting some problem and it does not execute the 107 line that adds the hukey to hukey array.
image

If I pass the following input to that BAPI on SAPI UI, too, I'm not getting any output.
image
So, I wonder if it is expected behavior or not.

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

Hi @bsrdjan
Thanks for the support.
The issue is happening because we are passing an empty string in the RETURN parameter array like the following:-

RETURN: [
   {
     TYPE: 'E',
     ID: 'HUSELECT',
     NUMBER: '009',
     MESSAGE: 'No handling units for required objects',
     LOG_NO: '',
     LOG_MSG_NO: '000000',
     MESSAGE_V1: '',
     MESSAGE_V2: '',
     MESSAGE_V3: '',
     MESSAGE_V4: '',
     PARAMETER: '',
     ROW: 0,
     FIELD: '',
     SYSTEM: ''
   }

To resolve this issue temporarily, we initialized the return parameter with an empty array, and the issue get resolved. As one suggestion, if SAP itself does not accept the empty string in the return parameter, then the node_rfc library should handle this scenario like if a user is not providing input to the field, then Node_rfc should remove that parameter or provide that which can be accepted at the SAP system.

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

Which field exactly causes the issue when returned as empty string? Could you please provide the example of RETURN parameter with empty string, which causes the issue?

from node-rfc.

vishalshingate avatar vishalshingate commented on September 17, 2024

From our node js code, we previously provided this input. Because of this, it's not giving us the expected output.

"RETURN": [
{
"FIELD": "",
"ID": "",
"LOG_MSG_NO": "",
"LOG_NO": "",
"MESSAGE": "",
"MESSAGE_V1": "",
"MESSAGE_V2": "",
"MESSAGE_V3": "",
"MESSAGE_V4": "",
"NUMBER": "",
"PARAMETER": "",
"SYSTEM": "",
"TYPE": ""
}
]

If you see line number 89, it's saying if the return is initialized, if we are passing the input to any field that array then this array will get initialized Because of that might following statements will not be executed.
image

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

The support here can't help with questions related to ABAP functional logic. Is there an issue with ABAP RETURN parameter which is not handled properly by node-rfc? Can you provide an example of such ABAP RETURN parameter and describe what the node-rfc issue exactly is?

I am asking because the above comment is not clear to me:

The issue is happening because we are passing an empty string in the RETURN parameter array like the following:-

The example following this sentence shows non-empty structure and I am not sure which empty string is mentioned here?

from node-rfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.