Summary : Pdf Viewing with Password Control
Steps :
1. Go to Tcode : SFP
2. Create an Interface
3.In the interface, the desired password type is added to the import parameter. – Lv_password
4. Then this data is used in the form.
5. Go to Layout and Create a text-field .Then bind lv_password.
6. Go to the Initialize event of DATA as shown below
Code :
data::initialize – (JavaScript, client)
var password = ”;
var lv_pass = ”;
var passportQuery = false;
lv_pass = USTBOSLUK.TextField2; // Holds the password given in encoding
password = app.response(“Enter password”,”title”,””,true); // Holds the value entered from the popup
while( passportQuery == false ){
if (password == lv_pass.rawValue)
{
xfa.host.messageBox(“Right password”,”You Know right”,3,0);
passportQuery = true;
}
else
{
app.alert(“Wrong password.You entered:”+password);
password = app.response(“Enter password”,”title”,””,true);
passportQuery = false;
}
}
7. Execute :
–>It was not opened because the password entered in the import parameter and the password entered from the popup were not the same.
–> The popup screen will remain open until the password given in the coding matches the password entered from the popup on the screen.
If the passwords match, the PDF will be displayed.
Advantages ;