2005 Feb 03 3:40 PM
Howdy,
Don't suppose ya know what this code could be doing:
TABLES: nast,
*nast.
SELECT * FROM *nast
WHERE kappl = nast-kappl
AND objky = nast-objky
AND kschl = nast-kschl
AND spras = nast-spras
AND parnr = nast-parnr
AND parvw = nast-parvw.
IF *nast-vstat = 1.
processed = 'X'.
ENDIF.
ENDSELECT.
CHECK processed NE 'X'.
Its got me stumped! what on earth is *NAST?
Are we simply looping through all the entries in NAST???
Basically I came across this code because I am trying to write a program that gets triggered when the user saves a Debit note.
My program should then take the billing document number that was saved and use it to create a credit memo request, but finding the billing document number was a pain and someone told me that I had to use NAST or something...
ANyhow, I came a cross the following code but it doesn't make sense...
I think it should be
TABLES: nast.
data: wa_nast type NAST.
SELECT single * FROM nast into wa_nast
WHERE kappl = nast-kappl
AND objky = nast-objky
AND kschl = nast-kschl
AND spras = nast-spras
AND parnr = nast-parnr
AND parvw = nast-parvw.
IF nast-vstat = 1.
processed = 'X'.
ENDIF.
What do you all think?????
2005 Feb 03 3:43 PM
2005 Feb 03 3:58 PM
Thanks Rich,
May be you are right or may be I didn't amke myself clear.
I think my program will be connected to the output type via transaction NACE. Then whenever the user saves a debit memo it will trigger the output type and this should then trigger my program to produce the BDC based on the billing document number in the debit memo.
I thought this would be passed into nast-objkey and I thought I would write an entry routine that could be placed in NACE that access my program.
AM I correct in thinking that this would work????
2005 Feb 03 4:34 PM
2005 Feb 03 5:49 PM
Hi Steve,
yes, I agree: your select single ... should bring same result as this select ... endselect code.
But going one step further: isn't NAST read (completly and directly!) before calling this program part? Should be possible to test nast-vstat = 1 without additional select.
Regards,
Christian
P.S.: Got the feeling to translate word by word, sorry for this grammar.
2005 Feb 03 7:03 PM
The ability to put an asterisk in front of the name is indeed a feature carried over from R/2. It solves the problem of allowing you to create a second TABLEs work area based on a dictionary definition. You could think of it as TABLES: *NAST type NAST.
The memory for TABLES is handled differently than the memory for DATA so that is why you might want more than one work area in the TABLES space based on a common structure.