2007 Apr 19 10:51 AM
Hi,
I have programmed the user exit userexit_save_document in include MV50AFZ1 for deliveries. When i save the document i insert an entry in NAST table.
The problem is that a job, out of my control, is modifying the deliveries and inevitably when they save the delivery my user exit is excuted and other entry is inserted in NAST table. I don't want this entry.
Are there any variable in this include that tell u if delivery is beeing saved or modified?
The code:
FORM userexit_save_document.
DATA: wa_nast LIKE NAST.
IF VBAK-AUART = 'ZLC' OR
VBAK-AUART = 'ZOC' OR
VBAK-AUART = 'ZCS'.
wa_nast-KAPPL = 'V1'.
wa_nast-OBJKY = LIPS-VGBEL.
wa_nast-KSCHL = 'ZPE2'.
wa_nast-SPRAS = 'S'.
wa_nast-PARNR = '0000CICC01'.
wa_nast-PARVW = 'LS'.
wa_nast-ERDAT = SY-DATUM.
wa_nast-ERUHR = SY-UZEIT.
wa_nast-USNAM = SY-UNAME.
wa_nast-NACHA = '6'.
wa_nast-VSZTP = '1'.
wa_nast-VSTAT = '0'.
wa_nast-NAUTO = 'X'.
wa_nast-OBJTYPE = 'BUS2032'.
CALL FUNCTION 'RV_MESSAGE_UPDATE_SINGLE'
EXPORTING
msg_nast = wa_nast
.
ENDIF.
ENDFORM.
Thx in advance.
Hi,
I have programmed the user exit userexit_save_document in include MV50AFZ1 for deliveries. When i save the document i insert an entry in NAST table.
The problem is that a job, out of my control, is modifying the deliveries and inevitably when they save the delivery my user exit is excuted and other entry is inserted in NAST table. I don't want this entry.
Are there any variable in this include that tell u if delivery is beeing saved or modified?
The code:
FORM userexit_save_document.
DATA: wa_nast LIKE NAST.
IF VBAK-AUART = 'ZLC' OR
VBAK-AUART = 'ZOC' OR
VBAK-AUART = 'ZCS'.
wa_nast-KAPPL = 'V1'.
wa_nast-OBJKY = LIPS-VGBEL.
wa_nast-KSCHL = 'ZPE2'.
wa_nast-SPRAS = 'S'.
wa_nast-PARNR = '0000CICC01'.
wa_nast-PARVW = 'LS'.
wa_nast-ERDAT = SY-DATUM.
wa_nast-ERUHR = SY-UZEIT.
wa_nast-USNAM = SY-UNAME.
wa_nast-NACHA = '6'.
wa_nast-VSZTP = '1'.
wa_nast-VSTAT = '0'.
wa_nast-NAUTO = 'X'.
wa_nast-OBJTYPE = 'BUS2032'.
CALL FUNCTION 'RV_MESSAGE_UPDATE_SINGLE'
EXPORTING
msg_nast = wa_nast
.
ENDIF.
ENDFORM.
Thx in advance.
2007 Apr 19 11:12 AM
I think you can write a code to check entry in database table..During change, this delivery entry will be present so you can avoid making entry in NAST.
Also, since it is delivery document, is it not possible to assign output type directly?
2007 Apr 19 11:17 AM
no need do any thing in SAP standard program, u can create entry(output type) when user saves Delivery ---> how ---> u have to configure ur system like that.
ask ur FC , he can help to out , to assing output type automatically.
Regards
Prabhu