2015 May 07 10:58 AM
Hello guys,
I have a problem, we have a programm and the updates to the first database "edpar" does...fine.
But I need to update some data for some kind of recording protocol to another new zdatabase.
IF aendern EQ 'X' AND t_tab3 IS NOT INITIAL.
UPDATE edpar FROM TABLE t_tab3.
IF sy-subrc EQ 0.
LOOP AT t_zix_log INTO s_zix_log.
s_zix_log-inpnr_alt = <tab>-inpnr.
s_zix_log-bname = sy-uname.
s_zix_log-datum = sy-datlo.
s_zix_log-time = sy-uzeit.
ENDLOOP.
s_zix_log-expnr = s_tab3-expnr.
s_zix_log-parvw = s_tab3-parvw.
s_zix_log-kunnr = s_tab3-kunnr.
s_zix_log-inpnr_neu = s_tab3-inpnr.
UPDATE zix_edpar_log From s_zix_log.
IF sy-subrc EQ 0.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
ENDIF
Changes are only updated if they're done at the last line of the t_tab3 , if I change inpnr of line before that nothing comes up to my database
zix_edpar_log. And I don't get the inpnr from <tab> or even the sy-uname/datlo and time is always 00:00:00 .
Please help I am only student
Thanks
2015 May 07 11:51 AM
Hello guys,
I have a problem, we have a programm and the updates to the first database "edpar" does...fine.
But I need to update some data for some kind of recording protocol to another new zdatabase.
IF aendern EQ 'X' AND t_tab3 IS NOT INITIAL.
UPDATE edpar FROM TABLE t_tab3.
IF sy-subrc EQ 0.
LOOP AT t_zix_log INTO s_zix_log.
s_zix_log-inpnr_alt = <tab>-inpnr.
s_zix_log-bname = sy-uname.
s_zix_log-datum = sy-datlo.
s_zix_log-time = sy-uzeit.
ENDLOOP.
s_zix_log-expnr = s_tab3-expnr.
s_zix_log-parvw = s_tab3-parvw.
s_zix_log-kunnr = s_tab3-kunnr.
s_zix_log-inpnr_neu = s_tab3-inpnr.
UPDATE zix_edpar_log From s_zix_log.
IF sy-subrc EQ 0.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
COMMIT WORK AND WAIT.
ELSE.
ROLLBACK WORK.
ENDIF.
ENDIF
Changes are only updated if they're done at the last line of the t_tab3 , if I change inpnr of line before that nothing comes up to my database
zix_edpar_log. And I don't get the inpnr from <tab> or even the sy-uname/datlo and time is always 00:00:00 .
Please help I am only student
Thanks
2015 May 07 11:49 AM
Dear Andre,
First understand the purpose of loop.
LOOP AT t_zix_log INTO s_zix_log.
s_zix_log-inpnr_alt = <tab>-inpnr.
s_zix_log-bname = sy-uname.
s_zix_log-datum = sy-datlo.
s_zix_log-time = sy-uzeit.
ENDLOOP.
Please check what your logic.
Because if your internal table contain 5 line's ur s_zix_log structure contains only last value.
and
<tab>-inpnr always contains blank because you have to assign some value to Field symbol.
Thanks
Nishant
2015 May 07 11:51 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |