cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create a button for draft documents

Former Member
0 Likes
920

Hi all!

I know the only way to generate a draft document is to go to File -> Save as draft document. But is not very user friendly...

So I want to create a button in sales documents for drafts.

When the user clicks the button the document is added as draft.

Is it possible?

Or is there a better solution?

Thanks in advance for every help!

Kindest regards,

Veronica Vezzali

View Entire Topic
Former Member
0 Likes

Hi Veronica,

If you add the button, and capture the click event, the only thing you need to do is to "simulate" a click event on that menu with this code

App.ActivateMenuItem(MenuUID)

Where App is the Application object and the MenuUID, the menu UID for the "Save as draft document" menu item (5907).

Regards,

Ibai Peña

PS: A couple of minutes late...

Former Member
0 Likes

Hi.

It works, but I have a message

Menu - Can not activate a disabled menu item

Besides an other question.

When I create the button for draft document in quotation, the button is always in the same position when I resize the form. And this is OK!

But, for example, in delivery, the button positions changes when I resize the delivery form. And this is not correct.

This my code to create draft delivery button:

            'delivery
            If pVal.FormTypeEx = "140" Then
                Set oForm = SBOApplication.Forms.GetForm("140", i)
                rifL = oForm.Items("68").Left + oForm.Items("68").Width + 5
                rifT = oForm.Items("68").Top
            End If
            Dim oItem As SAPbouiCOM.Item
            Set oItem = oForm.Items.Add("BParch", it_BUTTON)
            oItem.Top = rifT
            oItem.Height = 19
            oItem.Left = rifL
            oItem.Width = 65

            oItem.Visible = True

            Dim oButton As SAPbouiCOM.Button
            Set oButton = oItem.Specific
            oButton.Caption = "PARCH."

Can you help me?

Thanks in advance for your help.

Kindest regards,

Veronica Vezzali

Former Member
0 Likes

re: Menu - Can not activate a disabled menu item

Before activating a menuitem you may want to

a) check that the menuitem is enabled, and/or

b) make sure that you have focus on a form/transaction (in a mode) that has the menuitem enabled

re: button position / resizing

HTH

Juha