Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Question from Emile on Sep 23 at 10:45 AM I have 3 tables and I want to update table aaa with 2 new fields ?1. table aaa. docnum docitem doctype compcode fiscyear fiscquarter fidocnum ?label1 label2 (docnum docitem compcode and fiscyear are the key of this table) 2. table bbb docnum docitem doctype compcode fiscyear fiscquarter fidocnum (docnum docitem compcode and fiscyear are the key of this table) 3. table yyy compcode method dateapplied fidocnum label1 label2 (compcode method dateapplied are the key for this table) I am loading data from table bbb into table aaa. While doing so, i am doing a lookup in table yyy to get label1 and label2 records. Here is my pseudo code (which is not working). What would you do differently? (knowing that this code below doesn't work) *variables declaration* **************** TABLES: /BIC/YYY. DATA: ITAB2 TYPE STANDARD TABLE OF /BIC/YYY. DATA: WA LIKE LINE OF ITAB2. ************** DATA: ITAB_REFRESH TYPE STANDARD TABLE OF _TY_S_TG_1. DATA: ITAB_TARGET TYPE STANDARD TABLE OF _TY_S_TG_1. DATA: WA_TARGET LIKE LINE OF ITAB_TARGET. DATA: ICOUNT TYPE RSARECORD. IF RESULT_PACKAGE IS NOT INITIAL. ICOUNT = 1. REFRESH ITAB2. SELECT * FROM /BIC/YYY INTO TABLE ITAB2 FOR ALL ENTRIES IN RESULT_PACKAGE WHERE fidocnum = RESULT_PACKAGE-fidocnum. SORT RESULT_PACKAGE BY fidocnum. Refresh itab_target. SORT RESULT_PACKAGE BY fidocnum. LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>. LOOP AT ITAB2 INTO WA WHERE fidocnum = <RESULT_FIELDS>-fidocnum. <RESULT_FIELDS>-/BIC/label1 = WA-label1. <RESULT_FIELDS>-/BIC/label2 = WA-label2. <RESULT_FIELDS>-RECORD = ICOUNT. ICOUNT = ICOUNT + 1. APPEND <RESULT_FIELDS> TO ITAB_TARGET. ENDLOOP. ENDLOOP. REFRESH RESULT_PACKAGE. RESULT_PACKAGE[] = ITAB_TARGET[]. ENDIF. | Reply to this email to post your response. __.____._ | In the Spotlight Become a blogger at Toolbox.com and share your expertise with the community. Start today. _.____.__ |