Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

About creating batch input for Dynamic action infotypes

Former Member
0 Kudos

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.

2 REPLIES 2

former_member183804
Active Contributor
0 Kudos

Hello Mavidel,

in general you can record a batch input with system\services\batch_input\recorder.

http://aiokeh.wdf.sap.corp:1080/SAPIKS2/content_get.sap?_CLASS=IWB_EXTHLP&_LOIO=6742FCD5F61011D1BCF9...

The result can be converted (manually) in a bdc report using the bdcdata structure and the statement call transaction, see also:

http://aiokeh.wdf.sap.corp:1080/SAPIKS2/logonFromUrl.sap?_LOIO=FA0970A4543B11D1898E0000E8322D00&_CLA...

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.

suresh_datti
Active Contributor
0 Kudos

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.