Skip to Content
author's profile photo Former Member
Former Member

Anyone know what this code is doing?

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?????

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Feb 03, 2005 at 03:43 PM

    NAST is a table that is used for output(printing of documents). You usually see this in print programs for SAPscripts. I think someone has led you down the wrong path.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 03, 2005 at 05: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2005 at 07: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.