cancel
Showing results for 
Search instead for 
Did you mean: 

Update NAST-VSZTP at runtime

former_member628326
Discoverer
0 Kudos
1,345

I have got a requirement wherein I have to update dispatch time from 3 to 4 for a sales order based on some conditions before saving the order. For example if dispatch time is 3 - 'Send with application own transaction', after clicking save, it should be modified to 4 - 'Send immediately' and output should be processed immediately.

I tried using FM 'RV_MESSAGE_UPDATE_SINGLE' in user exit 'USEREXIT_SAVE_DOCUMENT_PREPARE', but it doesn't processes the output.

Any help would be appreciated. Many thanks!

Accepted Solutions (1)

Accepted Solutions (1)

FredericGirod
Active Contributor
0 Kudos

This is typically something to be done with customizing

Try transaction VV12 to specify by key if you would like a 3 or a 4

and in transaction NACE to specify new keys

former_member628326
Discoverer
0 Kudos

Thank you for your reply.

I have a condition. If this condition gets satisfied, only then I want it to be a 4. in VV12 it is configured with a 3. But based on some conditions I need the output to get processed with 4. Please see my code below in the exit-

When I debugged, it's updating NAST correctly. But the output doesn't get processed immediately.

IF NOT l_v_objky IS INITIAL.
   IF xvbak-zstatcode  EQ 'CN'.
       IF l_wa_NAST-VSTAT NE 1.
          IF l_v_delv_type EQ 'S'.
              l_wa_NAST-vsztp = 4.

                MODIFY l_t_NAST FROM l_wa_NAST INDEX 1 TRANSPORTING VSZTP.

                CALL FUNCTION 'RV_MESSAGE_UPDATE_SINGLE'

                EXPORTING
               msg_nast       = l_wa_NAST
               COMMIT WORK.
            ENDIF.
       ENDIF.
   ENDIF.
ENDIF.
<br>
FredericGirod
Active Contributor
0 Kudos

@ deven.shah2401 looks here for example

https://blogs.sap.com/2013/01/23/enhancing-the-condition-table-field-catalog-for-output-billing/

if you add the field ZSTATCODE to the condition, you will be able to specify in VV12 VSZTP to 3 or 4

Answers (0)