With the data-dependent viewing ability, a user might have a number of files, named with different names. If a user enters a value in a given field, the file linked to that field would be displayed. This functionality allows you to use variables in specifying the file names. To demonstrate this functionality, please do the following.
-
Create several files, naming them 'img000500185', 'img000500186', 'img000500187
-
Go to the Easy Access screen.
-
Open the 'SAPSLMTR_NAVIGATION.E0100.sjs' script file, and enter the following code. Create the file if it does not already exist.
for(a=firstChild; a!=null; a=a.nextSibling)
a.del();
inputfield([1,5], "Material Number", [1, 31], {"name":"z_matno", "size":20});
pushbutton([TOOLBAR], "View Files", {"process":z_view});
function z_view() {
view("img&V[z_matno].rtf");
}
-
Save the changes and refresh the SAP screen.
-
Enter a number in the 'Material' field. in our example, we will enter 000500185.
-
Press the Enter key.
-
The file 'img000500185.rtf' will open as shown below.