增强方式:替代,【替代基本用在FICO模块】
BTE增强方式应用更广,需要学习总结。

程序:ZRGGBS*

步骤 1,SE16N:GB01 将 ZBD1T排除标记置为空,【注意,此更改跨client,dev700 修改,test710 也被修改】
通 ZTERM
排除
9 S BSEG ZBD1T X
9 S BSEG ZTERM

2.替代程序RGUGBR00 重新运行;

应用领域 *
调用点 *

使用标准变式:SAP&OIBSEGBKPF
运行结果:成功完成存储和生成
消息号 GB000

3.程序zrggbs000 代码增强
*---------------------------------------------------------------------*
* FORM Z002 *
*---------------------------------------------------------------------*
*替代付款方式:BSEG-ZTERM
*1.系统根据BSEG-BUKRS(公司代码)=(CV50,CV51,CV52),
* BSEG-KOART(科目类型)=K,
* 根据BSEG-LIFNR(供应商账号)到LFB1-LIFNR=BSEG-LIFNR,
* LFB1-BUKRS=BESG-BUKRS(公司代码),找到LFB1-ZTERM赋值给BSEG-ZTERM
*
*---------------------------------------------------------------------*
FORM z002.
*&--->add on 16.05.2017 10:30:38 by cx.
DATA:l_zterm TYPE lfb1-zterm.
DATA:l_nzterm TYPE lfb1-zterm.
DATA:l_nzfbdt TYPE bseg-zfbdt.
DATA:l_ozterm TYPE lfb1-zterm.
DATA:l_nsklin TYPE sklin,
l_osklin TYPE sklin.
DATA:l_ozfbdt TYPE bseg-zfbdt.
DATA:e_sklin TYPE sklin,
e_zfbdt TYPE bseg-zfbdt.

*break c_xiangc.
CLEAR:l_zterm.
SELECT SINGLE zterm
INTO l_zterm
FROM lfb1
WHERE lifnr = bseg-lifnr
AND bukrs = bseg-bukrs.
IF l_zterm NE space.
CONDENSE l_zterm NO-GAPS.

**用付款条件,找付款基准日期,天数/百分比,
IF l_zterm IS NOT INITIAL AND l_zterm NE bseg-zterm .
CLEAR:e_sklin,e_zfbdt.
CALL FUNCTION 'FI_FIND_PAYMENT_CONDITIONS'
EXPORTING
i_zterm = l_zterm
i_bldat = bkpf-bldat
i_budat = bkpf-budat
i_cpudt = bkpf-cpudt
i_zfbdt = bseg-zfbdt
* I_FUNCL = ' '
* I_REINDAT =
* I_PPA_EX_IND =
* I_LIFNR =
* I_BUKRS =
IMPORTING
* E_T052 =
e_zfbdt = e_zfbdt
e_sklin = e_sklin
* E_XSPLT =
EXCEPTIONS
terms_incorrect = 1
terms_not_found = 2
no_date_entered = 3
no_day_limit_found = 4
OTHERS = 5
.
*IF sy-subrc <> 0.
*MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*ELSE.
*MESSAGE s001(00) WITH '替代成功!'.
*ENDIF.
*&--->替代基准日期
IF e_zfbdt NE space.
bseg-zfbdt = e_zfbdt.
ENDIF.
**天数
bseg-zbd1t = e_sklin-ztag1.
bseg-zbd1p = e_sklin-zprz1.
bseg-zbd2t = e_sklin-ztag2.
bseg-zbd2p = e_sklin-zprz2.
bseg-zbd3t = e_sklin-ztag3.
**付款条件
bseg-zterm = l_zterm.

ENDIF.

ENDIF.
*&--->end add.

ENDFORM. "Z001

*&------------------------------------------------------------------------
FORM z002.
*BREAK-POINT.
*&--->add on 16.05.2017 10:30:38 by cx.
DATA:l_zterm TYPE lfb1-zterm.

DATA:l_nzterm TYPE lfb1-zterm.
DATA:l_nzfbdt TYPE bseg-zfbdt.
DATA:l_ozterm TYPE lfb1-zterm.
DATA:l_nsklin TYPE sklin,
l_osklin TYPE sklin.
DATA:l_ozfbdt TYPE bseg-zfbdt.

DATA:e_sklin TYPE sklin.
BREAK-POINT.

