Last night I promised myself learning ABAP and offer 2 Abap books. ![]()
Anshu, my types and data declaration I am needing further right ?
So, the whoel coding included your suggestion should be
TYPES: BEGIN OF l_s_mescodes,
bp_contper TYPE /BI0/ACRM_OPPH00-bp_contper,
crm_ohguid TYPE /BI0/ACRM_OPPH00-crm_ohguid,
crm_prospe TYPE /BI0/ACRM_OPPH00-crm_prospe,
sales_off TYPE /BI0/ACRM_OPPH00-sales_off,
sales_grp TYPE /BI0/ACRM_OPPH00-sales_grp,
staoneoppt TYPE /BI0/ACRM_OPPH00-staoneoppt,
/bic/spvunr TYPE /BI0/ACRM_OPPH00-/bic/spvunr,
calday TYPE /BI0/ACRM_OPPH00-calday,
crm_opstat TYPE /BI0/ACRM_OPPH00-crm_opstat,
crm_opptyp TYPE /BI0/ACRM_OPPH00-crm_opptyp,
crm_obj_id TYPE /BI0/ACRM_OPPH00-crm_obj_id,
crm_prctyp TYPE /BI0/ACRM_OPPH00-crm_prctyp,
crm_curren TYPE /BI0/ACRM_OPPH00-crm_curren,
crm_numdoc TYPE /BI0/ACRM_OPPH00-crm_numdoc,
calday_cl TYPE /BI0/ACRM_OPPH00-calday_cl,
crm_objtyp TYPE /BI0/ACRM_OPPH00-crm_objtyp,
crm_refcur TYPE /BI0/ACRM_OPPH00-crm_refcur,
staonesys4 TYPE /BI0/ACRM_OPPH00-staonesys4,
distr_chan TYPE /BI0/ACRM_OPPH00-distr_chan,
division TYPE /BI0/ACRM_OPPH00-division,
crm_salgrp TYPE /BI0/ACRM_OPPH00-crm_salgrp,
crm_saloff TYPE /BI0/ACRM_OPPH00-crm_saloff,
crm_salorg TYPE /BI0/ACRM_OPPH00-crm_salorg,
crm_actcat TYPE /BI0/ACRM_OPPH00-crm_actcat,
staonesys0 TYPE /BI0/ACRM_OPPH00-staonesys0,
fiscvarnt TYPE /BI0/ACRM_OPPH00-fiscvarnt,
/bic/zretcust TYPE /BI0/ACRM_OPPH00-/bic/zretcust,
/bic/zretcustk TYPE /BI0/ACRM_OPPH00-/bic/zretcustk,
bpcontdep TYPE /BI0/ACRM_OPPH00-bpcontdep,
bpcontfct TYPE /BI0/ACRM_OPPH00-bpcontfct,
/bic/zcrveragr TYPE /BI0/ACRM_OPPH00-/bic/zcrveragr,
END OF l_s_mescodes.
DATA: l_t_mescodes TYPE STANDARD TABLE OF l_s_mescodes,
wa_mescodes TYPE l_s_mescodes.
SELECT
bp_contper crm_prospe sales_off crm_ohguid sales_grp staoneoppt
/bic/spvunr calday crm_opstat crm_opptyp crm_obj_id crm_prctyp crm_curren
crm_numdoc calday_cl crm_objtyp crm_refcur staonesys4 distr_chan division crm_salgrp crm_saloff
crm_salorg crm_actcat staonesys0 fiscvarnt /bic/zretcust /bic/zretcustk bpcontdep
bpcontfct /bic/zcrveragr
FROM /BI0/ACRM_OPPH00
INTO CORRESPONDING FIELDS OF TABLE l_t_mescodes
WHERE bp_contper = RESULT_PACKAGE-bp_contper.
loop at RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
READ TABLE l_t_mescodes into wa_mescodes WITH KEY
bp_contper = <RESULT_FIELDS>-bp_contper.
if sy-subrc = 0.
<result_fields>-crm_prospe = wa_mescodes-crm_prospe.
<result_fields>-sales_off = wa_mescodes-sales_off.
<result_fields>-crm_ohguid = wa_mescodes-crm_ohguid.
<result_fields>-sales_grp = wa_mescodes-sales_grp.
<result_fields>-staoneoppt = wa_mescodes-staoneoppt.
<result_fields>-/bic/spvunr = wa_mescodes-/bic/spvunr.
<result_fields>-calday = wa_mescodes-calday.
<result_fields>-crm_opstat = wa_mescodes-crm_opstat.
<result_fields>-crm_opptyp = wa_mescodes-crm_opptyp.
<result_fields>-crm_obj_id = wa_mescodes-crm_obj_id.
<result_fields>-crm_prctyp = wa_mescodes-crm_prctyp.
<result_fields>-crm_curren = wa_mescodes-crm_curren.
<result_fields>-crm_numdoc = wa_mescodes-crm_numdoc.
<result_fields>-crm_objtyp = wa_mescodes-crm_objtyp.
<result_fields>-crm_refcur = wa_mescodes-crm_refcur.
<result_fields>-staonesys4 = wa_mescodes-staonesys4.
<result_fields>-distr_chan = wa_mescodes-distr_chan.
<result_fields>-division = wa_mescodes-division.
<result_fields>-crm_salgrp = wa_mescodes-crm_salgrp.
<result_fields>-crm_saloff = wa_mescodes-crm_saloff.
<result_fields>-crm_salorg = wa_mescodes-crm_salorg.
<result_fields>-crm_actcat = wa_mescodes-crm_actcat.
<result_fields>-staonesys0 = wa_mescodes-staonesys0.
<result_fields>-fiscvarnt = wa_mescodes-fiscvarnt.
<result_fields>-/bic/zretcust = wa_mescodes-/bic/zretcust.
<result_fields>-/bic/zretcustk = wa_mescodes-/bic/zretcustk.
<result_fields>-bpcontdep = wa_mescodes-bpcontdep.
<result_fields>-bpcontfct = wa_mescodes-bpcontfct.
<result_fields>-/bic/zcrveragr = wa_mescodes-/bic/zcrveragr.
ENDIF.
ENDLOOP.
???
A lof thanks for your patience (for all of course)








