Skip to Content
0
Former Member
Mar 07, 2009 at 06:08 AM

Nast field UHRVR time diff. while updating

128 Views

Hi all ,

For some reason i need to update all the invoices falling under same category with same time....say for example the output type is RD00 status yellow technically nast-vstat = '0' for 5 invoices and now i need to update them to green i.e nast-vstat = '1' with same time i.e nast-uhrvr = 'same time' for all invoices....this is not happing and there is a time difference of say about a few seconds......i dont know why.....i even took freezed the time considering it at the begining and assinged it similar but even though its not working......i tried with individual update of invoices using RV_MESSSAGE_UPDATE_SINGLE and now with RV_MESSSAGE_UPDATE....but still goes vain......

Here's my code........plz come up with some solution.........

data: g_tab_nast type standard table of nast,

g_wa_nast type nast,

g_tab_nast_new type standard table of vnast,

g_wa_nast_new type vnast,

l_uzeit type sy-uzeit.

l_uzeit = sy-uzeit.

LOOP AT g_tab_nast INTO g_wa_nast.

MOVE-CORRESPONDING g_wa_nast TO g_wa_nast_new.

CLEAR: g_wa_nast_new-vstat,g_wa_nast_new-uhrvr, g_wa_nast_new-usnam.

g_wa_nast_new-vstat = '1'.

g_wa_nast_new-usnam = sy-uname.

g_wa_nast_new-datvr = sy-datum.

g_wa_nast_new-uhrvr = l_uzeit.

g_wa_nast_new-updat = 'X'.

APPEND g_wa_nast_new TO g_tab_nast_new.

CLEAR:g_wa_nast,g_wa_nast_new.

ENDLOOP.

CALL FUNCTION 'RV_MESSAGE_UPDATE'

TABLES

msg_xnast = g_tab_nast_new

msg_ynast = g_tab_nast

EXCEPTIONS

no_update = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.