Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello together,
is there any possibility, that I can select different values (for example earliest year of a delivery (2009 or 2010 or 2011), medicinal product (Y / N), etc) before I start a script?
1.) So I need to set some values which have to take account in the script.
Something like this:
Do you have a "medicinal product"? Y / N => If I take Y, the data will be set in a variable (e.g. vMPdata='Y')
In the script should be something like this:
SQL SELECT SAARTNR as REF,
SAARTBEZ1 as Articledescription,
SAMEDIK as AMKZ,
SACHARKZ as LOTKZ
FROM QS36F.DLSSA where SAMEDIK=vMPdata;
2.) Also should there any checkup for all values I have to add. Only if I have added all values, I am able to run the sript
Do you have any ideas?
Thank you very much for your help.
Hi,
1) I am not sure of the objective in doing so but you can do this as follows:
Create Variables as needed and add them to a inputbox for the users to select them.
Then if you reload (which also can be done thru a button action with macro), the reload script if contains any value will run the script with the values.
2) While running the reload thru button with macro, add the necesary check in macro and reload only if the validation is passed.
Regards,
Kiran.
Dear Kiran,
thanks for your help.
1) But how should the script look like? The one I added in the intro is not working.
2) How do I do the necessary checks for the variables?
The reload-macro looks like:
Sub ReloadStuff
ActiveDocument.Reload
End Sub
Hi,
You can put a button for this macro code and use this on the action command by giving macro name.
Sub ReloadStuff
ActiveDocument.Reload
End Sub
Rgds
Anand
1) Do I have to do something like:
SQL SELECT SAARTNR as REF,
SAARTBEZ1 as Articledescription,
SAMEDIK as AMKZ,
SACHARKZ as LOTKZ
FROM QS36F.DLSSA where SAMEDIK=getfieldselections(vMPdata);
But in this way it is still not working.
Sub ReloadStuff
validVariable = ActiveDocument.GetVariable <VariableName>.GetContent.String
if <Conditon on validVariable> then
ActiveDocument.Reload.
end if
End Sub
2) What do I have to do with more than one variable?
Would this be correct?
Sub ReloadStuff
validVariable1 = ActiveDocument.GetVariable <VariableName1>.GetContent.String
validVariable2 = ActiveDocument.GetVariable <VariableName2>.GetContent.String
if <Conditon on validVariable1> and <Conditon on validVariable2> then
ActiveDocument.Reload.
end if
End Sub
Yes, that would work. You can validate you VB Script in the below url:
http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_intro
Kiran.
Hi,
for the other case,
does nobody has any solution for following problem:
1)
SQL SELECT SAARTNR as REF,
SAARTBEZ1 as Articledescription,
SAMEDIK as AMKZ,
SACHARKZ as LOTKZ
FROM QS36F.DLSSA where SAMEDIK=getfieldselections(vMPdata);
But this is not working. What do I do wrong?
When script is running, document isnt active hence getfieldselections which includes document operation as selecting will not work. While variables arent such and can be used.
Hope I am clear in the explanation,
Kiran.