on 01-11-2011 12:33 PM
Hello
I'm attempting to extract records from the table VBFA and my inexperience with Smartforms is start to show.
I only want to have 1 record per handling unit. I'm extracting using VBELV, VBELN and VBTYP_N via SELECT * FROM VBFA.
However this gives me multiple records per handling unit. There is no further field available on the record to make it unique. This is were my inexperience comes in. How do I perform the read of VBFA without using SELECT.?
Regards
Mike.
Hardcode the '000000' for the item fields of the primary key in the SELECT statement as well, assuming you have links at the header level. Otherwise, if this is at the item level (handling units), use SELECT SINGLE or EXIT to get a single entry in your form code with the item number of the source document.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Brad,
Thanks for taking the time to reply.
I am accessing the handling units at item level and selecting the records into my own internal table which I will subsequently use to print the handling units and their contents.
If I select single for say the first record in the database using the keys that I have. How do I then select the next subsequent record(s).
Is there no way of manually reading a database table perhaps within a loop. I could compare next record read with previous record then discard is necessary?
Regards
Mike.
You can handle it the same way you would in any program code, either in your initialization tab code or in a code node. Whether that's in a SELECT...ENDSELECT loop with an append for the records you want or a full SELECT into a table then removal or skipping of the records you don't want. I'm guessing your end result needs to be an internal table for a loop node, so you just need to get to that point. Sorry, since I don't know what the trigger is for the SELECT, I can't be exact.
Hello Brad,
You're right, I'm trying to get am internal table to use a loop node.
I'd like to go for the full SELECT into a table then read it and either a skip or ignore a record that is a duplication. I'm not sure of the way to achieve this though. This is the first time I've had to manipulate the data like this. Until now I've had the keys to select the data for me.
I've currently got:
SELECT * FROM VBFA INTO TABLE LT_VBFA
WHERE VBELV = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB
AND VBTYP_N = 'X'.
Then I have LT_VBFA INTO WA_VBFA in a LOOP node .
There needs to be some thing between the 2 nodes to prune the unwanted duplicates.
Regards
Mike.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.