Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP GUI Scripting in ME51N

former_member593937
Discoverer
0 Kudos
746

Hi All,

Trying to Create Requisitions ME51N (screenshot) from excel/access via SAP GUI Scripting and have an issue with the dynamic path to the controls on form. For example it is required to choose few tabs

Valuation tab

session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:XXXX/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:3303/tabsREQ_ITEM_DETAIL/tabpTABREQDT5").Select

Text tab

session.findById("wnd[0]/usr/subSUB0:SAPLMEGUI:XXXX/subSUB3:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1301/subSUB2:SAPLMEGUI:3303/tabsREQ_ITEM_DETAIL/tabpTABREQDT13").Select

XXXX depends on the amount of controls on form, e.g.:

0013/0010 - 1st item of requisition

0020/0010 - item's account type (Account Assignment tab appears)

0019/0015 - if header section is collapsed that happens automatically (sic!) if content does not fit SAP window

Please advise how to avoid multiple if/else and maybe select controls by their names in this transaction rather than by id.

2 REPLIES 2

leonardofreitas
Active Participant
0 Kudos
232

Hi,

Please try post that topic in ABAP community, they will help you better on this for sure.

Att,

Leonardo de Freitas

0 Kudos
232

Hi Leonardo,

Thanks for advise, but how can I move this topic there?

Shall I just delete it and post new one with correct tags?

This forum structure is slightly confusing..