CLEAR:l_zterm.
SELECT SINGLE zterm
INTO l_zterm
FROM lfb1
WHERE lifnr = bseg-lifnr
AND bukrs = bseg-bukrs.
IF l_zterm NE space.
CONDENSE l_zterm NO-GAPS.
bseg-zbd1t = 111.

**替代天数
IF l_zterm NE bseg-zterm .
CLEAR:e_sklin.
CALL FUNCTION 'FI_CHANGE_PAYMENT_CONDITIONS'
EXPORTING
* I_BLDAT = SY-DATLO
* I_BUDAT = SY-DATLO
* I_CPUDT =
i_newzterm = l_zterm
i_newzfbdt = bseg-zfbdt
i_newsklin = l_nsklin
i_oldzterm = bseg-zterm
i_oldzfbdt = bseg-zfbdt
i_oldsklin = l_osklin
* I_ZLSCH =
* I_ZSCHF =
* I_OLDZLSCH =
* I_OLDZSCHF =
* I_ZBDREQ = ' '
* I_ZFBDTREQ = ' '
* I_ZLSCHREQ = ' '
* I_ZSCHFREQ = ' '
* I_SPLITMODE = ' '
* I_LIFNR =
* I_BUKRS =
* I_XDERIVE =
IMPORTING
* E_ZTERM =
* E_ZFBDT =
e_sklin = e_sklin
* E_STATUS =
* E_ZLSCH =
* E_ZSCHF =
* CHANGING
* C_T052 =
* C_REINDAT =
EXCEPTIONS
terms_incorrect = 1
terms_not_found = 2
wrong_zfbdt = 3
day_limit_not_found = 4
OTHERS = 5
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
bseg-zbd1t = e_sklin-ztag1.
bseg-zterm = l_zterm.

ENDIF.

ENDIF.
*&--->end add.

ENDFORM. "Z001
*&------------------------------------------------------------------------

付款条件增强:
BSEG-ZTERM -> BSEG-ZBD1T
使用函数:FI_FIND_PAYMENT_CONDITIONS.
*输入:
I_ZTERM Z020
I_BLDAT 2017.05.22
I_BUDAT 2017.05.22
I_CPUDT 2017.05.22
I_ZFBDT 20170523

*输出:
*基准日期,
E_ZFBDT 2017.05.22

返回 E_T052
付款条件数据表

E_SKLIN

*
ZTAG1 020
ZPRZ1 0.000
ZTAG2 000
ZPRZ2 0.000
ZTAG3 000

付款条件 -> 天数
Z060
*&--->替代基准日期
IF e_zfbdt NE space.
bseg-zfbdt = e_zfbdt.
ENDIF.
bseg-zbd1t = e_sklin-ztag1.**天数
bseg-zbd1p = e_sklin-zprz1.*现金折扣百分率
bseg-zbd2t = e_sklin-ztag2.*现金折扣天数2
bseg-zbd2p = e_sklin-zprz2.*现金折扣百分比2
bseg-zbd3t = e_sklin-ztag3.*净支付条件期段
**付款条件
bseg-zterm = l_zterm.

                    / GBTQ8FIB
/ SUB_SMCV IF COND = B_TRUE . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . PERFORM Z002(ZRGGBS000) IF FOUND . G_SUBST_PERFORMED = B_TRUE.
ENDIF. CLEAR:e_sklin.
CALL FUNCTION 'FI_CHANGE_PAYMENT_CONDITIONS'
EXPORTING
i_bldat = bkpf-bldat
i_budat = bkpf-budat
* I_CPUDT =
i_newzterm = l_zterm
i_newzfbdt = bseg-zfbdt
i_newsklin = l_nsklin
i_oldzterm = bseg-zterm
i_oldzfbdt = bseg-zfbdt
i_oldsklin = l_osklin
* I_ZLSCH =
* I_ZSCHF =
* I_OLDZLSCH =
* I_OLDZSCHF =
* I_ZBDREQ = ' '
* I_ZFBDTREQ = ' '
* I_ZLSCHREQ = ' '
* I_ZSCHFREQ = ' '
* I_SPLITMODE = ' '
* I_LIFNR =
* I_BUKRS =WW
* I_XDERIVE =
IMPORTING
* E_ZTERM =
* E_ZFBDT =
e_sklin = e_sklin
* E_STATUS =
* E_ZLSCH =
* E_ZSCHF =
* CHANGING
* C_T052 =
* C_REINDAT =
EXCEPTIONS
terms_incorrect =
terms_not_found =
wrong_zfbdt =
day_limit_not_found =
OTHERS =
.
IF sy-subrc <> .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE s001() WITH '替代成功!'.
ENDIF.

