on 10-24-2007 12:41 PM
Scenario IDoc to File:
For one filed I get different values. As many as 20 values from sap and for that value I will have to set an error code. Each Number from SAP will have an error code respectively.
Thanks
Kiran
Hi,
Use Fixed value funtion it will very easy way to do it.in my project i got the same requirement i used same fixed value.if u want u can use UDF also as one of them mentioned in the thread.
Regards,
Phani
Reward points if Helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
>>So the source sap value is dynamic. and I have to populate its corresponding value into file as I explained earlier.
You have posted that u would get 20 different values and u would definately know the error codes associated to those values. So specify all the possible Values and error codes in the FixedValue Function/ Value Mapping so that in the runtime the error code corresponding to the Value will be picked up dynamically.
In addition have a look at the Blog that i replied in the previous post which is worked for a similar scenario.
Hope this clears..
Regards
San
Hi
as per your requirement you can use the fix value function
source field>fixvalue>target field
in the fix value function define ur condition
key value
1 A
2 B
Thanks
Rinku
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
public void func(String inputValue)
{
if(inputValue.equals("1")
return 'A';
else if(inputValue.equals("2")
return 'B';
:
:
}
It this your requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Monika..
Thanks for that UDF . But I used a case statement instead of IF.Its working fine now. Rewarded points.
Now my problem is I have as many as 30 interfaces which will have to use the same UDF. So I have to create a new UDF in each Interface.
My question is is there a way that we can place this UDF centraly something like a Function Module or a Subroutine and call it or use it where and when require. Because, if tomorrow, if any small change comes for in the UDF... It is very laborious work we need to do.
Any thoughts please...
Thanks
Kiran
Hi Kiran
Yes u can define global method by creating a java class
Steps
> create java class with whatever method u want to use again and again
> create JAR file of the java class
> import into impotted archive folder
> and while creating UDF u can use import statement like normal java program
> and access those method in ur code
rewards point if helpfull
thanks ajay
1. so if a change comes, then i will have to change in the global method and do i need to re-import that to archive folder?
2. Where should I perform all these steps?
3. I am not sure of impotted archive folder and other things
sorry.. i ve no idea at all on java. am an abaper. so plz provide more details so that i can get it done with my colegues.
Thanks
Kiran
Hi Kiran
Yes, you are right we will need to import in archive folder as JAR
Steps>
>First Make a java class containing your method or any number of other method
like
public class TextOne {
public static void main(String[] args) {
}
public String yourMethodName(String parameter){
String result = "your value"; // as for example
return result;
}
}
>step continue
>go to command prompt
> go to directory(package name like in above code) where u r java file is there
>make jar by following command
>jar -cvf nameofjarfile.jar yourjavafilename.java
>nameofjarfile.jar will we created
>go to archive folder in IR
>import that jar file
>go to UDF
>write import packagename
>now u can access function like class's object.method name
Reward points if helpful
hi,
Do you want to map 20 source values to a single target ??
Pls clarify .
Chemmanz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
I am bit confused your requirement.
Let me expalin you what i have understood...From sap you will gettting so many values for particular field...of couree at a time only one..but the same value may repeat or may not be repeat.
If you know the values what you are getting for particular source value you can use Fixed Values funcitonand you can enter the source field and target field.
Ex: 1-A
2-B
etc....use this funciton and check it if this suits your requirement that's fine or if you have any special requriement let me know.
Thanks and Regards,
Chandu.
Hi Kiran,
Value Mapping would be the right solution..
<a href="/people/community.user/blog/2007/01/08/valuemapping-using-the-graphical-mapping-tool using the Graphical Mapping Tool</a> By Praveen Kumar
<a href="/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt Time Value Mapping in XSLT</a> By Sreekanth Babu
Also try using the FixValues function.
Regards
San
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.