We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

Re: RE:[sap-dev] How to Choose a Specific Layout by Name, Instead of ID?

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from szaboa on Jul 29 at 3:06 AM
Hi ChrisW!

Sorry for the late reply. Not from the control, but after choosing the specific layout the columns got into the requires sequence and I want to export the result. The exporting works fine, however the recorded macro record the rank of the layout, therefore if a new layout comes into the list, the result will be wrong.

Thanks!
Szaboa

---------------Original Message---------------
From: ChrisW_at_Work
Sent: Thursday, July 16, 2015 2:39 AM
Subject: How to Choose a Specific Layout by Name, Instead of ID?

Hi Szaboa,
Are you trying to export data from the control?
If so, then I use this to get all the Column names then export the data.
' this is in VBA for excel
'NB this is for a different SAP screen to yours!
'"======="
' get the control type
Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Type
' get the control name
Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Name
' get the control object type. Important.
Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").Text
Debug.Print "--------------"

' select all columns
s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").SelectAll
' get all the column names into a collection
Set A = s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").SelectedColumns
; the collection is zero based
For i = 0 To A.Count – 1
' get first name
sColumnName = A.Item(i)
' get the data for a row that column
Debug.Print s.findById("wnd[0]/usr/cntlGRID1/shellcont/sh ell/shellcont[1]/shell").GetCellValue(irow, sColumnName)
Next
'==
Best wishes
Chris

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2015 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
szaboa  

Business Operations Administrator
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language