Skip to Content
0
Former Member
Dec 04, 2006 at 05:39 AM

UPDATE NAST

506 Views

Hi all, i'm using this coding to update nast table for Purchase Order .This coding is not working.

please help me to solve this problem.

Your help is greatly appreciated.

tables nast.

nast-MANDT = sy-mandt.

nast-KAPPL = 'EF'.

nast-OBJKY = '4100000477'.

nast-KSCHL = 'NEU'.

nast-SPRAS = sy-langu.

nast-PARNR = '0000100165'.

nast-PARVW = 'LF'.

nast-ERDAT = sy-datum.

nast-ERUHR = sy-uzeit.

nast-NACHA = '1'.

nast-ANZAL = '0'.

nast-VSZTP = '1'.

nast-MANUE = 'X'.

nast-USNAM = sy-UNAME.

nast-VSTAT = '0'.

nast-LDEST = 'HOIT'.

nast-TDID = 'BEWG'.

nast-TDSPRAS = sy-langu.

nast-NAUTO = 'X'.

nast-TDRECEIVER = sy-UNAME.

nast-TDCOVTITLE = 'New Purchase Order Printout'.

CALL FUNCTION 'NAST_SAVE_OBJECT'

EXPORTING

pi_nast = nast

PI_LINK_OBJECT = 'X'

PI_PROCESSING = 'X'

EXCEPTIONS

NOT_SAVED = 1

OTHERS = 2

.

IF sy-subrc <> 0.

write: / 'NOT SAVED'.

ELSE.

write: / 'SAVED'.

ENDIF.

IF sy-subrc = 0.

COMMIT WORK.

write / 'TABLE "NAST" WAS UPDATED'.

else.

rollback work.

write / 'TABLE "NAST" WAS NOT UPDATED'.

endif.