批量创建SO
生成一般销售订单和退货订单所要使用的BAPI不同,
一般销售订单: BAPI_SALESORDER_CREATEFROMDAT2
退货订单: BAPI_CUSTOMERRETURN_CREATE
二者的参数基本一样。
以下为例:
" tables for bapi
DATA: gt_order_header_in LIKE bapisdhd1.
DATA: gt_order_header_inx LIKE bapisdhd1x.
DATA: gt_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: gt_message LIKE TABLE OF bapiret2 WITH HEADER LINE.
DATA: gt_order_items_in LIKE bapisditm OCCURS 0 WITH HEADER LINE.
DATA: gt_order_items_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE.
DATA: gv_salesdocument LIKE bapivbeln-vbeln.
DATA: gt_order_partners LIKE bapiparnr OCCURS 0 WITH HEADER LINE.
DATA: gt_schedules_in LIKE bapischdl OCCURS 0 WITH HEADER LINE.
DATA: gt_schedules_inx LIKE bapischdlx OCCURS 0 WITH HEADER LINE.
DATA: gt_order_conditions_in LIKE bapicond OCCURS 0 WITH HEADER LINE.
DATA: gt_order_conditions_inx LIKE bapicondx OCCURS 0 WITH HEADER LINE.
DATA: gt_order_text LIKE bapisdtext OCCURS 0 WITH HEADER LINE.
DATA: gv_number TYPE vbap-posnr.
" internal tables
TYPES: BEGIN OF ty_sales_order,
numbr TYPE i, " 序号
auart TYPE vbak-auart, " 订单类型
vkorg TYPE vbak-vkorg, " 销售组织
vtweg TYPE vbak-vtweg, " 分销渠道
spart TYPE vbak-spart, " 产品组
vkbur TYPE vbak-vkbur, " 销售办公室
vkgrp TYPE vbak-vkgrp, " 销售组
kunag TYPE vbak-kunnr, " 售达方
kunwe TYPE vbak-kunnr, " 送达方
kunre TYPE vbak-kunnr, " 收票方
kunrg TYPE vbak-kunnr, " 付款方
matnr TYPE vbap-matnr, " 物料编码
kwmeng TYPE vbap-kwmeng," 订单数量
zieme TYPE vbap-zieme, " 订单单位
werks TYPE vbap-werks, " 生产工厂
lgort TYPE vbap-lgort, " 仓库
kschl TYPE komv-kschl, " 条件类型
cond_value TYPE bapicond-cond_value, " 金额
bstkd TYPE vbkd-bstkd, "客户采购订单编号
charg TYPE vbap-charg, "批次
route TYPE vbap-route, "路线
END OF ty_sales_order.
TYPES:BEGIN OF ty_result,
numbr TYPE i, " 序号
vbeln TYPE vbak-vbeln,
message TYPE bapiret2-message,
bstkd TYPE vbkd-bstkd, "客户采购订单编号
END OF ty_result.
DATA: gs_result TYPE ty_result.
DATA: gt_result TYPE TABLE OF ty_result.
DATA: gs_sales_order TYPE ty_sales_order.
DATA: gt_sales_order TYPE TABLE OF ty_sales_order.
DATA: gv_error_exit_flag TYPE flag. " whether error exit
DATA: BEGIN OF gt_excel_result OCCURS 0,
text TYPE string,
END OF gt_excel_result.
DATA: gt_fcat TYPE lvc_t_fcat.
FIELD-SYMBOLS:
TYPE lvc_s_fcat.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
PARAMETERS p_file TYPE ibipparms-path OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
PARAMETERS p_th AS CHECKBOX. "是否为退货订单
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = '*.xls'
def_path = 'C:\'
mask = ',*.xls.'
mode = 'O'
title = 'Choose Input file'(002)
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
START-OF-SELECTION.
" upload excel
PERFORM process_logic.
*&---------------------------------------------------------------------*
*& Form UPLOAD_EXCEL
*&---------------------------------------------------------------------*
* upload excel
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM process_logic .
DATA: l_row TYPE i,
l_text TYPE string.
" local parameters
DATA: lt_file TYPE STANDARD TABLE OF alsmex_tabline.
DATA: ls_file TYPE alsmex_tabline.
FIELD-SYMBOLS: TYPE ty_sales_order.
" upload excel with sales order information
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 2
i_end_col = 37
i_end_row = 60000
TABLES
intern = lt_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE text-t01 TYPE 'E'.
ELSE.
" translate data
LOOP AT lt_file INTO ls_file.
l_row = ls_file-row + 1.
CASE ls_file-col.
WHEN '0001'. "序号
gs_sales_order-numbr = ls_file-value.
WHEN '0002'. " 订单类型
gs_sales_order-auart = ls_file-value.
WHEN '0003'. " 销售组织
gs_sales_order-vkorg = ls_file-value.
WHEN '0004'. " 分销渠道
gs_sales_order-vtweg = ls_file-value.
WHEN '0005'. " 产品组
gs_sales_order-spart = ls_file-value.
WHEN '0006'. " 销售办公室
gs_sales_order-vkbur = ls_file-value.
WHEN '0007'. " 销售组
gs_sales_order-vkgrp = ls_file-value.
WHEN '0008'. " 售达方
gs_sales_order-kunag = ls_file-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_sales_order-kunag
IMPORTING
output = gs_sales_order-kunag.
WHEN '0009'. " 送达方
gs_sales_order-kunwe = ls_file-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_sales_order-kunwe
IMPORTING
output = gs_sales_order-kunwe.
WHEN '0010'. " 收票方
gs_sales_order-kunre = ls_file-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_sales_order-kunre
IMPORTING
output = gs_sales_order-kunre.
WHEN '0011'. " 付款方
gs_sales_order-kunrg = ls_file-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = gs_sales_order-kunrg
IMPORTING
output = gs_sales_order-kunrg.
WHEN '0012'. " 物料编码
gs_sales_order-matnr = ls_file-value.
" conversion
IF gs_sales_order-matnr IS NOT INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = gs_sales_order-matnr
IMPORTING
output = gs_sales_order-matnr.
ENDIF.
WHEN '0013'. " 订单数量
gs_sales_order-kwmeng = ls_file-value.
WHEN '0014'. " 订单单位
gs_sales_order-zieme = ls_file-value.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = gs_sales_order-zieme
* LANGUAGE = SY-LANGU
IMPORTING
output = gs_sales_order-zieme.
WHEN '0015'. " 工厂
gs_sales_order-werks = ls_file-value.
WHEN '0016'. " 仓库
gs_sales_order-lgort = ls_file-value.
WHEN '0017'." 条件类型
gs_sales_order-kschl = ls_file-value.
WHEN '0018'." 价格
gs_sales_order-cond_value = ls_file-value.
WHEN '0019'."采购订单编号
gs_sales_order-bstkd = ls_file-value.
WHEN '0020'."批次
gs_sales_order-charg = ls_file-value.
WHEN '0021'."路线
gs_sales_order-route = ls_file-value.
WHEN OTHERS.
ENDCASE.
AT END OF row.
IF gs_sales_order-numbr = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“序号”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-auart = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“订单类型”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-vkorg = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“销售组织”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-vtweg = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“分销渠道”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-spart = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“产品组”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-vkbur = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“销售办公室”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-matnr = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“物料编码”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-kwmeng = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“订单数量”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-zieme = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“订单单位”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-werks = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“工厂”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
IF gs_sales_order-lgort = ''.
l_text = l_row.
CONCATENATE '第' l_text '行“库存地”不能为空。' INTO l_text.
gt_excel_result-text = l_text.
APPEND gt_excel_result.
ENDIF.
APPEND gs_sales_order TO gt_sales_order.
CLEAR gs_sales_order.
ENDAT.
ENDLOOP.
IF gt_excel_result[] IS NOT INITIAL.
LOOP AT gt_excel_result.
WRITE:/ gt_excel_result-text.
ENDLOOP.
ELSE.
SORT gt_sales_order BY numbr
auart " 订单类型
vkorg " 销售组织
vtweg " 分销渠道
spart " 产品组
vkbur " 销售办公室
vkgrp " 销售组
kunag " 售达方
kunwe " 送达方
kunre " 收票方
kunrg. " 付款方
" build records and calling bapi
LOOP AT gt_sales_order ASSIGNING .
gv_number = gv_number + 10.
" build records
PERFORM build_records_4_bapi USING .
" one order with serval items
AT END OF numbr.
" build header
PERFORM build_header_4_bapi USING .
" call bapi to upload sales order
PERFORM upload_sales_order_with_bapi USING .
CLEAR gv_number.
ENDAT.
ENDLOOP.
" if no error exist , raise report
IF gv_error_exit_flag IS INITIAL AND gt_result IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
PERFORM frm_show_detail.
ELSEIF gv_error_exit_flag IS NOT INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' .
PERFORM frm_pop_showmessage USING 'E'.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " UPLOAD_EXCEL
*&---------------------------------------------------------------------*
*& Form BUILD_RECORDS_4_BAPI
*&---------------------------------------------------------------------*
* build records for calling bapi
*----------------------------------------------------------------------*
* -->P_GS_SALES_ORDER text
*----------------------------------------------------------------------*
FORM build_records_4_bapi USING ps_sales_order TYPE ty_sales_order.
" item data
CLEAR gt_order_items_in.
gt_order_items_in-itm_number = gv_number.
gt_order_items_in-material = ps_sales_order-matnr.
gt_order_items_in-plant = ps_sales_order-werks.
gt_order_items_in-store_loc = ps_sales_order-lgort.
gt_order_items_in-target_qty = ps_sales_order-kwmeng.
gt_order_items_in-target_qu = ps_sales_order-zieme.
gt_order_items_in-sales_unit = ps_sales_order-zieme.
gt_order_items_in-batch = ps_sales_order-charg.
gt_order_items_in-route = ps_sales_order-route.
APPEND gt_order_items_in.
CLEAR gt_order_items_inx.
gt_order_items_inx-updateflag = '1'.
gt_order_items_inx-material = abap_true.
gt_order_items_inx-plant = abap_true.
gt_order_items_inx-store_loc = abap_true.
gt_order_items_inx-target_qty = abap_true.
gt_order_items_inx-target_qu = abap_true.
gt_order_items_inx-sales_unit = abap_true.
gt_order_items_inx-batch = abap_true.
gt_order_items_inx-route = abap_true.
APPEND gt_order_items_inx.
" fill schedules
CLEAR gt_schedules_in.
gt_schedules_in-itm_number = gv_number.
gt_schedules_in-req_qty = ps_sales_order-kwmeng.
APPEND gt_schedules_in.
CLEAR gt_schedules_inx.
gt_schedules_inx-updateflag = 'X'.
gt_schedules_inx-itm_number = abap_true.
gt_schedules_inx-req_qty = abap_true.
APPEND gt_schedules_inx.
CLEAR gt_order_conditions_in.
CLEAR gt_order_conditions_inx.
IF ps_sales_order-kschl <> ''.
gt_order_conditions_in-itm_number = gv_number.
gt_order_conditions_in-cond_type = ps_sales_order-kschl. "定价条件
gt_order_conditions_in-cond_value = ps_sales_order-cond_value. "价格
gt_order_conditions_in-currency = 'CNY'. "币别
APPEND gt_order_conditions_in.
gt_order_conditions_inx-updateflag = 'X'.
gt_order_conditions_inx-cond_type = abap_true. "定价条件
gt_order_conditions_inx-cond_value = abap_true. "价格
gt_order_conditions_inx-currency = abap_true. "币别
APPEND gt_order_conditions_inx.
ENDIF.
ENDFORM. " BUILD_RECORDS_4_BAPI
*&---------------------------------------------------------------------*
*& Form UPLOAD_SALES_ORDER_WITH_BAPI
*&---------------------------------------------------------------------*
* calling bapi
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM upload_sales_order_with_bapi USING ps_sales_order TYPE ty_sales_order .
" clear
CLEAR: gt_return,
gt_return[],
gv_salesdocument.
IF p_th IS INITIAL.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = gt_order_header_in
order_header_inx = gt_order_header_inx
IMPORTING
salesdocument = gv_salesdocument
TABLES
return = gt_return
order_items_in = gt_order_items_in
order_items_inx = gt_order_items_inx
order_partners = gt_order_partners
order_schedules_in = gt_schedules_in
order_schedules_inx = gt_schedules_inx
order_conditions_in = gt_order_conditions_in
order_conditions_inx = gt_order_conditions_inx.
ELSE.
CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
EXPORTING
RETURN_HEADER_IN = gt_order_header_in
RETURN_HEADER_INX = gt_order_header_inx
IMPORTING
SALESDOCUMENT = gv_salesdocument
TABLES
return = gt_return
RETURN_ITEMS_IN = gt_order_items_in
RETURN_ITEMS_INX = gt_order_items_inx
RETURN_PARTNERS = gt_order_partners
RETURN_SCHEDULES_IN = gt_schedules_in
RETURN_SCHEDULES_INX = gt_schedules_inx
RETURN_CONDITIONS_IN = gt_order_conditions_in.
ENDIF.
READ TABLE gt_return WITH KEY type = 'E'.
IF sy-subrc = 0.
LOOP AT gt_return WHERE type = 'E'.
gt_message = gt_return.
gt_message-message_v4 = ps_sales_order-numbr.
APPEND gt_message.
ENDLOOP.
gv_error_exit_flag = abap_true.
ELSE.
IF gv_salesdocument IS NOT INITIAL.
CLEAR gs_result.
gs_result-numbr = ps_sales_order-numbr.
gs_result-vbeln = gv_salesdocument.
gs_result-bstkd = ps_sales_order-bstkd.
CONCATENATE '销售订单' gs_result-vbeln '创建成功' INTO gs_result-message.
APPEND gs_result TO gt_result.
ENDIF.
ENDIF.
" refresh
PERFORM refresh.
ENDFORM. " UPLOAD_SALES_ORDER_WITH_BAPI
*&---------------------------------------------------------------------*
*& Form BUILD_HEADER_4_BAPI
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_GS_SALES_ORDER text
*----------------------------------------------------------------------*
FORM build_header_4_bapi USING ps_sales_order TYPE ty_sales_order.
" build header data
CLEAR gt_order_header_in.
gt_order_header_in-doc_type = ps_sales_order-auart.
gt_order_header_in-sales_org = ps_sales_order-vkorg.
gt_order_header_in-distr_chan = ps_sales_order-vtweg.
gt_order_header_in-division = ps_sales_order-spart.
gt_order_header_in-sales_off = ps_sales_order-vkbur.
gt_order_header_in-sales_grp = ps_sales_order-vkgrp.
IF ps_sales_order-bstkd IS NOT INITIAL.
gt_order_header_in-purch_no_c = ps_sales_order-bstkd.
gt_order_header_inx-purch_no_c = abap_true.
gt_order_header_in-purch_no_s = ps_sales_order-bstkd.
gt_order_header_inx-purch_no_s = abap_true.
ENDIF.
CLEAR gt_order_header_inx.
gt_order_header_inx-doc_type = abap_true.
gt_order_header_inx-sales_org = abap_true.
gt_order_header_inx-distr_chan = abap_true.
gt_order_header_inx-division = abap_true.
gt_order_header_inx-sales_off = abap_true.
gt_order_header_inx-sales_grp = abap_true.
gt_order_header_inx-updateflag = '1'.
IF ps_sales_order-bstkd IS NOT INITIAL.
gt_order_header_inx-purch_no_c = abap_true.
gt_order_header_inx-purch_no_s = abap_true.
ENDIF.
" partner function
CLEAR gt_order_partners.
gt_order_partners-partn_role = 'AG'.
gt_order_partners-partn_numb = ps_sales_order-kunag.
APPEND gt_order_partners.
CLEAR gt_order_partners.
gt_order_partners-partn_role = 'WE'.
gt_order_partners-partn_numb = ps_sales_order-kunwe.
APPEND gt_order_partners.
CLEAR gt_order_partners.
gt_order_partners-partn_role = 'RE'.
gt_order_partners-partn_numb = ps_sales_order-kunre.
APPEND gt_order_partners.
CLEAR gt_order_partners.
gt_order_partners-partn_role = 'RG'.
gt_order_partners-partn_numb = ps_sales_order-kunrg.
APPEND gt_order_partners.
ENDFORM. " BUILD_HEADER_4_BAPI
*&---------------------------------------------------------------------*
*& Form REFRESH
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM refresh .
CLEAR:
gt_order_header_in,
gt_order_header_inx,
gv_salesdocument,
gt_return,
gt_return[],
gt_order_items_in,
gt_order_items_in[],
gt_order_items_inx,
gt_order_items_inx[],
gt_order_partners,
gt_order_partners[],
gt_schedules_in,
gt_schedules_in[],
gt_schedules_inx,
gt_schedules_inx[],
gt_order_conditions_in,
gt_order_conditions_in[],
gt_order_conditions_inx,
gt_order_conditions_inx[].
ENDFORM. " REFRESH
*&---------------------------------------------------------------------*
*& Form FRM_SHOW_DETAIL
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM frm_show_detail .
APPEND INITIAL LINE TO gt_fcat ASSIGNING .
-fieldname = 'NUMBR'.
-coltext = '序号'.
APPEND INITIAL LINE TO gt_fcat ASSIGNING .
-fieldname = 'VBELN'.
-coltext = '订单号'.
APPEND INITIAL LINE TO gt_fcat ASSIGNING .
-fieldname = 'MESSAGE'.
-coltext = '消息'.
APPEND INITIAL LINE TO gt_fcat ASSIGNING .
-fieldname = 'BSTKD'.
-coltext = '采购订单号'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
it_fieldcat_lvc = gt_fcat
TABLES
t_outtab = gt_result
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM. " FRM_SHOW_DETAIL
*&---------------------------------------------------------------------*
*& Form FRM_POP_SHOWMESSAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_0899 text
*----------------------------------------------------------------------*
FORM frm_pop_showmessage USING p_type TYPE bapi_mtype.
CALL FUNCTION 'MESSAGES_INITIALIZE'. "20140213 Chung 消息处理
LOOP AT gt_message
WHERE type = p_type.
CONDENSE gt_message-message_v4.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
arbgb = gt_message-id
exception_if_not_active = ' '
msgty = gt_message-type
msgv1 = gt_message-message_v1
msgv2 = gt_message-message_v2
msgv3 = gt_message-message_v3
* msgv4 = gt_message-message_v4
txtnr = gt_message-number
zeile = gt_message-message_v4
EXCEPTIONS
message_type_not_valid = 1
not_active = 2
OTHERS = 3.
ENDLOOP.
CALL FUNCTION 'MESSAGES_SHOW'
EXCEPTIONS
inconsistent_range = 1
no_messages = 2
OTHERS = 3.
ENDFORM. " FRM_POP_SHOWMESSAGE
批量创建SO的更多相关文章
- 批量创建10个用户stu01-stu10
1.批量创建10个用户stu01-stu10,并且设置随机8位密码,要求不能用shell循环(例如:for,while等),只能用命令及管道实现. ##方法1: [root@server tmp]# ...
- 批量创建AD测试账号
在现场中,有时候客户会要求做一下AD压力测试,需要批量创建很多AD用户.奉献此代码供各位参考. 1: <# 2: 3: .DESCRIPTION 4: 批量创建AD测试账号 5: 6 ...
- mkdir:批量创建文件夹
问题:mkdir dir[0-9]创建文件夹时,并没有如预期创建dir0~dir9这几个文件夹,而是创建了dir[0-9]这一个文件夹. 网上看了些相关资料,发现以前对[0-9]的理解不够透彻: &q ...
- 使用Java中File类批量创建文件和批量修改文件名
批量创建文件 int cont = 1; String s = "E:\\学习资料\\Java笔记-"; while(cont<100){ File f = new File ...
- [工具] 分布式系统下批量创建用户及分发公钥打通ssh通道的脚本
在分布式系统下偶尔会有这样的需求,要增加一个服务时,需要在集群的所有节点上创建同一个用户,然后打通ssh通道,再分发软件包.配置.执行命令.启动服务... 这个问题的根源是如何集中配置和管理系统,专业 ...
- 【转】dsadd user批量创建AD用户命令详解
常见的批量创建用户的方法有四种: 一. 帐户模板的方式 二. CSVDE和LDIFDE 三. 脚本的方式 四. DSADD 但是很少有详细的资料使用DSADD的方式来批量创建帐户,那么我就把我近期使用 ...
- AD批量创建用户
实验环境:Windows Server 2008R 2 由于测试需要,需要创建数百个用户,手动创建当然不可取,此时需要批量创建,操作记录如下 1 首先将要批量创建的人员信息导入到一个csv文件中,表中 ...
- salt进程查看插件&salt批量创建用户
接受key 剔除主机 启动 salt-minion-d 软件包的安装 salt '*' state.sls init.env-init test=true salt批量创建用户: ...
- Python 批量创建同文件名的特定后缀文件
看了很多批量创建文件和文件批量格式转换的code,感觉杀鸡焉用牛刀,自己写了几行轻量级的拿来给大家参考: 在out_dir目录下批量创建与in_dir目录下同文件名但后缀不同的文件. in_dir = ...
- SERVER 2012 R2 core域环境下批量创建用户
Write by xiaoyang 转载请注明出处 步骤一:创建域 基本配置 1. 输入命令进入配置 2. 输入8进入网络配置 3. 选择要配置的网 ...
随机推荐
- html、css基础注意点
之前第一次接触html,一直使用table进行布局,十分麻烦还相当丑陋,造成当初并没有多大的兴趣,直到半年前开始接触到了使用div+css编写页面,才对它有了兴趣.作为一个菜鸟记录自己的点滴教训与收获 ...
- 《Pro Express.js》学习笔记——app.params中间件
app.param中间件用于对URL中的参数进行获取.加工.输出,提供公有逻辑,以达到代码重构的目的. 以下示例采取三个步骤对代码进行重构,app.param中间件的作用非常明显: 不使用中间件 使用 ...
- Websocket 协议解析
WebSocket protocol 是HTML5一种新的协议.它是实现了浏览器与服务器全双工通信(full-duplex). 现 很多网站为了实现即时通讯,所用的技术都是轮询(po ...
- 研二下学期做的第一个项目(主要关于datagridview的一些笔记)
首先是行标题列rowheader dataGridView1.TopLeftHeaderCell.Value = "details"; ______________________ ...
- [小菜随笔]关于monkey报错日志分析
今天小菜在一个测试群内看到群友发出一个monkey的报错信息,其实是一个很简单的报错 个人觉得monkey虽然操作起来比较简易,但其实查看日志分析日志也是很重要的环节,如果对错误分析不够详细,就容易误 ...
- 在gridControl的单元格中的多行文本
我们知道,gridcontrol里面的单元格默认是不能换行的,但是有时候我们需要显示要换行的文本,应该怎么处理呢?这里提供一个方案: 假设我有一个列”合同文本“(colContractText),我要 ...
- Java泛型学习笔记 - (七)浅析泛型中通配符的使用
一.基本概念:在学习Java泛型的过程中, 通配符是较难理解的一部分. 主要有以下三类:1. 无边界的通配符(Unbounded Wildcards), 就是<?>, 比如List< ...
- java之并发编程:Lock
这是转的:http://www.cnblogs.com/dolphin0520/p/3923167.html * 在多线程编程里面一个重要的概念是锁定,如果一个资源是多个线程共享的,为了保证数据的完整 ...
- 微信Auth2.0授权的时候出现两次回调
在获取用户OpenID的时候 $url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".WX_APPID. ...
- HeadFirst 设计模式
一.设计原则 封装变化 多用组合,少用继承 针对接口编程,不针对实现编程 为交互对象之间的松紧耦合设计而努力 对扩展开放,都修稿关闭 依赖抽象,不要依赖具体类 最少知识原则:之和朋友交谈 好莱坞原则: ...