cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Lookup & Error On Missing Data for All Lines, not just One

Former Member
0 Kudos

Hi Everyone,

I have a message with 1 header and n detail rows. Each line needs to retrieve data from an ABAP stack using a lookup, and it is possible that the data will not be found for certain rows. I want to throw 1 error message at the end for all missing entries, not just on the first error. Any best approaches to this kind of requirement?

Thanks

Peter

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Peter,

You can use Graphical mapping with RFC Lookup [or DB lookup] in advanced user defined function. You can add all your error messages in a HashMap and store it in Global container.

Later you can write Advanced UDF to retireve Error messages from HashMap and send it as a single error message.

The following Weblog and PDF may help you in writing Lookup function in Graphical mapping.

1.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-code-samples... mapping lookups rfc api.pdf

2.

/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

Regards,

Ananth

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Peter,

Considering the fact that you want to Connect to do a database look up along with creating one error message, the best approach to your problem would be to go in for JAVA Mapping.

Java Mapping will allow you to do the database connectivity along with perfroming all the validations and creation of the error messages.

This link can help you understand Java Mapping better,

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm

Also,

There are 2 means of doing your JAVA Parsing. One is using DOM and another is using SAX Parser.

The DOM Parser is easy, but very CPU intensive and should be used when performance is not an issue. Likewise, SAX parser is not very CPU intensive and it can be used when Performance is an issue.

Hope this helps,

Let me know if you need any clarifications,

Regards,

Bhavesh

Message was edited by: Bhavesh Kantilal

Former Member
0 Kudos

Thanks Bhavesh,

If possible, I would like to remain within graphical mapping (I am not familiar with JAXP). Using a BPM is also fine. I was thinking that I could do the lookup, and if no value is found, then set a flag. Then send the output through another map that keys off of this flag appending the errors into a separate message. Then in the BPM check if the "error" message was created (is that possible?) and if so, then stop on error. If not, then proceed with processing.

Peter

bhavesh_kantilal
Active Contributor
0 Kudos

Hi peter,

I think this is a viable solution that you have suggested, but you will have to conider the performance issues also.

Using a BPM and 2 mappings can cause a performance issue. But, if performance is not an issue then, the solution you are suggesting ( though a work around ) is a good one and also easy.

But, if i were you, I would prefer a single JAVA mapping. Like they say, its never too late to learn.

All the best,

Regards,

Bhavesh