-
April 3rd, 2014, 10:03 AM
#1
Need help with checking String is not a character.
Need to read Material even if its not a number and return material group.
Table reading function to call the function module and populate the new column
function fillMaterialColumn(){
onscreen 'SAPMV50A.1000' //Changed screen to the overview screen which holds the table
gettableattribute("T[All items]", {"firstvisiblerow":"FVisRow","lastvisiblerow":"LVisRow","lastrow":"LRow"});
absrow = 1;
relrow = 1;
if (FVisRow == 1){
goto new_row;
}else{
enter("/scrolltoline=1",{"table":"T[All items]"});
goto new_screen
}
new_screen:;
onscreen 'SAPMV50A.1000'//Changed screen to the overview screen which holds the table
gettableattribute("T[All items]",{"firstvisiblerow":"FVisRow","lastvisiblerow":"LVisRow","lastrow":"LRow"});
relrow =1;
new_row:;
if (absrow > LVisRow) {
enter("/scrolltoline=&V[absrow]",{"table":"T[All items]"});
goto new_screen;
}
if (absrow > LRow){
goto table_end;
}
set("V[z_temp]" , "&cell[All items, Material,&V[relrow]]");
println(absrow + ".----------Material is: " + z_temp+"---");
if(isBlank(z_temp)) //If the material read from the table is blank, then stop the table read. Additional check to save processes
goto table_end;
z_temp = z_temp.trim();
//if(isNaN(z_temp));if (z_temp is not a character) I was told to put some logic here to read if it is not a character.
z_temp = padString(z_temp,18,0,0);
println('--\n\n--padded material='+z_temp);
//set('V[z_material&V[absrow]]','&V[z_temp]'); //Reading from the table and setting the material to a variable
// Writing into the newly created column after reading the full column
//for(var idx = 1; idx<absrow;idx++){
//set('V[z_tempvar]','&V[z_material&V[idx]]'); //Creating a temporary variable to perform the function call
//println("---The row is:"+ idx+". The Material is: "+z_tempvar+".--");
call ("BAPI_MATERIAL_GET_ALL",{"in.MATERIAL":"z_temp","out.CLIENTDATA":"z_clientdata"}); //Performing the function call
println("CLIENTDATA:"+z_clientdata); //Printing out the client data from the function call
z_clientdata = z_clientdata.substring(94,103); //Substring of the client data to get the desired portion
set("V[z_material_grp.&V[absrow]]","&V[z_clientdata]"); // Writing to the column
//}
-
April 3rd, 2014, 03:40 PM
#2
Re: Need help with checking String is not a character.
Norm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|