on 03-05-2018 4:52 PM
Hi,
I want to create a flavor for V.26 t-code where I have the variant to populate the document date dynamically change.
How do I create a Personas flavor for this T-code to populate the variant automatically when the user access ? So that the user need not to fill the dates every day when they access the flavor.
Thanks,
It is not exactly clear what is your goal.
You say that you have a variant that dynamically populates the document date. If so, this means you would want to select this existing variant which you should be able to do easily with an onLoad script that navigates to variant selection and picks the appropriate variant.
Or are you saying that you want to calculate the date dynamically within your Personas flavor? That is also doable with a proper onLoad script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tamas,
I am able to record up-to the point of selecting the screen for variant and recorded below. However after getting the variant screen......how do I select the particular variant from the list ? any example code which I can use ? V.26 Tcode.
session.findById("wnd[0]/usr/txtSTATUS").setFocus();
session.findById("wnd[0]/tbar[1]/btn[17]").press();
Hi,
the script will not record the variant name, the script will select the variant at the position that you have recorded.
If users save their own variant names your variant postion becomes arbitrary and you will get trouble 😉
If you want to select a special variant name that has no fixed position you have to read the variant table to determine the variant position. At this position you can do a "scripting doubleclick".
Example (coding in your script instead of your recorded doubleclick)
var xtable = session.findById("wnd[1]/usr/##############/shell");
if (xtable.rowCount > 0) {
xtable.firstVisibleRow = 0;
var topRow = xtable.visibleRowCount - 1;
// loop through all the rows
for (var rowIndex = 0; rowIndex < xtable.rowCount; rowIndex++) {
// If there is more than one page of variants scroll forward
if (rowIndex > topRow) {
if (topRow + xtable.visibleRowCount > xtable.rowCount) {
xtable.firstVisibleRow = xtable.rowCount - xtable.visibleRowCount;
}
else {
xtable.firstVisibleRow = topRow + 1;
}
topRow += xtable.visibleRowCount;
}
//Check the value, if it fits do a double-click
var xvariant = xtable.getCellValue(rowIndex, "VARIANT");
if (xvariant === "YOURVARIANTNAME"){
xtable.doubleClick(rowIndex, "VARIANT");
break;
}
}
}
For more information about reading tables check the Screen Personas Wiki
https://wiki.scn.sap.com/wiki/display/Img/Copying+Table+data+into+a+variable
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.