BILLING PLAN

使用BDC创建BILLING PLAN后

CALL FUNCTION 'BILLING_SCHEDULE_READ'
        EXPORTING
          FPLNR = LS_FPLNR-FPLNR
        TABLES
          ZFPLA = LT_FPLA_OLD
          ZFPLT = LT_FPLT_OLD.

      LT_FPLA_NEW = LT_FPLA_OLD.


      LOOP AT LT_ZSD0015T INTO LS_ZSD0015T WHERE BSTKD = GS_CON-BSTKD
                                              AND POSEX = GS_CON-POSEX.
        LS_FPLT_NEW-MANDT = SY-MANDT.
        LS_FPLT_NEW-FPLNR = LS_FPLNR-FPLNR.
        LS_FPLT_NEW-FPLTR = LS_ZSD0015T-ZXH.
        LS_FPLT_NEW-FAREG = '4'.            
        LS_FPLT_NEW-UPDKZ = 'I'.
        LS_FPLT_NEW-FPTTP = LS_ZSD0015T-FPTTP.
        LS_FPLT_NEW-AFDAT = LS_ZSD0015T-AFDAT.
        LS_FPLT_NEW-FPROZ = LS_ZSD0015T-FPROZ.
        LS_FPLT_NEW-ZTERM = LS_ZSD0015T-ZTERM.
        APPEND LS_FPLT_NEW TO LT_FPLT_NEW.

        CLEAR:LS_ZSD0015T,
              LS_FPLT_NEW.
      ENDLOOP.



      CALL FUNCTION 'BILLING_SCHEDULE_SAVE'
        TABLES
          FPLA_NEW = LT_FPLA_NEW
          FPLA_OLD = LT_FPLA_OLD
          FPLT_NEW = LT_FPLT_NEW
          FPLT_OLD = LT_FPLT_OLD.

      COMMIT WORK AND WAIT.
        LS_FPLT_NEW-FAREG = '4'.            
        LS_FPLT_NEW-UPDKZ = 'I'.      
BILLING PLAN_第1张图片
image.png

你可能感兴趣的:(BILLING PLAN)