cancel
Showing results for 
Search instead for 
Did you mean: 

Count nunber of records in FILE

Former Member
0 Kudos

Hi Experts,

I have a scenario where I am getting an exchange rate csv file its converted to xml and mapped to idoc.

now a new requirement has come up as I need to put a validation that this file should contain all the specified currencies in the system for example right now there are 31 currencies in the system so the file shld contain all these currencies.If anything other than specified currencies aur less than specifies currencies comes than system shld through error.

what is the best possible way to do this other than RFC lookup??

regards,

Nidhi

Accepted Solutions (1)

Accepted Solutions (1)

former_member187339
Active Contributor
0 Kudos

Hi Nidhi,

>>what is the best possible way to do this other than RFC lookup??

If your currency count is constant say 31 then no need for RFC Look up else you will need one.

Regards

Suraj

Former Member
0 Kudos

Right Now my currency count is 31 but it can change so I ust dont want to hard code it.

Former Member
0 Kudos

Hi,

Use enum in xsd (datatype), no coding required.

See this: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_20846275.html

Else you can write simple UDF.

Regards,

Gourav

Former Member
0 Kudos

Hi Gaurav,

i didn´t get use of enum.

can u please elaborate more how can I capture this in a UDF?

Former Member
0 Kudos

Hi,

by using enum in xsd you can restrict permissible values for that particular field (do it while defining datatype). In PI7.1 you can use XML validation to avoid any message which is not as per exact definition of xsd.

However if this is not suitable for you then you can write UDF for validating this, throw mapping exception if it is not valid currency.

NOTE: World currencies are almost constant so don't worry if they change in future.

This blog will answer your question: /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

also discussed in this forum (solved):

Regards,

Gourav

Former Member
0 Kudos

Hi gaurav,

my problem is that how to check all the crrencies which are specified in my R3 system.

How can I compare these currencies?

Regards,

Nidhi

former_member187339
Active Contributor
0 Kudos

Hi Nidhi,

RFC Look up is the lone possibility if you are trying to read the number of currencies from R3.

Other option can be to put this number in the input file itself so that you can compare the same in Mapping (I am not sure whether this is feasible or not).

else make file to XI to Proxyscenario and the response from proxy should be mapped to the real receiver (using Response onewaybean).

But all this approaches are tedius and not recommended. Try explaining your scenario little more and let us see whether any other approach comes out or not.

Regards

Suraj

Former Member
0 Kudos

Hi Nidhi,

I am not sure about this but currencies are maintained in text table within SAP. But you can always download Currency ISO code from internet (google it). ISO code is 3 character currency code like INR (Indian Rs), EUR (Euro), USD (US Dollar), GBP etc.

I can find currency exchange rate in this table: TCURR but still you must consult with functional consultant.

I suggest to close thread in this forum if your original question is answered and raise question in ERP forum as those expert will be able to help you quickly.

Regards,

Gourav

Former Member
0 Kudos

I want to know if there is any possibility in XI where I can make a Table lookup without making a RFC Call??

Former Member
0 Kudos

Hi Nidhi,

You can make a jdbc lookup instead of rfc lookup. But I would suggest not to do a direct table jdbc looup, instead rfc lookup would be more preferable. Accessing sap table is always not a best option.

Regards,

---Satishq

former_member187339
Active Contributor
0 Kudos

Hi Nidhi,

Unfortunately no it is not possible to do a table look up of SAP without a RFC. Even direct DB look up of R/3 tables are not recommended, so they need to be accessed by RFC alone.

A RFC call will not put load into your message mapping, so you can give it a try

Regards

Suraj

Answers (1)

Answers (1)

former_member750652
Contributor
0 Kudos

Hi Nidhi,

If those 31 cureney values are fixed type. Then you can write an UDF to validate those 31 values . so the UDF throws an exception if any different variable comes in .

Thanks,

Ram.