追加到表
APPENDING corresponding fields of table gt_order
APPENDING corresponding fields of table gt_order
补0
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gt_machine-ton
IMPORTING
output = gt_machine-ton.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gt_machine-ton
IMPORTING
output = gt_machine-ton.
nace发票打印程序设置
MESSAGE用法总结:
1)message text type 'I'/'W'/'E'/'S'.
2) message ennn(z_msg) with text. 如果nnn消息中不包含变量,则无须with
3)在report开始的时候申明message-id = msg_id,在下面程序中直接:message ennn with text.
4)message ..ennn(z_msg).. rasing exception_object如果有异常抛出异常如果没有按照message进行
se91创建一个message,
SPLIT sl AT '.' INTO sl tmp.
检查用户输入
PROCESS AFTER INPUT.
CHAIN.
FIELD <field1>.
FIELD <field2>.
FIELD: <field3>, <field4>, ... <fieldn>.
MODULE <module1>.
MODULE <module2>.
ENDCHAIN.
PROCESS AFTER INPUT.
CHAIN.
FIELD <field1>.
FIELD <field2>.
FIELD: <field3>, <field4>, ... <fieldn>.
MODULE <module1>.
MODULE <module2>.
ENDCHAIN.
MODULE module1 INPUT .
IF Z_WEIGHT_SOURCE <> ''.
MESSAGE e001(00) WITH '通关单重来源"' Z_WEIGHT_SOURCE '"在系统中不存在。'.
IF Z_WEIGHT_SOURCE <> ''.
MESSAGE e001(00) WITH '通关单重来源"' Z_WEIGHT_SOURCE '"在系统中不存在。'.
屏幕下拉框
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
PROCESS ON VALUE-REQUEST.
FIELD c1 MODULE create_dropdown_list."C1字段名
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
PROCESS ON VALUE-REQUEST.
FIELD c1 MODULE create_dropdown_list."C1字段名
module CREATE_DROPDOWN_LIST input.
refresh itab.
clear itab.
itab-carrname = '合格'.
append itab.
itab-carrname = '不合格'.
append itab.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'CARRNAME'
value_org = 'S'
tables
value_tab = itab
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc <> 0.
endif.
endmodule.
refresh itab.
clear itab.
itab-carrname = '合格'.
append itab.
itab-carrname = '不合格'.
append itab.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'CARRNAME'
value_org = 'S'
tables
value_tab = itab
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
if sy-subrc <> 0.
endif.
endmodule.
Web DynPro 页面事件顺序
页面加载
WDDOINIT 初始货
WDDOMODIFYVIEW 页面加载
按钮事件
WDDOBEFOREACTION
ONACTIONBTN_GO 按钮事件
WDDOAFTERACTION
WDDOMODIFYVIEW
可以使用ABAP中函数 'DATE_CHECK_PLAUSIBILITY' 或'TIME_CHECK_PLAUSIBILITY'检查日期和时间值是否合法。
用法如下:
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = v_date
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc NE 0. "如果返回非0,则日期不合法
.
.
ENDIF.
CALL FUNCTION 'TIME_CHECK_PLAUSIBILITY'
EXPORTING
time = v_time
EXCEPTIONS
plausibility_check_failed = 1
OTHERS = 2.
IF sy-subrc NE 0. "如果返回非0,则时间不合法
.
.
ENDIF.
*金额千位分隔符
FORM transnetwr USING p TYPE netpr "传入的金额字段
str TYPE char20. "传出的字符串
IF p < 0 .
p = - p.
WRITE p TO str.
CONDENSE str.
CONCATENATE '-' str INTO str.
p = - p.
ELSE.
* STR = P. "string 型的赋值这样写
WRITE p TO str. "char 型的可以这样写
CONDENSE str.
ENDIF.
ENDFORM.
FORM transnetwr USING p TYPE netpr "传入的金额字段
str TYPE char20. "传出的字符串
IF p < 0 .
p = - p.
WRITE p TO str.
CONDENSE str.
CONCATENATE '-' str INTO str.
p = - p.
ELSE.
* STR = P. "string 型的赋值这样写
WRITE p TO str. "char 型的可以这样写
CONDENSE str.
ENDIF.
ENDFORM.
*千位分隔符复杂写法
lv_menge = sl.
lv_menge = sl.
DATA: lv_left TYPE string,
lv_right(3) TYPE c.
DATA: lv_len TYPE i,
lv_mod TYPE i,
lv_start TYPE i,
lv_count TYPE i VALUE 1,
lv_str TYPE string.
DATA: BEGIN OF lw_tab,
tabix TYPE i,
value TYPE c,
END OF lw_tab,
lt_tab LIKE TABLE OF lw_tab.
lv_mod TYPE i,
lv_start TYPE i,
lv_count TYPE i VALUE 1,
lv_str TYPE string.
DATA: BEGIN OF lw_tab,
tabix TYPE i,
value TYPE c,
END OF lw_tab,
lt_tab LIKE TABLE OF lw_tab.
CONDENSE lv_menge NO-GAPS.
SPLIT lv_menge AT '.' INTO lv_left lv_right.
SPLIT lv_menge AT '.' INTO lv_left lv_right.
lv_len = STRLEN( lv_left ).
DO lv_len TIMES.
CLEAR lw_tab.
lw_tab-tabix = lv_count.
lv_start = lv_len - lv_count.
lw_tab-value = lv_left+lv_start(1).
APPEND lw_tab TO lt_tab.
ADD 1 TO lv_count.
ENDDO.
DO lv_len TIMES.
CLEAR lw_tab.
lw_tab-tabix = lv_count.
lv_start = lv_len - lv_count.
lw_tab-value = lv_left+lv_start(1).
APPEND lw_tab TO lt_tab.
ADD 1 TO lv_count.
ENDDO.
SORT lt_tab BY tabix.
LOOP AT lt_tab INTO lw_tab.
lv_mod = sy-tabix MOD 3.
IF lv_mod = 0.
CONCATENATE ',' lw_tab-value lv_str INTO lv_str.
ELSE.
CONCATENATE lw_tab-value lv_str INTO lv_str.
ENDIF.
ENDLOOP.
IF lv_str(1) EQ ','.
lv_len = STRLEN( lv_str ) .
lv_len = lv_len - 1.
lv_str = lv_str+1(lv_len).
ENDIF.
lv_len = STRLEN( lv_str ) .
lv_len = lv_len - 1.
lv_str = lv_str+1(lv_len).
ENDIF.
IF lv_right = '000'.
MOVE lv_str TO lv_left.
lv_menge = lv_left.
ELSE.
CONCATENATE lv_str '.' lv_right INTO lv_menge.
ENDIF.
sl = lv_menge.
*金额千位分隔符
FORM transnetwr USING p TYPE netpr "传入的金额字段
str TYPE char20. "传出的字符串
IF p < 0 .
p = - p.
WRITE p TO str.
CONDENSE str.
CONCATENATE '-' str INTO str.
p = - p.
ELSE.
* STR = P. "string 型的赋值这样写
WRITE p TO str. "char 型的可以这样写
CONDENSE str.
ENDIF.
ENDFORM.
FORM transnetwr USING p TYPE netpr "传入的金额字段
str TYPE char20. "传出的字符串
IF p < 0 .
p = - p.
WRITE p TO str.
CONDENSE str.
CONCATENATE '-' str INTO str.
p = - p.
ELSE.
* STR = P. "string 型的赋值这样写
WRITE p TO str. "char 型的可以这样写
CONDENSE str.
ENDIF.
ENDFORM.