728x90
우선 test할 서버의 스크립트 기록 및 재생이 비활성화 되어있어서 활성화처리 함.
Try to go to Transaction RZ11.
Enter Param.Name: sapgui/user_scripting
Click on 'Display' button.
After that click on 'Change Value' button'.
In the 'New value' filed Enter 'True' and save it.
connect again to your system and it will be available.
그 결과 ) 활성화 되었음~~
FI의 컨버젼 사전 작업 중, 잔액을 원장 기준으로 마이그레이션 해주는 IMG 세팅이 있다.
현재 프로젝트에서 회사코드가 131개이고 그에 따른 회계연도가 5개라고 쳐도
600개정도를 일일히 처리 해야하는 상황임..
심지어 해당 IMG 세팅은 한번에 처리가 안되고 신규엔트리 버튼을 눌러서
"일일히 입력하고 저장하고" 행위를 600번 해야한다는 말....
그래서 VBA 를 이용하여 매크로를 만들어서 실행함
( 스크립팅은 메모장으로 여니까 글자가 깨져서 활용못했음 ㅠㅠ)
Private Sub CommBtn1_Click()
Dim SapGuiAuto, Application, Connection, session, grid, t
Dim i As Integer, rng As Range
If Not IsObject(Application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set Application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = Application.Children(0)
End If
If Not IsObject(session) Then
Set session = Connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject Application, "on"
End If
session.findById("wnd[0]").maximize
Set rng = [A2]
'rng.Offset(, 1).Resize.ClearContents 'Data영역 초기화
i = 1
session.findById("wnd[0]/tbar[0]/okcd").Text = "/nS_E91_86000185" 'T-Code : S_E91_86000185
session.findById("wnd[0]").sendVKey 0 'Enter
session.findById("wnd[0]").sendVKey 5 'F5 click
Do While rng <> "" '지정된 Excel에 값을 확인
session.findById("wnd[0]/usr/ctxtFGLV_MIG_SOURCE-RLDNR").Text = rng.Value 'A2에는 원장
session.findById("wnd[0]/usr/ctxtFGLV_MIG_SOURCE-BUKRS").Text = rng.Offset(, 1) '회사코드
session.findById("wnd[0]/usr/txtFGLV_MIG_SOURCE-FROM_YEAR").Text = rng.Offset(, 2) '기준년도
session.findById("wnd[0]/usr/ctxtFGLV_MIG_SOURCE-SLDNR").Text = rng.Offset(, 3) '소스원장
i = i + 1
Set rng = rng.Offset(1)
session.findById("wnd[0]").sendVKey 8
Loop
MsgBox "JOB Clear !!"
End Sub
728x90
'Ⅰ. ERP > 6. 에러해결' 카테고리의 다른 글
[에러해결] error when generating selection screen 1000 of report in sap (0) | 2023.08.22 |
---|---|
[SAP DUMP] DBSQL_DUPLICATE_KEY_ERROR (0) | 2022.12.29 |
[SAP DUMP] SAPSQL_IN_ITAB_ILLEGAL_OPTION 2022.12.22 14:43:47 (0) | 2022.12.22 |
[SAP ABAP] MODIFY DB .. FROM TABLE ITAB 에서 같은 이름명 쓰면 안됨 (0) | 2022.12.14 |
[SAP ABAP] LOOP itab1 .. MODIFY itab2. ENDLOOP. 안됨 (0) | 2022.12.14 |