1. 代码:
DATA:lv_date TYPE d.
DATA:lv_datestring TYPE string."传到OA的日期,如2023-01-09
lv_date = sy-datum.
CONCATENATE lv_date+0(4) lv_date+4(2) lv_date+6(2)
INTO lv_datestring
SEPARATED BY '-'.
ls_main1-field_name = 'CJSJ'.
ls_main1-field_value = lv_datestring.
ls_main1-view = 'X'.
ls_main1-edit = 'X'.
APPEND ls_main1 TO lt_main1.