Send a record to SAP

Satya siva kumar,

Unfortunately, your process flow is confusing and I am not sure what you are trying to do that is causing the NPE. Is it occurring after you perform your DB call or before in the Java code?

Alternatively, I recommend that you use the available built-in flow processes, where possible, to perform what you are needing to do. One way of doing this process is to:

->Call the DB and get data - store in hashItems as you are currently.
->Map the output of your DB call(the hashItems in the pipeline) to your record OILSH01 IDOC structure you got from ifr. Here you can insert/hardcode any other required IDOC fields too, such as for the EDI_DC40.
->Now call the pub.sap.idoc:transformHierarchyToFlat(not pub.sap.idoc:transformHierarchyToFile) - This prepares the IDOC and makes it fixed length accordingly.
pub.sap.idoc:encodeSDATA - Converts every SDATA field from orderly Values to byte array. This service is usually called prior to sending an IDoc to an SAP system via pub.sap.client:invokeTransaction.
call “pub.sap.transport.ALE: OutboundProcess” - posts the IDOC to SAP.

I just thought I’d give you an alternative suggestion to your process.

thanks,

ajandja