Application Development and Automation 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: 
Read only

DI API emulate Ctrl Tab in SAP

Former Member
0 Likes
2,074
  • SAP Managed Tags

Hi,


Is there any way to put in your value for CardName instead of getting its corresponding value based on the inputted CardCode? Because if you use DI API, it automatically gets the values corresponding to the CardCode inputted. I want to put in a different value without editing the BP Master, more like using the Ctrl Tab after entering the different card name in a document in SAP.

Hi,


Is there any way to put in your value for CardName instead of getting its corresponding value based on the inputted CardCode? Because if you use DI API, it automatically gets the values corresponding to the CardCode inputted. I want to put in a different value without editing the BP Master, more like using the Ctrl Tab after entering the different card name in a document in SAP.

4 REPLIES 4
Read only

ens_
Active Participant
0 Likes
1,558
  • SAP Managed Tags

Dear limdentin,

You can use the `SendKeys()` Method described in SAP Business One SDK Help.

Application.SBOAplication.SendKeys("{^}{TAB}");


Here are all the supported keys;

Backspace {BACKSPACE}, {BS}, or {BKSP}

Break {BREAK}

Caps Lock {CAPSLOCK}

Delete {DELETE} or {DEL}

Down Arrow {DOWN}

End {END}

Enter {ENTER}

Esc {ESC}

Help {HELP}

Home {HOME}

Insert {INSERT} or {INS}

Left Arrow {LEFT}

Num Lock {NUMLOCk}

Page Down {PGDN}

Page Up {PGUP}

Right Arrow {RIGHT}

Scroll Lock {SCROLLLOCK}

Tab {TAB}

Up Arrow {UP}

F1, F2, F3... {F1}, {F2}, {F3}...

Combination Keys;

Shift {+}

Ctrl {^}

Alt {%}


Sincerely,

Varnavas Eleftheriou

Read only

Former Member
0 Likes
1,558
  • SAP Managed Tags

Hi,

I mean how to force CardName to be value I pass in DI, not the one corresponding value of CardCode in OCRD.

Example in Incoming Payment, I use Customer1 as CardCode. In OCRD table, Customer1 has corresponding Dennis as CardName.

When I use DI API to add Incoming Payment, I don't want DI to automatically put Dennis as CardName, I want to put in another value say Peter.

In SAP application you can do this by inputting Peter in the Name field then press Ctrl Tab to go to the next field in the form.

Read only

ens_
Active Participant
0 Likes
1,558
  • SAP Managed Tags

Dear limdentin,

You have to set the cardname right after you set the cardcode

oIP = ((SAPbobsCOM.Documents)(globals.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)));
oIP.CardCode = bpcode;
oIP.CardName = "NewNameYouWantToGiveToTheDocument";

Sincerely,

Varnavas Eleftheriou

Read only

Former Member
0 Likes
1,558
  • SAP Managed Tags

Hi Varnavas,

I already did that. Still CardName is based on CardName in OCRD not inputted CardName in code

Set oPayments = sapCompany.GetBusinessObject(oIncomingPayments)
oPayments.CardCode = .Fields("CardCode")

oPayments.CardName = .Fields("CardName")

After adding it to SAP, I check on Incoming Payment document, CardName is not the one I wanted but the one in the Business Partner.