最近在做通过邮件披露业务员销售业绩。
需要将业务员的业绩直接放在邮件正文BODY,然后发送。 邮件BODY部分目前的技术是放不了什么容器之类的。如果要美观点,就只能在其他方面想想办法。
方法:
1、每个字段必须是C型,长度15比较合适。
2、汉字部分可以给前面加空格达到对齐的目的。
代码如下:
DATA LT TYPE I.
DATA LS(6).
MOVE QTAB113-BEZEE TO ETAB-BEZEE. "销售人员描述
LT = STRLEN( ETAB-BEZEE ). "判断名称长度
LT = 6 - LT.
CLEAR LS.
IF STRLEN( ETAB-BEZEE ) < 6. "假如小于6个字符 少几个循环几次加空格
DO LT TIMES.
CONCATENATE ' ' ETAB-BEZEE INTO ETAB-BEZEE.
ENDDO.
ENDIF.
CONCATENATE LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3
LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3
LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3
LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 LINE3 CL_ABAP_CHAR_UTILITIES=>CR_LF
LINE2'销售办事处' LINE2 ' ''销售人员' LINE2 '年度销售目标额' LINE2 '月度销售目标额' LINE2 '当月销售总金额'
LINE2 '累计销售总金额' LINE2 '当月占月度比[%]' LINE2 '累计占年度比[%]' LINE2 CL_ABAP_CHAR_UTILITIES=>CR_LF
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
INTO L_STR .
APPEND L_STR TO I_OBJTXT.
LOOP AT ETAB.
CONCATENATE LINE2 ETAB-BEZEI LINE2 ETAB-BEZEE ETAB-YSALE LINE2 ETAB-MSALE LINE2 ETAB-ZSALE
LINE2 ETAB-ZTOTL LINE2 ETAB-MCALE LINE2 ETAB-YCALE LINE2 CL_ABAP_CHAR_UTILITIES=>CR_LF
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1 LINE1
INTO L_STR .
APPEND L_STR TO I_OBJTXT.
ENDLOOP.