on 03-03-2006 5:33 PM
Hello,
I am very new to the world of Netweaver Portals and Web Dynpro, so please have some patience.
I have created an application in Web Dynpro which will display the Stock Requirements for a Material. Everything is working fine with the exception that the User needs to enter 10 leading zeros before they enter the material number. Is this something that I can correct in Web Dynpro, or is there something I need to do on the R/3 side?
In R/3, the user can simply type in the 7 digit material number, but in my Web Dynpro App, they need to enter a 17 digit number (10 leading zeros and the 7 digit mat number).
I have checked other topics, but couldn't find where this exact issue has been addressed. Thanks for your help.
Paul
Thanks for your input Sebastian and Armin. I am that "Newbie" that you are talking about and this forum does help out greatly. I will award points accordingly.
Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1)If you bind you inputfield to context node directly, the webdynpro itself convert it into 17 digit number.
2)if you are using Jco you have to append the leading zero's.
if satement 1 is wrong, you can do the following.
you can calculate string length of input field before executing the bapi and append leading zeros and set the attribute with new string.
Thanks,
Damodhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Paul,
one possible solution for this issue might be to write some code to add the missing zeros. For example you can put the coding in a action method.
Please take a look at the following snippet:
// get the material number from context (this is the number entered by the user)
String id = wdThis.wdGetWelcomeComponentController().wdGetContext().currentContextElement().getMaterialID();
if(id.length() < 17) {
for(int i = 0; i < 17 - id.length(); i++) {
id = "0" + id;
}
}
// your id is now a 17 digit number
I that helps you.
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Armin,
yes you are right. This is a little bit more elegant. But if you want to do it the elegant way you can reduce this to only two lines of code:
/* note that you cannot declare a static variable inside a method, only use final or declare it as attribute of the class */
final String Z17 = "00000000000000000";
id = Z17.substring(0, id == null ? 0 : 17 - id.length()) + id;
regards
Sebastian
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.