2024 May 07 10:11 AM - edited 2024 May 07 11:57 AM
How do I SAP script to copy and paste, so it can go into excel as Ctrl + C, Ctrl + V doesn't record any sort of actions when recording a macro. I have 6 columns to copy the entirety of:
- Document
- Cust. No.
- Customer Name
- Doc. Date
- Net Value
- Internal Comment
session.findbyID("wnd[0]").maximize
session.findbyID("wnd[0]/tbar[0]/okcd").Text = "zvak"
session.findbyID("wnd[0]").sendVKey 0
session.findbyID("wnd[0]/usr/chkP_ANG").Selected = False
session.findbyID("wnd[0]/usr/chkP_GUT").Selected = False
session.findbyID("wnd[0]/usr/ctxtS_VBELN-LOW").Text = ""
session.findbyID("wnd[0]/usr/ctxtS_KUNNR-LOW").Text = ""
session.findbyID("wnd[0]/usr/chkP_GUT").SetFocus
session.findbyID("wnd[0]").sendVKey 8
session.findbyID("wnd[0]/tbar[1]/btn[33]").press
session.findbyID("wnd[1]/usr/subSUB_CONFIGURATION:SAPLSALV_CUL_LAYOUT_CHOOSE:0500/cntlD500_CONTAINER/shellcont/shell").setCurrentCell 33, "TEXT"
session.findbyID("wnd[1]/usr/subSUB_CONFIGURATION:SAPLSALV_CUL_LAYOUT_CHOOSE:0500/cntlD500_CONTAINER/shellcont/shell").selectedRows = "33"
session.findbyID("wnd[1]/usr/subSUB_CONFIGURATION:SAPLSALV_CUL_LAYOUT_CHOOSE:0500/cntlD500_CONTAINER/shellcont/shell").clickCurrentCell
session.findbyID("wnd[0]/usr/cntlGRID1/shellcont/shell/shellcont[0]/shell").SelectAll
TIA.
Request clarification before answering.
Hi. Are you trying to input data into SAP or extract SAP data into Excel?
Excel into SAP can just be done by name the cell as a variable and using that variable for a field in SAP (as below)
objSess.findById("wnd[0]/usr/ctxt*PROJ-PSPID").Text = Var1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.