‎2012 May 02 10:31 AM
Hi,
I have created an abap program in BW to compare the G/L figure between BCS and ECC.
My problem now is, the RFC function module in BW does not return the exact G/L account as what been send.
I have sent 143 G/L account to the fnction module, but the return from ECC is only 130++.
When I direct run in ECC using the same 143 G/L account, I manage to get all the 143 data.
So, I assume no problem with the function module... unless, got some hidden thing saying that for RFC mode, need to clear or do something.
trust me, I have tried manipulate everything, but still got missing G/L account from the ECC.
I don't know either this can help or not... when I tried pass less than 10 G/L account, I manage to get all the 9 accounts.
but when i tried with 10 account, then got this missing thing. weird rite?!!
please, I really need your advice on this.. for me the coding is correct, but now the return from ECC to BW got problem.
somebody ask me to debug this function module. the problem is, my RFC user id is system id and not dialog id.
so, i cannot set debug mode in the function module. to change the RFC user id, I need to liaise with the basis team and afraid effect to other RFC connection.
ok thanks
‎2012 May 02 11:09 AM
Hi Sumaiya,
Did you write any collect statement in your program. if not then send me your code let me check what is the problem. recently i did same scenario APO server to R/3.
Thnaks
Nayan
‎2012 May 02 11:09 AM
Hi Sumaiya,
Did you write any collect statement in your program. if not then send me your code let me check what is the problem. recently i did same scenario APO server to R/3.
Thnaks
Nayan
‎2012 May 03 3:35 AM
Hi Nayan,
yes, i have collect statement in my program. below is the code for my function module in ECC.
appreciate if you could comment on it.
thanks a lot..
function z_ecc_bcs_read.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_MEMORY) TYPE CHAR1 OPTIONAL
*" EXPORTING
*" VALUE(E_ZCABCS01) TYPE ZCABCS02
*" TABLES
*" T_BUKRS STRUCTURE RSDSSELOPT
*" T_SAKNR STRUCTURE RSDSSELOPT
*" T_LEDGER STRUCTURE RSDSSELOPT
*" T_YEAR STRUCTURE RSDSSELOPT
*" T_PERIOD STRUCTURE RSDSSELOPT
*" EXCEPTIONS
*" SYSTEMFAILURE
*" COMMUNICATIONFAILURE
*"----------------------------------------------------------------------
ranges: rg_ktopl for ska1-ktopl,
rg_bukrs for skb1-bukrs,
rg_bilkt for ska1-bilkt,
rg_saknr for ska1-saknr,
rg_cpriod for bkpf-monat.
types: begin of ty_down,
text(2000) type c,
end of ty_down.
data: tp_gjahr type gjahr,
tp_cgjahr type gjahr,
tp_line type i,
tp_tline type i,
tp_cnt(1) type i,
tp_string type string,
tp_wrbtr(16),
tp_saknr type saknr,
tp_ledger type rldnr,
ta_file_split(255) occurs 0 with header line,
ta_tab type table of abaplist,
ta_tab2 type table of ty_down with header line,
wa_tab2 type ty_down,
wa_zcabcs01 like line of e_zcabcs01,
ta_ska1 type ska1 occurs 0 with header line.
call function 'LIST_FREE_MEMORY'.
refresh: rg_ktopl, rg_bilkt, ta_ska1, rg_saknr, rg_cpriod, ta_tab, ta_tab2, e_zcabcs01.
* chart of account
rg_ktopl-sign = 'I'.
rg_ktopl-option = 'EQ'.
rg_ktopl-low = '1000'.
append rg_ktopl.
* reporting year
read table t_year index 1.
tp_gjahr = t_year-low.
* ledger
read table t_ledger index 1.
tp_ledger = t_ledger-low.
* to get ECC G/L account based on BCS bank account number
rg_bilkt-sign = 'I'.
rg_bilkt-option = 'EQ'.
loop at t_saknr.
rg_bilkt-low = t_saknr-low.
append rg_bilkt.
endloop.
select * from ska1 into table ta_ska1
for all entries in rg_bilkt
where ktopl = '1000'
and bilkt = rg_bilkt-low.
rg_saknr-sign = 'I'.
rg_saknr-option = 'EQ'.
loop at ta_ska1.
rg_saknr-low = ta_ska1-saknr.
append rg_saknr.
endloop.
* comparison year and period
rg_cpriod-sign = 'I'.
rg_cpriod-option = 'BT'.
rg_cpriod-low = '01'.
read table t_period index 1.
if t_period-high = '1' or t_period-high = '01'.
rg_cpriod-high = '12'.
tp_cgjahr = tp_gjahr - 1.
else.
rg_cpriod-high = t_period-high - 1.
tp_cgjahr = tp_gjahr.
endif.
append rg_cpriod.
* call transaction f.01
submit rfbila00
with sd_ktopl in rg_ktopl
with sd_saknr in rg_saknr
with sd_bukrs in t_bukrs
with sd_rldnr-low eq tp_ledger
with bilavers eq '1000'
with bilbjahr eq tp_gjahr
with b-monate in t_period
with bilvjahr eq tp_cgjahr
with v-monate in rg_cpriod
with bilagrid eq 'X'
with bilagvar eq '/ZBUKRS'
exporting list to memory and return.
call function 'LIST_FROM_MEMORY'
tables
listobject = ta_tab
exceptions
not_found = 1
others = 2.
if sy-subrc <> 0.
else.
check ta_tab is not initial.
call function 'LIST_TO_ASCI'
tables
listasci = ta_tab2
listobject = ta_tab
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
endif.
* to populate the zcabcs01
check ta_tab2[] is not initial.
describe table ta_tab2 lines tp_tline.
loop at ta_tab2 into wa_tab2.
clear tp_cnt.
refresh ta_file_split.
tp_line = tp_line + 1.
if tp_line = tp_tline.
exit.
endif.
check tp_line >= 15.
tp_string = wa_tab2-text.
split tp_string at '|' into table ta_file_split.
loop at ta_file_split.
add 1 to tp_cnt.
case tp_cnt.
when '2'.
wa_zcabcs01-bukrs = ta_file_split.
when '3'.
tp_saknr = ta_file_split.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = tp_saknr
importing
output = tp_saknr.
loop at ta_ska1 where saknr = tp_saknr.
wa_zcabcs01-saknr = ta_ska1-bilkt.
exit.
endloop.
when '4'.
loop at rg_saknr where low = wa_zcabcs01-saknr.
wa_zcabcs01-text = ta_file_split.
exit.
endloop.
if sy-subrc <> 0.
select single txt50 from skat into wa_zcabcs01-text
where spras = 'EN' and ktopl = '1000'
and saknr = wa_zcabcs01-saknr.
endif.
when '5'.
tp_wrbtr = ta_file_split.
translate tp_wrbtr using ', '.
condense tp_wrbtr no-gaps.
wa_zcabcs01-amount = tp_wrbtr.
when '6'.
wa_zcabcs01-waers = ta_file_split.
endcase.
endloop.
wa_zcabcs01-client = sy-mandt.
collect wa_zcabcs01 into e_zcabcs01.
endloop.
endfunction.
‎2012 May 03 6:04 AM
Hi Sumaiya,
Actually I can not understand any thing from your program. As you write Collect statement in side the loop it is adding all numeric component for same G/L account for same fiscal year.
Regards
Nayan
‎2013 Apr 18 3:31 AM
long time solved by debugging and tracing the input output parameter between ECC and BW.