get positions to be saved in delivery via ABAP - abap

I am trying to check if positions in a delivery which is changed via the transaction vl02n fulfill some specific critiria before the document is saved.
For this action I want to use the user exit USEREXIT_SAVE_DOCUMENT_PREPARE.
In the debugger I checked which tables and variables are accessible and found out that there is a global table XLIPS which contains all positions that are visible on the current to be saved delivery.
The problem is that in XLIPS there are also the positions which were already deleted at the GUI of vl02n.
Because I just want to check the positions which indeed will be saved I don't want to use the table XLIPS.
How could I solve this problem and is there a better way than using XLIPS?
Thank you very much for your help and please excuse my bad english.

XLIPS contains the change information of all delivery items upon saving. So if you delete a line, XLIPS will still hold the deleted line, with the field XLIPS-UPDKZ set to D - indicating that the line has been deleted (or I inserted or U updated). With this in mind, you should be able to program your checks against the relevant items accordingly:
LOOP AT xlips ... WHERE updkz NE 'D'.
<your code here>
ENDLOOP.

Related

Is there any way that line inputs are auto expanded when there are many data to be displayed?

Json data is passed to Process Maker process, to a Line Input item with the "Read Only" option checked. But in order to see all data I need to put the cursor in the Line Input item and use the key board to go to the last word.
Is it possible that, if there are many data/characters, the Line Input item is automatically expanded to fit all data and so can be easy to see?
As a workaround I tried with a "Text Area" item which seems to display the data in a better way but I wanted to know if there is another way to make it work with Line Input item so I don't have to re-create the fields.
Thanks in advance,

vb.net or PS script to past value to a program form...

I have an older program I think was developed/complied using C++ that tracks sellable items we have. We enabled an option in the programs preferences that allows us to use an alternate sort field for reporting and inquiries. This field can contain any alpha/numeric value, but cannot be 'Blank' NULL.
However, when we enabled this feature, and we realize now we can’t un-enable it. Each item records (14,000+) now contain a "blank" NULL value for this field. At this point none of our reports will run and we get an error indicating: "Alternate Sort value can't not be NULL" So it looks like I will need to manually enter a value in the 'blank' NULL field.
I have a text file with the values for each record in the same order as they are displayed on the entry grid in the program. The database is propitiatory and there are no db tools provided to us that will allow us to import the values directly.
Does anyone know of a way to use vb.net or a PS script to basically read a value from a text file and then paste it where the cursor is on the screen and then send an {ENTER Key}, and then repeat the process?
Thanks

Load only select sections of Code in QlikView

I have a set of code that is rather large in Qlik. I have dates that are defined at the start of the script
i.e.
Let vBDate = Date(Date#('01/01/2015','MM/DD/YYYY'),'MM/DD/YYYY');
Let vEDate = Date(Date#('12/31/2015','MM/DD/YYYY'),'MM/DD/YYYY');
The entire code runs financial numbers based on a specific data source. Originally I had a version of this QVW for each data source. However, as often goes with financials the QVW constantly needs to be refined. So I merged them all into one code. I broke the Code up into different tabs so I can turn off the sources I don't want.
What I want to do is try to se a variable, either in the code, like this,
Let vROIType = 'Vendor';
or using the method answered in my first attempt at this question where the variable is defined on the designer side using a button.
The hope is that when the variable is set, then only the code associated with that variable will run in the reload and the other code will be skipped.
In my research I tried to create functions in the script and use code to call them, however the call would always error out. I also read about QVDs but many of my date variables are defined at the start of running it, and the QVD needs to be pre-run.
Any help would be appreciated.
As long as you wrap the appropriate sections of the script in the conditionals properly, this should accomplish it:
Create a variable via the Variable Overview window (ctrl + alt + v) like you mentioned to reference the correct script to be reloaded (vROIType)
Create a button or text box and set an action to change the value of the vROIType variable. You can just make two buttons so you can select the correct data source by clicking the appropriate button.
Either reload via the menu or create another text box/button with an action to reload your script.
Most importantly, use conditionals in your script to selectively run the correct portions based on the vROIType variable.
if vROIType = 'Vendor' then
Everything in the script you want run when the source is `Vendor`.
elseif vROIType = 'SomeOtherVendor' then
Everything in the script you want run when the source is ....
end if;
Upon reload, the script will look at the vROIType variable and use that to determine whether or not to run parts of the script. Here's a link to a simple example you can try if you have the paid version of Qlikview, otherwise it'll yell at you that you can't open third party .qvw's.

Dynamic sections of Words documents and mapping to XML documents

I've been working on generating Word documents by using XML, an XSD schema, and a Word document project. The simple scenario is an invoice with invoice line items. I'm able to create content controls and by using the tutorials at MSDN, I've been able to pop open a document and see the top level items, such as billing address, shipping address, etc. My question now, though, is I'm getting into the dynamic part, the part where the invoice line items are displayed. An invoice obviously has one or more invoice line items. I don't see any datagrid-like object that I just bind a list to, so I started going down the route of finding where the table that should contain the invoice line items begins, and start adding PlainTextControls to the document. This requires that I find the exact paragraph location to start inserting and I'm not sure if it will work longterm if the document ever changes. Here's the relavent code:
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
this.Paragraphs[47].Range.InsertParagraphBefore();
this.Paragraphs[47].Range.Select();
PlainTextContentControl ctl = vstoDoc.Controls.AddPlainTextContentControl("textControl1");
ctl.PlaceholderText = "Enter your first name";
With this code, I can start to work on adding invoice line items to the document, but this feels like a hack, keeping track of the which paragraph I'm on, and then what happens when I have too many lines for the table that I've created? Do I start adding lines to the document through code?
Before I go too far down this rabbit hole, I wanted to make sure that this was the prescribed method and I just have to suck it up and keep track of paragraphs, lines, etc. Am I on the right track or should I be doing something different?

Pick a random name from a text file in VB

I have a file that has names of competitors. I want to write a VB code that selects a random name from the file.What I need is show the names moving quickly once I press enter it will select the name. I hope you got the idea.
If i understand your problem correctly you want to show every names on the file to the user on a button which name is chances rapidly.
If you want to do this little trick you need to load all the names from the file at the begging and keep them in a array so you will not need to reconnect to the file, that contains your names, every time you change the name of the button
Once you get the names you will need to create an infinite loop and attach a timer so the loop will wait for a specific time to change the name of the button.
last thing that you need to do is write a set of code under the button. That breaks the loop and gives the name of the button which was the assigned name at the time of the clicking.
I hope that helps you!
Have a good day