批量创建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. 选择要配置的网 ...
随机推荐
- Android扫盲教程大全经典教程全分享
Android扫盲教程大全经典教程全分享,相当于android的简单用户手册下载路径 Android扫盲教程大全经典教程全分享.rar
- 在 Xcode 7 中安装 Alcatraz
http://www.jianshu.com/p/5c8ed25ad434 安装Xcode7后,继续采用官方方法安装Alcatraz,发现不成功.单独安装XVim也不成功.看了一下Alcatraz的i ...
- Bootstrap<基础十一>字体图标(Glyphicons)
字体图标(Glyphicons),并通过一些实例了解它的使用.Bootstrap 捆绑了 200 多种字体格式的字形. 获取字体图标 我们已经在 环境安装 章节下载了 Bootstrap 3.x 版本 ...
- 解决iis+php+mysql访问速度慢的方法
IIS7.5网站访问PHP响应慢的原因原因是PHP5.3以上支持IPv6协议,但是大家的服务器未使用IPv6,当访问PHP的时候会连接MySQL的地址为localhost,系统会会先用IPv6连接,但 ...
- codeblocks个性化配置
1.general setting设置默认字体大小设置控制台字体大小:"Settings -> Environment -> View -> Message logs' f ...
- 关于lwip移植到ucsos-ii平台的遇到的问题(一)
移植的步骤参照<Day_Day_Up笔记之uCOS-II_LwIP_在_STM32F107_上移植>,<uCOS平台下的LwIP移植笔记>,<嵌入式网络那些事>. ...
- 关于编译报错“dereferencing pointer to incomplete type...
今天同事问了我一个问题,他make的时候报错,“第201行:dereferencing pointer to incomplete type”,我随即查阅了很多资料,也没看出个所以然.最后问题得到了解 ...
- Mac上安装与更新Ruby,Rails运行环境
Mac安装后就安装Xcode是个好主意,它将帮你安装好Unix环境需要的开发包,也可以独立安装command_line_tools_for_xcode 1.安装RVM RVM:Ruby Version ...
- MySQL,排序,统计行转列
表 -- ------------------------------ Table structure for a-- ---------------------------- DROP TABLE ...
- Android中ListView控件的使用
Android中ListView控件的使用 ListView展示数据的原理 在Android中,其实ListView就相当于web中的jsp,Adapter是适配器,它就相当于web中的Servlet ...