2007 Jan 18 9:12 AM
hi ,
i just want to know diff beween call transaction and session method in this case:
please check the below code:
<b>perform bdc_transaction using 'ZEMPN'.</b> <b>-- -- - for session</b>
but if u use call transaction i think we need to omit
<b>perform bdc_transaction using 'ZEMPN'.</b> and replace it with
<b>call transaction Tcode using BDCMSGCOLL</b>
<b>is that true?</b>
and i hope below code generated during recording will be same for both session and call transaction.
perform bdc_dynpro using 'ZASS_6' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IEMP'.
perform bdc_field using 'IEMP'
ITAB-EMPNO.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IDPT'.
perform bdc_field using 'INAME'
ITAB-EMPNAME.
perform bdc_field using 'ISAL'
ITAB-SALARY.
perform bdc_field using 'IDPT'
ITAB-EMPDPT.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=C'.
perform bdc_field using 'BDC_CURSOR'
'INAME'.
ENDLOOP.
perform close_group.
please help me regarding this bcoz i never worked on call Transaction
thank you very much
Pavan
2007 Jan 18 9:21 AM
Hi Pavan,
If you use the Call trasaction method, you may not use the BDC_OPEN_GROUP. BDC_INSERT and the BDC_CLOSE_GROUP, you can only use the <b>call transaction Tcode using BDCMSGCOLL mode 'N' Update 'S'</b>
Regards
Sudheer
Hi Pavan,
If you use the Call trasaction method, you may not use the BDC_OPEN_GROUP. BDC_INSERT and the BDC_CLOSE_GROUP, you can only use the <b>call transaction Tcode using BDCMSGCOLL mode 'N' Update 'S'</b>
Regards
Sudheer
2007 Jan 18 9:21 AM
Hi Pavan,
If you use the Call trasaction method, you may not use the BDC_OPEN_GROUP. BDC_INSERT and the BDC_CLOSE_GROUP, you can only use the <b>call transaction Tcode using BDCMSGCOLL mode 'N' Update 'S'</b>
Regards
Sudheer
2007 Jan 18 9:42 AM
thanks for ur answer sudeer, but i just wanted to know <b>will u do recording if u use call transaction method just like session method</b> and if u do - during record a code will be generated automatically like this:
do u think we shud omit this code in call transaction method.
perform bdc_dynpro using 'ZASS_6' '0100'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IEMP'.
perform bdc_field using 'IEMP'
ITAB-EMPNO.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=CRT'.
perform bdc_field using 'BDC_CURSOR'
'IDPT'.
perform bdc_field using 'INAME'
ITAB-EMPNAME.
perform bdc_field using 'ISAL'
ITAB-SALARY.
perform bdc_field using 'IDPT'
ITAB-EMPDPT.
perform bdc_dynpro using 'ZASS_6' '0200'.
perform bdc_field using 'BDC_OKCODE'
'=C'.
perform bdc_field using 'BDC_CURSOR'
'INAME'.
ENDLOOP.
waiting for ur answer.
thank you
pavan
2007 Jan 18 9:57 AM
hi pavan,
ur view is wrong.
in the recording perform open_group & perform close_group are logic for session.and perform bdc_transaction ...... is for call transaction.
by using recording u will get both the logics.u have to declare ur internal table and u have to create flatfile.before performs u have to loop ur internal table.no need to change call transaction logic.(try this)if u want to change the call transaction logic
u can specify that in place of perform bdc_transaction.
verify this code for session/call transaction using recording with MM01 transaction.
report zmm01pg
no standard page heading line-size 255.
tables : rmmg1,makt,mara .
data : begin of itab occurs 0,
matnr like rmmg1-matnr,
mbrsh like rmmg1-mbrsh,
mtart like rmmg1-mtart,
maktx like makt-maktx,
meins like mara-meins,
matkl like mara-matkl,
bismt like mara-bismt,
extwg like mara-extwg,
end of itab.
data : bdctab like bdcdata occurs 0 with header line,
bdcmsg like bdcmsgcoll occurs 0 with header line.
include bdcrecx1.
start-of-selection.
call function 'GUI_UPLOAD'
exporting
filename = 'Z:\MAT.TXT'
filetype = 'ASC'
has_field_separator = 'X'
tables
data_tab = itab
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
perform open_group.
loop at itab.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-MATNR'
itab-matnr.
perform bdc_field using 'RMMG1-MBRSH'
itab-mbrsh.
perform bdc_field using 'RMMG1-MTART'
itab-mtart.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
itab-maktx.
perform bdc_field using 'BDC_CURSOR'
'MARA-EXTWG'.
perform bdc_field using 'MARA-MEINS'
itab-meins.
perform bdc_field using 'MARA-MATKL'
itab-matkl.
perform bdc_field using 'MARA-BISMT'
itab-bismt.
perform bdc_field using 'MARA-EXTWG'
itab-extwg.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM01'.
endloop.
perform close_group.
this below program i put my call transaction coding and handlled errors using XK01.
report zst_bdc_xk01pg
no standard page heading line-size 255.
tables : rf02k,lfa1,lfbk,lfb1,lfm1.
data: begin of w_ven ,
lifnr type rf02k-lifnr,
ktokk type rf02k-ktokk,
name1 type lfa1-name1,
sortl type lfa1-sortl,
land1 type lfa1-land1,
spras type lfa1-spras,
end of w_ven,
t_ven like standard table of w_ven initial size 0,
t_bdcmsgcoll type standard table of bdcmsgcoll,
w_bdcmsgcoll type bdcmsgcoll,
include bdcrecx1.
start-of-selection.
call function 'GUI_UPLOAD'
exporting
filename = 'C:\TEMP1.TXT'
filetype = 'ASC'
tables
data_tab = t_ven.
*perform open_group.
loop at t_ven into w_ven.
refresh bdcdata.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
w_ven-lifnr.
perform bdc_field using 'RF02K-KTOKK'
w_ven-ktokk.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
w_ven-name1.
perform bdc_field using 'LFA1-SORTL'
w_ven-sortl.
perform bdc_field using 'LFA1-LAND1'
w_ven-land1.
perform bdc_field using 'LFA1-SPRAS'
w_ven-spras.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
*perform bdc_transaction using 'XK01'.
call transaction 'XK01' using bdcdata
mode 'A'
update 'A'
messages into t_bdcmsgcoll.
if sy-subrc <> 0.
loop at t_bdcmsgcoll into w_bdcmsgcoll."for handling errors
write: w_bdcmsgcoll-dyname,
w_bdcmsgcoll-dynumb,
w_bdcmsgcoll-msgtyp,
w_bdcmsgcoll-msgspra,
w_bdcmsgcoll-msgid,
w_bdcmsgcoll-msgnr,
w_bdcmsgcoll-msgv1,
w_bdcmsgcoll-msgv2,
w_bdcmsgcoll-msgv3,
w_bdcmsgcoll-msgv4.
endloop.
endloop.
*perform close_group.
try this .
if it is useful give me marks.
2007 Jan 18 10:20 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |