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

Nast field UHRVR time diff. while updating

Former Member
0 Likes
347

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.

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.

1 REPLY 1
Read only

Former Member
0 Likes
321

I've resolved it myself