Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Nast in program

Former Member
0 Kudos

Hello,

I want to use the attribute OBJKY in NAST.But how do I use the structure NAST in my prgoram.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi shah,

SELECT SINGLE *

FROM nast

WHERE objky = p_vbeln AND

kappl = 'V3' AND

kschl = 'ZSMT' OR kschl = 'ZPDV'.

Revert back incase of doubts...

Regards,

manas

21 REPLIES 21

former_member555112
Active Contributor
0 Kudos

Hi,

Can you be more specific?

Where do you need NAST?

Is it for some data declaration then you can directly use type NAST.

regards,

Ankur Parab

0 Kudos

In transaction vf02 i m giving billing doc number which is getting stored in NAST-OBJKY but how do i store the value of NAST-OBJKY in a variable

0 Kudos

Just declare a structure NAST in your smartform. Whenever u will open VF03 for printing the value of the invoice doc no. will go into NAST.

You can see the standard driver program for invoice printing, and search for NAST u will get a better idea how it is used.

0 Kudos

HI,

Just declare a variable of type NA_OBJKEY or of type NAST-OBJKY and use the same.

regards,

Ankur Parab

Former Member
0 Kudos

Hi,

NAST is table holding the Message status. i.e. while issuing the message of an delivery, or billing or sales documents etc.. to the customer or vendor etc.. that is partners available in the system using the various mediums like print, email, fax, idoc etc..

Based on your requirement with respect to the message type, you can use this table.

Regards,

Santhosh.

Former Member
0 Kudos

Hi shah,

SELECT SINGLE *

FROM nast

WHERE objky = p_vbeln AND

kappl = 'V3' AND

kschl = 'ZSMT' OR kschl = 'ZPDV'.

Revert back incase of doubts...

Regards,

manas

0 Kudos

Thanks MANAS,

Your solution was helpful. I tried to run the following program.

DATA p_vbeln TYPE vbeln.

SELECT SINGLE OBJKY FROM NAST INTO p_vb.

But I am getting different value rather than the billing document no.

Is there any casting required.

0 Kudos

Hi shah,

Declare tables : nast.

Then data declaration for nast fields.

use p_vbeln in your select statement.

Then,

FORM populate_nast.

CLEAR: nast-uhrvr ,

nast-cmfpnr,

nast-datvr .

nast-mandt = '320'.

nast-kappl = 'V3'.

nast-kschl = 'ZSMT'.

nast-objky = p_vbeln.

nast-ldest = 'LOCL'.

nast-anzal = 1.

nast-nacha = '1'.

nast-vsztp = '4'.

nast-spras = 'E'.

nast-vstat = '0'.

nast-manue = 'X'.

nast-dimme = ' '.

nast-erdat = sy-datum.

nast-eruhr = sy-uzeit.

nast-usnam = sy-uname.

nast-tdreceiver = sy-uname.

CONCATENATE sy-uzeit+2(4) 'PDF' INTO nast-dsnam.

endform.

Revert back if you need any help.

Re,Manas

0 Kudos

DATA p_vbeln TYPE vbeln.

SELECT SINGLE OBJKY FROM NAST INTO p_vb.

use,

SELECT SINGLE OBJKY FROM NAST INTO p_vb

where objky = p_vbeln.

0 Kudos

Hi manas

I m getting value in NAST-OBJKY. But i want to store the value in NAST-OBJKY in a variable of type vbeln. NAST-OBJKY will contain billing document number.

I used the statement

SELECT SINGLE OBJKY FROM NAST INTO p_vb.

But in p_vb the value is differenct than billing document no. though the value in objky corresponds to billing document number

Edited by: sgrshah on Jun 23, 2009 9:11 AM

0 Kudos

Hi,

You will have to get the value of NAST-OBJKY into a variable of the same type and the pass it to a variable of type VBELN.

Regards,

Ankur Parab

0 Kudos

Hi ankur,

As u said i created a variable of type nast-objky and assigned the value of that variable into another variable of type vblen but still same problem I m getting different number then billing document no.

Is there any type cast required .

0 Kudos

Hi shah,

vbeln if of char 30 and objky is of char 10.

so declare your variables as char. i.e. p_vb(30) type c and try.

If not working plz elaborate your requirement so that i can help you.

0 Kudos

Hi,

VBELN is of length 10. So you will have to take the first 10 characters of OBJKY.

Can you share your code?

Regards,

Ankur Parab

0 Kudos

I am vf02 and generating a customized smartform. This smart form I am calling from a program ZXX_xxx

So when i enter billing doc in vf02 i need to pass the value in the smartform which has the parameter

billng document no.

Now my problem is I got the value from NAST-OBJKY but how do I story the value in a variable and pass in the standard smart form.

I tried using the variable of type NAST-OBJKY but still thats not working

0 Kudos

Sorry Shah,

vbeln of length 10 and objky of 30.

declare all your variables as char. your problem will be solved.

or paste your code.

0 Kudos

Here is the code

data: p_vb(30) TYPE c.

DATA: ob TYPE nast-objky.

SELECT SINGLE OBJKY FROM NAST INTO p_vb.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSG_SMARTFORM_VF02'

IMPORTING

FM_NAME = FNAM

CALL FUNCTION FNAM

EXPORTING

p_vbeln = p_vb

0 Kudos

Hi,

I suppose you should have some where clause in your query.

The table NAST stores a lot of records.

Your current select query will just give you one record which need not be VBELN.

Regards,

Ankur Parab

0 Kudos

Now I am able to use the structue Nast using the following line.

TABLES NAST.

Former Member
0 Kudos

Hi,

data: w_obj type nast-objky,

select single objky

from nast

into w_obj

where <condition>.

As dbtab nast contains a no. of entries.. select single would retreive the first rec itslf..

in order to retreive the corresponding billing doc num u cn specify sme conditions based on fields

of nast like tcode, erdat etc.. thn assign w_obj to the req vbeln field..

Regards.

Former Member
0 Kudos

By using TABLES NAST. Now I can use the structure in my programme and i have change the parameter type to nast-objky