Skip to main content

Setting Document Type with a Macro

Answered

Comments

8 comments

  • Official comment
    Yaremi Miranda Lopez

    Hello Stuart,

    I have a macro that changes the document type when the Business Partner is selected and it works fine. Here is it:

  • Nadav Caridi

    Hi , 

    you can use set focus / send keys with enter after setting the value, just be aware that send keys isn't recommended by boyum.

    might be a cleaner way to do this (?)

  • Stuart Blackwell

    In theory that should work, but in practice, after using either Focus or Click to select the ComboBox,  no following input works. Using Set, or SendKeys has no impact on the screen and the ComboBox remains open awaiting user input.

  • Nadav Caridi

    ok try use dynamic code as follows : 

     

    SAPbouiCOM.ComboBox myCombo = (SAPbouiCOM.ComboBox)form.Items.Item("3").Specific;
    myCombo.Select("S", SAPbouiCOM.BoSearchKey.psk_ByValue);

  • Stuart Blackwell

    Aside from needing the change "S" to "I" for setting it to Item Type, it works perfectly. Thank you.

  • Nadav Caridi

    Sure , maybe theres a better way to do this with B1UP , I'm not sure.

    Glad it worked. 

  • Stuart Blackwell

    Thanks for the official comment Yaremi, but that is exactly what I was trying to do originally and it did not work for me.

  • Yaremi Miranda Lopez

    Hello Stuart,

    Maybe the event is not triggering the universal function, I tested and worked for me, if the problem persists please contact your local support so we can investigate further. =)

Please sign in to leave a comment.