This document contains code to update status fields in a table called TAB_RBKPDIS based on data from other tables. It loops through records in TAB_RBKPDIS, checks the RBKP_BLOCKED table to set a status of 'B' or 'R', and gets additional fields from CDHDR to populate other fields before modifying the TAB_RBKPDIS record.
This document contains code to update status fields in a table called TAB_RBKPDIS based on data from other tables. It loops through records in TAB_RBKPDIS, checks the RBKP_BLOCKED table to set a status of 'B' or 'R', and gets additional fields from CDHDR to populate other fields before modifying the TAB_RBKPDIS record.
DATA l_belnr TYPE belnr_d. CLEAR s_rbkpdis. *----fill field ZFI_MIR_CUST from table tab_rbkpdis----------------* LOOP AT tab_rbkpdis INTO s_rbkpdis. CONCATENATE s_rbkpdis-BELNR s_rbkpdis-GJAHR INTO l_objid. CONDENSE l_objid NO-GAPS. clear l_belnr. SELECT SINGLE belnr INTO l_belnr FROM RBKP_BLOCKED WHERE BELNR = s_rbkpdis-belnr. IF sy-subrc = 0 and l_belnr is not INITIAL. s_rbkpdis-ustatus = 'B'. ELSEif l_belnr is INITIAL. s_rbkpdis-ustatus = 'R'. ENDIF.
SELECT SINGLE USERNAME
UDATE UTIME FROM cdhdr INTO (s_rbkpdis-USERNAME, s_rbkpdis-UDATE, s_rbkpdis-UTIME) WHERE OBJECTCLAS = 'INCOMINGINVOICE' AND OBJECTID = l_objid AND TCODE = 'MRBR'. IF sy-subrc = 0. MODIFY tab_rbkpdis FROM s_rbkpdis. ENDIF. ENDLOOP.