cancel
Showing results for 
Search instead for 
Did you mean: 

Reg Global Variable in PI 7.1

Former Member
0 Kudos

Dear All

We have a scenario where we need to validate contents of variuos fields in an xml file. As the validations are complex we want to store the exceptions inside a global variable so that all the exceptions can be segregated at a single point.

Consider the following source structure

Vendor No.

Order No.

Invoice No.

Claim No.

Customer No.

CustomerName

Needs to be maaped to following target structure

Vendor No.

Order No.

ClientName

Exception

Text

if in the Sender side, Vendor no/orderno/invoice no is not there then the text fied should be populated in the Reciever side with the exception , this challenge has to to be achived using the Global Variable.

Regrads,

Sourabh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Normal,

What I understand is if Vendor no/orderno/invoice no is there then you will send in the target else you need to put some value in TEXT field. If that is correct then you can easily write a if else and can come up with a logic.

Anyways if it is a complex one then the global variable you can wirte the logic and populate to n no. of fields or the text field also.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish

Yes as the validations are quite complex including some RFC look ups, I need to write separate UDFs for each field. But the requirement is that I need to map error message of each fied to a single text field (0..unbounded) using a Global Variable only.

Can you give some idea of how to implement this as in each UDF I should use the same Global Container.

Thanks

Sourabh

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Nirmal,

The exception you are going to send is a Type of Text message or its like java exceptions??

If you are validating 5 or 6 fields then its better to do it at Message mapping level,use Global variale ,first create a global variable and check the condition if Vendor not exists pass exception message to Global Variable.

Then map this global variable to Text message segment in Receiver side.

I had done validating Two CIDX Orderchange documents using JAVA Mapping,its worked perfectly for my requirement(bit complex requirement).

Regards,

Raj

Former Member
0 Kudos

Hi Sekar

Can you guide me How to use a single Global Variable for different UDFs.

As at the end of all validation I can map the content of Global Var to the Eception Text field in the target.

The exception is a text message and not a Java exception.

Thanks

Sourabh

samiullah_qureshi
Active Contributor
0 Kudos

You can use the Variable concept in graphical mapping for your purpose.

See below link:-

http://help.sap.com/saphelp_nwpi71/helpdata/en/1d/1140dc082d4c009580100d7efc544a/frameset.htm

You just need to mao it once and take it as the input for various UDFs. And in UDF you can do the validation stuff and if needed then you can pass the value to the UDF target.

Regards,

Sami

rajasekhar_reddy14
Active Contributor
0 Kudos

Why you want to go for UDF to validate the field??

You can validate the field using standard functions only right. receiver side right click on any node you wil see create variable option give the specific name to the variable.

create the same way how many variables you want,and send the error message to Global Variable.

and map this field to tect segment.

Regads,

Raj

Answers (0)