20170523 BSEG替代付款条件-ZTERM 天数-ZBD1T的更多相关文章

  1. 关于付款条件ZTERM 的函数

    函数:PR_WF_PAYMENT_BLOCK_CHECKCALL FUNCTION 'FI_F4_ZTERM' F061 支付的过程条件FI_CHANGE_PAYMENT_CONDITIONS New ...

  2. Payment Terms 收付款条件和分期付款设置

    SAP Payment Terms 中文翻译为收付款条件,他的用途是应收和应付的财务凭证中账期的管理,顾名思义即手动录入和自动生成的财务文档多少天内冲销处理则为正常,否则为超期应收应付文档,它包含的内 ...

  3. FICO-Payment Terms 收付款条件和分期付款设置

    转载:https://www.cnblogs.com/weichuo/p/3524278.html Payment Terms 收付款条件和分期付款设置 SAP Payment Terms 中文翻译为 ...

  4. php中cal_days_in_month不可用时的替代方法(计算一个月的天数)

    在计算某个月中的天数时,由于PHP编译时没有加上--enable-calendar选项,会导致cal_days_in_month方法不可用. 这时,如果不能更改服务器的编译设置,可以通过以下方法实现该 ...

  5. ZRGGBS00 GGB1替代问题

    ZRGGBS00ZRGGBS00ZRGGBS00 和Validation不同的是,Validation只做检测,一般不做相应数据的修改,Substitution弥补了这反面的缺陷,它和user exi ...

  6. Effective Java 第三版——34. 使用枚举类型替代整型常量

    Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...

  7. mysql 日期操作 增减天数、时间转换、时间戳(转)

    转自http://www.cnblogs.com/wenzichiqingwa/archive/2013/03/05/2944485.html http://hi.baidu.com/juntao_l ...

  8. mysql 日期操作 增减天数、时间转换、时间戳(转换)

    http://hi.baidu.com/juntao_li/item/094d78c6ce1aa060f6c95d0b MySQL datediff(date1,date2):两个日期相减 date1 ...

  9. 【ABAP系列】SAP ABAP 的替代和校验

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP 的替代和校验 ...

随机推荐

  1. SQLServer跨库查询--分布式查询(转载)

    --用openrowset连接远程SQL或插入数据 --如果只是临时访问,可以直接用openrowset --查询示例 select * from openrowset('SQLOLEDB' ,'sq ...

  2. Python标准库:内置函数chr(i)

    返回一个參数i表示的字符串. 比方,chr(97)返回字符"a".參数i的有效范围为0到1.114,111(0x10FFFF),其他范围的值会抛出异常ValueError. 与之相 ...

  3. c语言编写51单片机中断程序,执行过程是怎样的?

    Q:c语言编写51单片机中断程序,执行过程是怎样的? 例如程序:#include<reg52.h>  void main(void)  {   EA=1;      //开放总中断   E ...

  4. 红茶一杯话Binder (传输机制篇_下)

    红茶一杯话Binder (传输机制篇_下) 侯 亮 1 事务的传递和处理 从IPCThreadState的角度看,它的transact()函数是通过向binder驱动发出BC_TRANSACTION语 ...

  5. 美团HD(6)-添加搜索遮罩

    DJSelectCityViewController.m /** SearchBar开始编辑 */ - (void)searchBarTextDidBeginEditing:(UISearchBar ...

  6. jquery的ajax-serialize()

    jQuery ajax - serialize() 方法 jQuery Ajax 参考手册 实例 输出序列化表单值的结果: $("button").click(function() ...

  7. java - day15 - NonameInner

    匿名内部类 public interface Inter {} interface Inter2{ void show(); } main(){ //错误,接口不能实例化 Inter t = new ...

  8. FreeBSD Try to set MAKE_JOBS_UNSAFE=yes and rebuild before

    FreeBSD Try to set MAKE_JOBS_UNSAFE=yes and rebuild before,玛德,FreeBSD安装软件就是蛋疼~ mark In some ports th ...

  9. Using Swift with Cocoa and Objective-C下载

    <Using Swift with Cocoa and Objective-C Building App > 下载地址 http://download.csdn.net/detail/sw ...

  10. 在CentOS中安装输入法

    1.需要root权限,所以要用root登录 ,或su root 2.yum install "@Chinese Support" 3.exit 4.回到桌面,system-> ...