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

Adding rows to a table without an insert or append row button

Former Member
0 Likes
1,662

Here's a challenging one for anyone up to it.

I am trying to add multiple identification rows to business partners.

It's easy to duplicate:

In transaction BP create a Person or Organization Business Partner (General). You don't need to enter any data.

On the "Identification" tab, in the "Identification Numbers" box enter a row. For example:

CRM001 1

CRM001 2

CRM001 3

CRM001 4

CRM001 5

CRM001 6

CRM001 7

CRM001 8

CRM001 9

This is all well and good if I record each row. Of course I don't know the data or number of rows before so I have to create a loop around one insert. I can loop and add rows, the problem is that after 4 rows I can't get it to enter a new row; it just keeps overwriting the last row. I have tried recording page downs, enters. I have tried parameterizing the row ID in the script (<!V_ROWNUM!>) and looping on that; it works for the first rows but after that just keeps overwriting. This is a different type of table than I have been able to add rows before; it doesn't have an insert row button. I have spent three full days trying everything I can think of. Can anybody help? Thank you.

David

P.S. I am not an ABAP'er so prefer not to use ABAP...ENDABAP if possible. I'd like to be able to use the technique in the future without trying to get a programmer's time (which is not possible).

7 REPLIES 7
Read only

Vny12
Product and Topic Expert
Product and Topic Expert
0 Likes
1,382

Hi david,

Do a mod 4 on loop counter count and after every 0 ( 1 mod 4, 2 mod 4, 3 mod 4, 4 mod 4).

4 mod 4 is 0 , here please record a page down , you can see 3 rows get moved.

Now problem is i dont have last row for mod 4.

So for every count of multiple of 3 do a page down .

it should work.

best regards

vinay

Note - use ABAP ENDABAP for MOD , ecatt does not support MOD.

Read only

Former Member
0 Likes
1,382

Hi Vinay,

Thanks for your suggestion; I haven't forgotten. I'm going to spend some time over Christmas vacation with an ABAP book and try out your suggestion. I'll let you know how it goes, thanks again.

David

Read only

Former Member
0 Likes
1,382

Hello David,

As far as i see it should work. Usually recordings are performed to add one row into the table and the looping is performed based on the number of entries passed to enter into the table.

Using GETLEN find the number of entries passed , get this value into the local variable and loop the recording of entrieing the value into the table some many times.

As you are saying the entry is getting overwritten, this is due to not change in the ID. probably you can paste your coding in the word docuement .

We can have a look at it. I have worked rigrously adding multiple rows and till now it works as expected.

Merry Christmas.

Thanks & Best regards,

Ajay

Read only

Former Member
0 Likes
1,382

Hello David,

As far as i see it should work. Usually recordings are performed to add one row into the table and the looping is performed based on the number of entries passed to enter into the table.

Using GETLEN find the number of entries passed , get this value into the local variable and loop the recording of entrieing the value into the table some many times.

As you are saying the entry is getting overwritten, this is due to not change in the ID. probably you can paste your coding in the word docuement .

We can have a look at it. I have worked rigrously adding multiple rows and till now it works as expected.

Merry Christmas.

Thanks & Best regards,

Ajay

Read only

script_man
Active Contributor
0 Likes
1,382

Hi David,

my suggestion is as follows:


...
session.findById("wnd[0]/usr/subSCREEN_3000_RESIZING_AREA:SAPLBUS_LOCATOR:2036/subSCREEN_1010_RIGHT_AREA:SAPLBUPA_DIALOG_JOEL:1000/ssubSCREEN_1000_WORKAREA_AREA:SAPLBUPA_DIALOG_JOEL:1100/ssubSCREEN_1100_MAIN_AREA:SAPLBUPA_DIALOG_JOEL:1101/tabsGS_SCREEN_1100_TABSTRIP/tabpSCREEN_1100_TAB_03/ssubSCREEN_1100_TABSTRIP_AREA:SAPLBUSS:0028/ssubGENSUB:SAPLBUSS:7014/subA06P02:SAPLBUD0:1520/tblSAPLBUD0TCTRL_BUT0ID/ctxtGT_BUT0ID-TYPE[0,0]").text = "CRM0001"
session.findById("wnd[0]/usr/subSCREEN_3000_RESIZING_AREA:SAPLBUS_LOCATOR:2036/subSCREEN_1010_RIGHT_AREA:SAPLBUPA_DIALOG_JOEL:1000/ssubSCREEN_1000_WORKAREA_AREA:SAPLBUPA_DIALOG_JOEL:1100/ssubSCREEN_1100_MAIN_AREA:SAPLBUPA_DIALOG_JOEL:1101/tabsGS_SCREEN_1100_TABSTRIP/tabpSCREEN_1100_TAB_03/ssubSCREEN_1100_TABSTRIP_AREA:SAPLBUSS:0028/ssubGENSUB:SAPLBUSS:7014/subA06P02:SAPLBUD0:1520/tblSAPLBUD0TCTRL_BUT0ID/txtGT_BUT0ID-IDNUMBER[2,0]").text = "1"
session.findById("wnd[0]/usr/subSCREEN_3000_RESIZING_AREA:SAPLBUS_LOCATOR:2036/subSCREEN_1010_RIGHT_AREA:SAPLBUPA_DIALOG_JOEL:1000/ssubSCREEN_1000_WORKAREA_AREA:SAPLBUPA_DIALOG_JOEL:1100/ssubSCREEN_1100_MAIN_AREA:SAPLBUPA_DIALOG_JOEL:1101/tabsGS_SCREEN_1100_TABSTRIP/tabpSCREEN_1100_TAB_03/ssubSCREEN_1100_TABSTRIP_AREA:SAPLBUSS:0028/ssubGENSUB:SAPLBUSS:7014/subA06P02:SAPLBUD0:1520/tblSAPLBUD0TCTRL_BUT0ID").verticalScrollbar.position = 1
...

The mouse click on the next line allows the use of always the same relative coordinates for the new parameters.

Merry Christmas,

ScriptMan

Edited by: ScriptMan on Dec 23, 2009 10:58 PM

Read only

harsha_s
Advisor
Advisor
0 Likes
1,382

Hi,

I may suggest a workaround, you can always call a Bapi wrapper ( or a Function module ) which is exposed by SAP and try to pass multiple rows , rather than trying to input throught GUI .

for example there will be some BAPI Wrapper or Function module exposed by name PARTNER_CHANGE.

Hope it will help to sovle ur issue to some extent .

regards

harsha

Read only

Former Member
0 Likes
1,382

Hello,

Please look into the thread :

This thread also talks about adding multiple rows.

Thanks & Best regards,

Ajay