‎2008 Feb 05 10:15 AM
hoiw can i get all the error in call transaction method, can any one guide me?
‎2008 Feb 05 10:17 AM
Try with the following fm .
DATA :it_messtab TYPE TABLE OF bdcmsgcoll.
DATA: wa_messtab TYPE bdcmsgcoll.
wa_textout TYPE t100-text.
LOOP AT it_messtab INTO wa_messtab .
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = wa_messtab-msgid
msgnr = wa_messtab-msgnr
msgv1 = wa_messtab-msgv1
msgv2 = wa_messtab-msgv2
msgv3 = wa_messtab-msgv3
msgv4 = wa_messtab-msgv4
IMPORTING
message_text_output = wa_textout.
MESSAGE wa_textout TYPE wa_messtab-msgtyp.
ENDLOOP.
‎2008 Feb 05 10:18 AM
‎2008 Feb 05 10:20 AM
We need to explicitly track error messages in case of CALL TRANSACTION. Use BDCMSGCOL structure to build an internal table and use FORMAT_MESSAGE function module to capture error messages.
first declare an int tab type BDCMSGCOLL
then use it in call transaction extension MESSAGES INTO MSG_TAB.
if MSG_TAB-MSGTYP = 'E'.
then use the MESSAGE_PREPARE FM to get the text pass MSGV1, MSGV2, MSGV3, MSGV5, MSGNR, MSGID to the funchtion module . it'll return a text. write it or store it to an int tab.
Reward if useful.
‎2008 Feb 05 10:50 AM
DATA : LF_MSG TYPE STRING.
LOOP AT IT_BDCMSGCOLL INTO WA_BDCMSGCOLL.
&----
*& CALL FM FOR MESSAGES DISPLAY
*&
&----
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = WA_BDCMSGCOLL-MSGID
LANG = SY-LANGU
NO = WA_BDCMSGCOLL-MSGNR
V1 = WA_BDCMSGCOLL-MSGV1
V2 = WA_BDCMSGCOLL-MSGV2
V3 = WA_BDCMSGCOLL-MSGV3
V4 = WA_BDCMSGCOLL-MSGV4
IMPORTING
MSG = LF_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0. "#EC NEEDED
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ WA_BDCMSGCOLL-MSGID,
WA_BDCMSGCOLL-MSGNR,
LF_MSG.
ENDLOOP.
Reward if useful.
‎2008 Feb 06 4:34 PM
see this
&----
*& Report ZMATERIAL
*&
&----
&----
report zmaterial_fert.
selection-screen :begin of block bl1 with frame title text-001.
parameters : p_fname type rlgrap-filename,
p_lgort type rlgrap-filename,
p_update(1) default 'N',
p_bdcgrp(12) default 'MM_MASTER'.
selection-screen end of block bl1.
data: v_chr_opengrp type c,
r_matnr like mara-matnr,
r_werks like marc-werks,
v_str_fname type string.
data : begin of bdc_itab occurs 0.
include structure bdcdata.
data : end of bdc_itab.
data: begin of messtab occurs 0.
include structure bdcmsgcoll.
data: end of messtab.
data: begin of count,
inrec(9) type n, " input I_MATERIAL count
create(9) type n, " create count
error(9) type n, " error count
bdc(9) type n, " count of BDC creates
end of count.
data : begin of i_material occurs 0,
matnr(018) type c, "Material number
mbrsh(001) type c, "Industry sector
mtart(004) type c, "Material type
werks(004) type c, "Plant
lgort(004),
lgnum(004),
vkorg(004),
vtweg(002),
mtpos_mara(004),
spart(002),
dwerk(004),
taxkm(001),
versg(001),
MTPOS(004),
maktx(040) type c, "Material description
meins(003) type c, "Base unit of measure
matkl(009) type c, "Material group
bismt(018), "old material code
brgew(017) type c, "Gross weight
gewei(003) type c, "Weight unit
ntgew(017) type c, "Net weight
magrv(004) type c, "Matl grp pack matls
tragr(004), "
ladgr(004),
prctr(007),
EKGRP(004),
EKWSL(004),
chap(012),
mattype(001),
nogrs(001),
outmat(018),
valid(010),
curr(005),
netdeal(018),
asess(018),
disgr(004),
dismm(002) type c,
dispo(003),
LGORT(004),
disls(002),
maabc(001),
lgpro(004),
webaz(003),
lgfsb(004),
plifz(003),
STRGR(002),
fhori(003),
sfepr(004),
fevor(003),
sfcpf(006),
beskz(001),
perkz(001),
VRMOD(001),
VINT1(003),
VINT2(003),
ALTSL(001),
SBDKZ(001),
FERVOR(002),
SFCPF(006),
stprs(015),
AWSLS(006),
mtvfp(002),
STGRP(002),
*PRCTR(007),
bklas(004),
vprsv(001),
peinh(006),
*EKALR(015),
verpr(015),
hrkft(002),
*HKMAT,
kosgr(010),
*LOSGR(018),
end of i_material.
at selection-screen on value-request for p_fname.
call function 'KD_GET_FILENAME_ON_F4'
exporting
program_name = 'Z_MM_MATERIAL_UPLOAD'
dynpro_number = '1000'
field_name = 'P_FNAME'
changing
file_name = p_fname.
at selection-screen on value-request for p_lgort.
call function 'KD_GET_FILENAME_ON_F4'
exporting
program_name = 'ZMATERIAL'
dynpro_number = '1000'
field_name = 'P_FNAME'
changing
file_name = p_lgort.
start-of-selection.
if p_fname is initial.
message i016(rp) with 'Please enter a file name'.
leave list-processing.
else.
move p_fname to v_str_fname.
endif.
call function 'GUI_UPLOAD'
exporting
filetype = 'ASC'
filename = v_str_fname
has_field_separator = 'X'
tables
data_tab = i_material
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at i_material.
r_matnr = i_material-matnr.
r_werks = i_material-werks.
add 1 to count-inrec.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
i_material-matnr.
perform bdc_field using 'RMMG1-MTART'
i_material-mtart.
perform bdc_field using 'RMMG1-MBRSH'
i_material-mbrsh.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(17)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
*PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(07)'
*'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(06)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)'
'X'.
*PERFORM BDC_FIELD USING 'MSICHTAUSW-KZSEL(12)'
*'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(13)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(14)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(16)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(17)'
'X'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(07)'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)'
'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-LGNUM'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'RMMG1-WERKS'
i_material-werks.
perform bdc_field using 'RMMG1-LGORT'
i_material-lgort.
perform bdc_field using 'RMMG1-LGNUM'
i_material-lgnum.
perform bdc_field using 'RMMG1-VKORG'
i_material-vkorg.
perform bdc_field using 'RMMG1-VTWEG'
i_material-vtweg.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARA-MEINS'
i_material-meins.
perform bdc_field using 'MARA-MATKL'
i_material-matkl.
perform bdc_field using 'MARA-BISMT'
i_material-bismt.
perform bdc_field using 'MARA-BRGEW'
i_material-brgew.
perform bdc_field using 'MARA-GEWEI'
i_material-gewei.
perform bdc_field using 'MARA-NTGEW'
i_material-ntgew.
perform bdc_field using 'MARA-MAGRV'
i_material-magrv.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARA-MEINS'
i_material-meins.
perform bdc_field using 'MARA-MATKL'
i_material-matkl.
perform bdc_field using 'MARA-SPART'
i_material-spart.
perform bdc_field using 'MVKE-DWERK'
i_material-dwerk.
perform bdc_field using 'BDC_CURSOR'
'MG03STEUER-TAXKM(01)'.
perform bdc_field using 'MG03STEUER-TAXKM(01)'
i_material-taxkm.
perform bdc_dynpro using 'SAPLMGMM' '4200'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARA-MTPOS_MARA'
i_material-mtpos_mara.
perform bdc_field using 'MVKE-versg'
i_material-versg.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARA-BRGEW'
i_material-brgew.
perform bdc_field using 'MARA-GEWEI'
i_material-gewei.
perform bdc_field using 'MARA-NTGEW'
i_material-ntgew.
perform bdc_field using 'BDC_CURSOR'
'MARA-MAGRV'.
perform bdc_field using 'MARA-MAGRV'
i_material-magrv.
perform bdc_field using 'MARA-TRAGR'
i_material-tragr.
perform bdc_field using 'MARC-LADGR'
i_material-ladgr.
perform bdc_field using 'MARC-PRCTR'
i_material-prctr.
perform bdc_field using 'MARC-MTVFP'
i_material-mtvfp.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'BDC_CURSOR'
'J_1IASSVAL-J_1IVALASS'.
perform bdc_field using 'J_1IMTCHID-J_1ICHID'
i_material-chap.
perform bdc_field using 'J_1IMTCHID-J_1ISUBIND'
'X'..
perform bdc_field using 'J_1IMTCHID-J_1ICAPIND'
i_material-mattype.
perform bdc_field using 'J_1IMTCHID-J_1IGRXREF'
i_material-nogrs.
perform bdc_field using 'J_1IMODDET-J_1IMOOM'
i_material-outmat.
perform bdc_field using 'J_1IASSVAL-J_1IFRDATE'
i_material-valid.
perform bdc_field using 'J_1IASSVAL-J_1IWAERS'
i_material-curr.
perform bdc_field using 'J_1IASSVAL-J_1IVALNDP'
i_material-netdeal.
perform bdc_field using 'J_1IASSVAL-J_1IVALASS'
i_material-asess.
*perform bdc_dynpro using 'SAPLMGMM' '4000'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
*perform bdc_field using 'MAKT-MAKTX'
I_MATERIAL-MAKTX.
*perform bdc_field using 'MVKE-MTPOS'
I_MATERIAL-MTPOS.
*
*
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'ENTR'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARA-MEINS'
i_material-meins.
perform bdc_field using 'BDC_CURSOR'
'MARC-DISMM'.
perform bdc_field using 'MARC-DISMM'
i_material-dismm.
perform bdc_field using 'MARC-DISPO'
i_material-dispo.
perform bdc_field using 'MARC-DISLS'
i_material-disls.
perform bdc_field using 'MARC-MAABC'
i_material-maabc.
perform bdc_field using 'MARC-DISGR'
i_material-disgr.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARC-FHORI'
i_material-fhori.
perform bdc_field using 'MARC-LGPRO'
i_material-lgpro.
perform bdc_field using 'MARC-LGFSB'
i_material-lgfsb.
perform bdc_field using 'MARC-PLIFZ'
i_material-plifz.
*perform bdc_field using 'MARC-STRGR'
I_MATERIAL-STRGR.
perform bdc_field using 'MARC-BESKZ'
i_material-beskz.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
*perform bdc_field using 'MARC-STRGR'
I_MATERIAL-STRGR.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MARC-SAUFT'
'X'.
perform bdc_field using 'MARC-SFEPR'
i_material-sfepr.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'MArc-FEVOR'
i_material-fevor.
perform bdc_field using 'MARC-SFCPF'
i_material-sfcpf.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
*
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'BDC_CURSOR'
'MBEW-BKLAS'.
perform bdc_field using 'MBEW-BKLAS'
i_material-bklas.
perform bdc_field using 'MBEW-VPRSV'
i_material-vprsv.
perform bdc_field using 'MBEW-PEINH'
i_material-peinh.
perform bdc_field using 'MBEW-STPRS'
i_material-stprs.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
*
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
perform bdc_field using 'Mbew-kosgr'
i_material-kosgr.
perform bdc_field using 'Mbew-HKMAT'
'X'.
perform bdc_field using 'Mbew-HRKFT'
i_material-hrkft.
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MAKT-MAKTX'.
perform bdc_field using 'MAKT-MAKTX'
i_material-maktx.
*perform bdc_field using 'Mbew-KOSGR'
I_MATERIAL-KOSGR.
*
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform post_transaction.
refresh bdc_itab.
clear bdc_itab.
endloop.
end-of-selection.
perform finalization.
----
Start new screen *
----
form bdc_dynpro using program dynpro.
clear bdc_itab.
bdc_itab-program = program.
bdc_itab-dynpro = dynpro.
bdc_itab-dynbegin = 'X'.
append bdc_itab.
endform. "bdc_dynpro
----
Insert field *
----
form bdc_field using fnam fval.
if fval <> ''.
clear bdc_itab.
bdc_itab-fnam = fnam.
bdc_itab-fval = fval.
append bdc_itab.
endif.
endform. "bdc_field
&----
*& Form POST_TRANSACTION
----
form post_transaction.
refresh messtab.
clear messtab.
call transaction 'MM01' using bdc_itab
mode p_update
update 'S'
messages into messtab.
submit zrpt_plantext with flatfile = p_lgort
with p_matnr = r_matnr
with p_werks = r_werks and return.
read table messtab with key msgtyp = 'E'.
if sy-subrc eq 0.
perform process_error_messages.
add 1 to count-bdc.
if v_chr_opengrp is initial.
perform bdc_open_group.
endif.
call function 'BDC_INSERT'
exporting
tcode = 'MM01'
tables
dynprotab = bdc_itab
exceptions
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
others = 5.
if sy-subrc <> 0.
case sy-subrc.
when 1.
write: / 'Internal error'.
when 2.
write: / 'Not open error'.
when 3.
write: / 'queue error'.
when 4.
write: / 'tcode invalid error'.
when others.
write: / 'other error'.
endcase.
endif.
else.
add +1 to count-create.
format intensified off.
format color col_normal.
format color col_normal off.
endif.
clear bdc_itab.
refresh bdc_itab.
endform. " POST_TRANSACTION
&----
*& Form PROCESS_ERROR_MESSAGES
----
form process_error_messages.
data: begin of loc_aux_message.
include structure message.
data: end of loc_aux_message.
data : msgno type sy-msgno.
loop at messtab.
move messtab-msgnr to msgno.
call function 'WRITE_MESSAGE'
exporting
msgid = messtab-msgid
msgno = msgno
msgty = messtab-msgtyp
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
importing
messg = loc_aux_message
exceptions
others = 1.
if sy-subrc eq 0.
format color col_negative on.
write: /10 i_material-matnr.
write: /10 loc_aux_message.
format color col_negative off.
else.
format color col_negative on.
write: /10 i_material-matnr.
write: / 'Error creating message'.
format color col_negative off.
exit.
endif.
endloop.
endform. " PROCESS_ERROR_MESSAGES
&----
*& Form BDC_OPEN_GROUP
----
form bdc_open_group.
call function 'BDC_OPEN_GROUP'
exporting
client = sy-mandt
group = p_bdcgrp
holddate = sy-datum
keep = 'X'
user = sy-uname
exceptions
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
others = 11.
if sy-subrc eq 0.
v_chr_opengrp = 'X'.
endif.
endform. " BDC_OPEN_GROUP
&----
*& Form FINALIZATION
&----
form finalization.
if v_chr_opengrp = 'X'.
call function 'BDC_CLOSE_GROUP'
exceptions
not_open = 1
queue_error = 2
others = 3.
endif.
get time.
skip 2.
write: / 'Time', sy-uzeit.
skip.
format color col_total on.
write: / 'Total Records: ', 40 count-inrec.
write: / 'PERNR not of Emp Group 6 ', 40 count-error.
write: / 'Records Created: ', 40 count-create.
write: / 'BDC Create in group: ', 40 count-bdc.
if v_chr_opengrp = 'X'.
skip 1.
format intensified on.
format color col_negative on.
write: / 'PLEASE USE TRANSACTION "SM35" ',
'TO PROCESS THE GENERATED BDC SESSION ... ',
p_bdcgrp.
endif.
endform. " FINALIZATION