05-07-2005 4:47 AM
I should create a batch input session for the infotype 583 which includes a dynamic action for the infotype 8.So I should create a BDC program for this.Can anyone please give me a sample code on how to create a batch input for the infotypes that have dynamic actions.
Thanks.
05-07-2005 4:51 PM
Hello Mavidel,
in general you can record a batch input with system\services\batch_input\recorder.
The result can be converted (manually) in a bdc report using the bdcdata structure and the statement call transaction, see also:
But since I have never heard of infotypes I am not sure if this really helps you.
Best Regards
Klaus
PS: I have added a sample report
*&---------------------------------------------------------------------*
*& Report ZSCI_DBC
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZSCI_BDC.
tables:
sci_Dynp.
parameters:
p_User type Sci_Dynp-Usr
memory id SCI_USER,
p_Insp type Sci_Dynp-Insp value check obligatory
memory id SCI_INSP,
p_SrvGrp type Sci_Dynp-SGroup value check obligatory
memory id SERV_GROUP.
types:
ty_S_Bdc_Record type bdcdata,
ty_T_Bdc_Records type standard table of ty_S_Bdc_Record with default key,
ty_S_Bdc_Message type BDCMSGCOLL,
ty_T_Bdc_Messages type standard table of ty_S_Bdc_Message with default key.
start-of-selection.
perform sub_Main.
**************
form sub_Main.
**************
data:
loc_Text type String,
loa_Bdc_Records type ty_T_Bdc_Records,
loa_Bdc_Messages type ty_T_Bdc_Messages.
field-symbols:
<lor_Bdc_Record> like line of loa_Bdc_Records,
<lor_Bdc_Message> like line of loa_Bdc_Messages.
define mac_Fill_Bdc.
insert initial line into table loa_Bdc_Records assigning <lor_Bdc_Record>.
<lor_Bdc_Record>-Program = &1.
<lor_Bdc_Record>-Dynpro = &2.
<lor_Bdc_Record>-DynBegin = &3.
<lor_Bdc_Record>-FNam = &4.
<lor_Bdc_Record>-FVal = &5.
end-of-definition.
mac_Fill_Bdc:
'' '' 'T' 'SCI' 'BS AA X F',
'SAPLS_CODE_INSPECTOR' '0100' 'X' '' '',
'' '' '' 'BDC_CURSOR' 'SCI_DYNP-INSP',
'' '' '' 'BDC_OKCODE' '=INSP_RERUN',
'' '' '' 'SCI_DYNP-USR' p_User,
'' '' '' 'SCI_DYNP-INSP' p_Insp,
'SAPLS_CODE_INSPECTOR' '0200' 'X' '' '',
'' '' '' 'BDC_CURSOR' 'SCI_DYNP-INSP',
'' '' '' 'BDC_OKCODE' '=RUN_WITH_POPUP',
'SAPLS_CODE_INSPECTOR' '0270' 'X' '' '',
'' '' '' 'BDC_CURSOR' 'SCI_DYNP-SGROUP',
'' '' '' 'BDC_OKCODE' '=BACK',
'' '' '' 'SCI_DYNP-X_SERVER_G' 'X',
'' '' '' 'SCI_DYNP-SGROUP' p_SrvGrp,
'' '' '' 'SCI_DYNP-X_BATCH_0' '',
'' '' '' 'SCI_DYNP-X_BATCH_1' 'X',
'SAPLBTCH' '1010' 'X' '' '',
'' '' '' 'BDC_OKCODE' '=IMMD',
'SAPLBTCH' '1010' 'X' '' '',
'' '' '' 'BDC_CURSOR' 'BTCH1010-PERIODIC',
'' '' '' 'BDC_OKCODE' '=SAVS',
'SAPLS_CODE_INSPECTOR' '0200' 'X' '' '',
'' '' '' 'BDC_OKCODE' '/EEXIT',
'' '' '' 'BDC_CURSOR' 'SCI_DYNP-INSP'.
if ( 'X' eq sy-Batch ).
call transaction 'SCI'
using loa_Bdc_Records Messages into loa_Bdc_Messages
mode 'N'.
else.
call transaction 'SCI'
using loa_Bdc_Records Messages into loa_Bdc_Messages
mode 'E'.
endif.
if ( 0 ne sy-SubRc ).
if ( 'X' eq sy-Batch ).
loop at loa_Bdc_Messages assigning <lor_Bdc_Message>.
message
ID <lor_Bdc_Message>-MsgID
Type <lor_Bdc_Message>-MsgTyp
Number <lor_Bdc_Message>-MsgNr
with
<lor_Bdc_Message>-MsgV1
<lor_Bdc_Message>-MsgV2
<lor_Bdc_Message>-MsgV3
<lor_Bdc_Message>-MsgV4.
endloop.
else.
loop at loa_Bdc_Messages assigning <lor_Bdc_Message>.
message
ID <lor_Bdc_Message>-MsgID
Type <lor_Bdc_Message>-MsgTyp
Number <lor_Bdc_Message>-MsgNr
with
<lor_Bdc_Message>-MsgV1
<lor_Bdc_Message>-MsgV2
<lor_Bdc_Message>-MsgV3
<lor_Bdc_Message>-MsgV4
into loc_Text.
write: / loc_Text.
endloop.
endif.
endif.
endform.
05-09-2005 3:23 PM
Hi Vadivel,
I am almost certain that you cannot trigger Dynamic Actions via Batch Input. You will have to explicitly code the creation of infotype 0008 in the BDC.