cancel
Showing results for 
Search instead for 
Did you mean: 

GetByKey for Documents :(

AlexGrebennikov
Active Contributor
0 Kudos

Hi, friends!

Could you say me, if this snippet is the only solution to open needed document manually?

In other words, i need to open via UI a Purchase Order form for order #xx on dd.mm.yyyy date.

I havn't find any way to done it as in MasterData.GetByKey().


SAPbouiCOM.Form         frmPurchOrd = null;
SAPbouiCOM.EditText     oOrdNum;
SAPbouiCOM.EditText     oOrdDate;
SAPbouiCOM.Item         oOrdOkButton;
int frmPOCount = 0;

// simulate menu-click //
SBOApp.ActivateMenuItem("2305");

// look for count of opened forms with type 142 (PurhOrder)
for (int k=0; k<SBOApp.Forms.Count; k++)
if (SBOApp.Forms.Item(k).Type == 142)
frmPOCount++;

// find form
frmPurchOrd     = SBOApp.Forms.GetFormByTypeAndCount(142, frmPOCount++);
frmPurchOrd.Freeze(true);

// change its mode from add to find
frmPurchOrd.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;
oOrdNum                 = (SAPbouiCOM.EditText)

// fill the items
frmPurchOrd.Items.Item("8").Specific;
oOrdNum.String  = OrdNum;
oOrdDate                = (SAPbouiCOM.EditText)frmPurchOrd.Items.Item("10").Specific;
oOrdDate.String = OrdDate.ToShortDateString();
oOrdOkButton    = (SAPbouiCOM.Item)frmPurchOrd.Items.Item("1");

// simulate find-button click
oOrdOkButton.Click(SAPbouiCOM.BoCellClickType.ct_Regular);
frmPurchOrd.Freeze(false);

thanx.

sorry for my En.

I reply to forumadmins to fix the comment-trouble, plz

Message was edited by: Alexey Grebennikov

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Alexey

Why don't you use the linked button? This object has the property LinkedObject, where you can specify the form you want to open.

Daniel Rial

AlexGrebennikov
Active Contributor
0 Kudos

Thanx for reply, Daniel, but as i know it is impossible to embed a LinkButton in Matrix i am using.. I still use SBO 7.6 (it's localisation for 6.5), may be in v.2004 it'll be possible.

former_member185703
Active Contributor
0 Kudos

Hi Alexey,

According to the "Release Planning" page on Service Marketplace, 2004 C Ramp-Up (2004 C is the edition for Czech Republic, Hungary, Poland, Russia, Slovakia) is planned for this quarter.

Maybe you could convince your manager - or the customer to wait for general availability of this version - or even partcipate in the Ramp-Up?

Re your workaround:

Maybe you could have a "secret" (i.e. invisible) linked button + edittext on the form which you just visibilize / enable / bring to the current pane level when you want to launch the document, but keep it somewhere out of sight (e.g. oForm.Left = - 200). Afterwards you could hide it again entirely.

Regards,

Frank

AlexGrebennikov
Active Contributor
0 Kudos

Thanx!

I'll thy this way..