ABAP-BDC录屏形成的INCLUDE


*----------------------------------------------------------------------*
*       Batchinputdata of single transaction
DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
*       Nodata-Character
DATA:   nodata_character VALUE ''.

DATA:   gv_string TYPE string.

*----------------------------------------------------------------------*
*   create batchinput session                                          *
*----------------------------------------------------------------------*
FORM open_group
     USING p_group    LIKE apqi-groupid
           p_user     LIKE apqi-userid
           p_keep     LIKE apqi-qerase
           p_holddate LIKE apqi-startdate
           p_ctu      LIKE apqi-putactive.

  IF p_ctu <> 'X'.
    CALL FUNCTION 'BDC_OPEN_GROUP'
      EXPORTING
        client   = sy-mandt
        group    = p_group
        user     = p_user
        keep     = p_keep
        holddate = p_holddate.
  ENDIF.
ENDFORM.

*----------------------------------------------------------------------*
*   end batchinput session                                             *
*----------------------------------------------------------------------*
FORM close_group USING p_ctu LIKE apqi-putactive.
  IF p_ctu <> 'X'.
* close batchinput group
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
  ENDIF.
ENDFORM.

*----------------------------------------------------------------------*
*        Start new transaction according to parameters                 *
*----------------------------------------------------------------------*
FORM bdc_transaction TABLES p_messtab
                     USING  p_tcode
                            p_ctu
                            p_mode
                            p_update.
  DATA: l_subrc LIKE sy-subrc.

  IF p_ctu <> 'X'.
    CALL FUNCTION 'BDC_INSERT'
      EXPORTING
        tcode     = p_tcode
      TABLES
        dynprotab = bdcdata
      EXCEPTIONS
        OTHERS    = 1.
  ELSE.
    CALL TRANSACTION p_tcode USING bdcdata
                     MODE   p_mode
                     UPDATE p_update
                     MESSAGES INTO p_messtab.
  ENDIF.
  l_subrc = sy-subrc.
  REFRESH bdcdata.
  sy-subrc = l_subrc.
ENDFORM.

*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
  CLEAR bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  APPEND bdcdata.
ENDFORM.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
*  IF fval <> NODATA_CHARACTER.
  CLEAR gv_string.
  CLEAR bdcdata.
  bdcdata-fnam = fnam.
  gv_string    = fval.
  bdcdata-fval = gv_string.
  APPEND bdcdata.
*  ENDIF.
ENDFORM.

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM bdc_nodata USING p_nodata.
  nodata_character = p_nodata.
ENDFORM.

上一篇:JMeter中Ultimate Thread Group插件下载及使用


下一篇:2020-11-25(《深入理解操作系统》多级页表详解)