Posted: Sat Jan 31, 2009 4:54 pm Post subject: BAPI_PROFITCENTER_CREATE
BAPI_PROFITCENTER_CREATE
Code:
*&---------------------------------------------------------------------*
*& Report ZDCFI0002
*&
*&---------------------------------------------------------------------*
*& Author: Patrick Guo
*& Date : 19 Dec 2006
*&---------------------------------------------------------------------*
report zdcfi0002.
data: begin of itab occurs 0,
prctr like prct_v-prctr,
ref_kokrs like prct_v-ref_kokrs,
datab(8),
datbi(8),
ktext like prct_v-ktext,
ltext like prct_v-ltext,
verak like prct_v-verak,
khinr like prct_v-khinr,
end of itab.
data: profitcenterid like bapi0015id2,
validfrom like bapi0015_3-date,
validto like bapi0015_3-date,
basicdata like bapi0015_4,
language like bapi0015_10.
data: return like bapiret2,
profitcenter like bapi0015id2-profit_ctr,
controllingarea like bapi0015id2-co_area.
data: companycodes like bapi0015_7 occurs 0 with header line.
data: wait like bapita-wait value 'X',
creturn like bapiret2.
data: filetab type filetable,
wa_filetab like file_table,
returncode type i,
count type i,
okrecord type i,
failrecord type i.
data: n_prctr(10) type n.
parameters: r1 radiobutton group g1,
r2 radiobutton group g1.
parameters: codepage type abap_encod default '4110'.
parameters: pmode type c default 'N' obligatory.
*&---------------------------------------------------------------------*
*& Form read_file
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
form read_file .
types: infile type ref to cl_gui_frontend_services.
data: gfile type infile,
fname type string.
create object gfile.
gfile->file_open_dialog( changing file_table = filetab
rc = returncode ).
read table filetab into wa_filetab index 1.
move wa_filetab-filename to fname.
call transaction 'KE52' using bdctab messages into msg_tab options from opt.
select single * from t100 where sprsl = sy-langu
and arbgb = sy-msgid
and msgnr = sy-msgno.
if sy-subrc = 0.
replace '&1' in t100-text with sy-msgv1.
replace '&2' in t100-text with sy-msgv2.
replace '&3' in t100-text with sy-msgv3.
replace '&4' in t100-text with sy-msgv4.
if sy-msgty = 'E'.
format color col_negative.
write: / count, t100-text.
format color off.
else.
if sy-msgty = '00359'.
else.
okrecord = okrecord + 1.
endif.
write: / count, t100-text.
endif.
endif.
endloop.
failrecord = count - okrecord.
write: /.
write: / 'Total record need to be proceeded = ', count.
write: / 'Total successed record = ', okrecord.
write: / 'Total not successed record = ', failrecord.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.