Application Development and Automation 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: 
Read only

User exit save_document in delivery

former_member582701
Contributor
0 Likes
906

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.

2 REPLIES 2
Read only

Former Member
0 Likes
673

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?

Read only

Former Member
0 Likes
673

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