Hi Ankit,
What we have done is determine if we need to go into with MAINAIN_MODE = A or B.
You need to determine the VAKEY. In our solution we know the condition A-tables we want to
update. So we get the VAKEY first.
Then we get the KOMG
CALL FUNCTION 'SD_CONDITION_KOMG_FILL' | ||
EXPORTING | ||
p_kotabnr = ll_kotabnr | ||
p_kvewe = cc_kvewe_pricing | ||
p_vakey = ll_vakey | ||
IMPORTING | ||
p_komg | = ls_komg. |
Then we determine the maintain mode, do a select on knumh
SELECT knumh
datab
datbi FROM konh INTO TABLE lt_konh_db
WHERE vakey = p_vakey.
If there is a knumh then we know if we want to maintain or create.
Then you should have enough info in the komk/komp/komg to pass the values so that the existing record is changed and not added.
CALL FUNCTION 'RV_CONDITION_COPY'
EXPORTING
application = cc_application
condition_table = ll_kotabnr
condition_type = cc_cond_type
date_from = ll_datab
date_to = ll_datbi
* ENQUEUE = ' '
i_komk = ls_komk
i_komp = ls_komp
key_fields = ls_komg
maintain_mode = lc_maintain_mode
Hope this helps.