on 2016 Oct 26 6:47 AM - last edited on 2024 Feb 03 6:20 PM by postmig_api_4
Dear gurus, I need to merge two internal tables according to BEGDA&ENDDA. I believe, the best way to do this is to use PROVIDE. But I am not completely understanding how to do this.
Here is my code, kindly help me to do the merge in the correct way.
Thanks in advance.
types:
BEGIN OF ty_tab,
plans TYPE plans,
wbs TYPE sobid,
begda TYPE begda,
endda TYPE endda,
END OF ty_tab,
data: lt_tab1 type table of ty_tab,
lt_tab2 type table of ty_tab,
lt_merge type table of ty_tab.
data: ls_tab1 type ty_tab,
ls_tab2 type ty_tab,
ls_merge type ty_tab.
data: lv_flag1 type flag,
lv_flag2 type flag.
*** Filling Data In Tables ***
...
PROVIDE FIELDS *
FROM lt_tab1 INTO ls_tab1 VALID lv_flag1
BOUNDS begda AND endda
FIELDS *
FROM lt_tab2 INTO ls_tab2 VALID lv_flag2
BOUNDS begda AND endda
BETWEEN ls_tab1-begda AND ls_tab1-endda.
IF lv_flag1 = abap_true AND lv_flag2 = abap_true.
ls_merge-begda = ls_tab1-begda.
ls_merge-endda = ls_tab1-endda.
ls_merge-plans = ls_tab1-plans.
ls_merge-wbs = ls_tab1-wbs.
APPEND ls_merge TO lt_merge.
ENDIF.
ENDPROVIDE.
Request clarification before answering.
User | Count |
---|---|
60 | |
9 | |
8 | |
7 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.