2006 Dec 04 5:39 AM
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.
2006 Dec 04 5:43 AM
Hi,
The following piece of coding should be changed as
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.
<u>Changed code:</u>
IF sy-subrc <> 0.
rollback work.
write / 'TABLE "NAST" WAS NOT UPDATED'.
ELSE.
COMMIT WORK.
write / 'TABLE "NAST" WAS UPDATED'.
ENDIF.
2006 Dec 04 6:33 AM
2006 Dec 04 6:41 AM
When you say 'not working', does it mean, it is giving error or it is not updating NAST table.
2006 Dec 04 6:45 AM
message displayed:
TABLE "NAST" WAS UPDATED
but not updated in database
2006 Dec 04 6:48 AM
I think you need to use NAST_MAIL_COMMIT which is used after this FM.
2006 Dec 04 6:54 AM
can i use 'NAST_MAIL_COMMIT'
instead of 'NAST_SAVE_OBJECT' FM ?
2006 Dec 06 10:57 AM
No, you need to use NAST_MAIL_COMMIT after using NAST_SAVE_OBJECT
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |