Application Development 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: 

How to add more Line Items after Recording ECATT

Former Member
0 Kudos

Hi Everyone,

I've recorded Creation of Quotation in SD Module (VA21) with one Line Item using ECATT TCD Record , It is working fine . Now i want to create a Quotation with Two Line Items using Same ECATT . How to Proceed for that.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

With TCd record mode, you will not be able to tweak in another line ietm data entry. For these kind fo scripting/automation, SAPGUI Record mode is the best one. It allows you to start and stop recording at every action. This enables us to put the logic of looping with ABAP code and make the script do single as well as mutiple line entries (as your current requirement). Let me know if you need more details on the same.

Regards,

Justin

13 REPLIES 13

Former Member
0 Kudos

Hi,

With TCd record mode, you will not be able to tweak in another line ietm data entry. For these kind fo scripting/automation, SAPGUI Record mode is the best one. It allows you to start and stop recording at every action. This enables us to put the logic of looping with ABAP code and make the script do single as well as mutiple line entries (as your current requirement). Let me know if you need more details on the same.

Regards,

Justin

0 Kudos

Can u give an Example using the SAP GUI how to do add Line Items through looping . Do u have any Tutorial reference .

0 Kudos

Hi,

While we script using SAPGUI. We take care that we are aware of each line what it does in the script. Unlike other testing tools eCATT scripts canot be understud easily just by reading them.For this reason, we comment each important action in the script either by the advanced tab facility while scripting or just recording & generating SAPGUI code snippets one action at a time. We cud also just record the whole scenario and then later split the single SAPGUI command with respect to action by just using the SPLIT option and then run the script in debug mode with a break point from first line to the last to identify whats happening on the screen. You cud leave comments manually to distuinguish each step.

Once you do the above we can easily input some ABAP statements to do your looping(You require 2 line items to be entered, identify the command interface (particular line of SAPGUI script ) line item entry statement in SAPGUI and write ABAP statement around it to repeat the same for desired number of times. Refer the lines of Code below.

-


*INFO - Loop Here

LV_COUNTER = 0.

LV_ARRAY_COUNTER = 1.

LV_CONST_PART_START = <constant Part of the GUI-ID here>

DO IV_NO_OF_MODULES.

ABAP.

*Creating the ID of the GUI Object with teh counter embedded

CONCATENATE LV_CONST_PART_START LV_COUNTER LV_CONST_PART_END INTO LV_ID_STRING.

ENDABAP.

*INFO - Enter each module

LV_TEXT = IV_MODULE_LIST[LV_ARRAY_COUNTER]-DATA1.

*SAPGUI statement being looped.

SAPGUI ( SAPGUI_1_5 ).

*Incrementing the conter for teh next loop.

LV_COUNTER = LV_COUNTER + 1.

LV_ARRAY_COUNTER = LV_ARRAY_COUNTER + 1.

ENDDO.

-


Regards,

Justin

Former Member
0 Kudos

Hello,

Once the recording for one line item is done.

Create a structure parameter to pass more than one line item.

At runtime user inputs the line items may be one or two.

Witin the script determine the length of the structure parameter using GETLEN and loop so many times using DO loop.

Put the recording steps where u enter the line items within the DO loop and change the element id in the command interface dynamically to move to the next line once the one iteration of the loop is over.

Hope this answers your question.

Thanks & Best regards,

Ajay

0 Kudos

Ajay,

Can you explain how the users should pass the input values for multiple entries like from an excel file?. I have an eCatt which is working fine for 1 line item for sales order. But I didn't how to create the external variant (excel) for multiple line items to be passed to eCatt.

Appreciate your inputs.

thanks

Venkat

0 Kudos

Hello,

Please create a parameter with parameter reference as structure like say structure[].

Parameter reference can be got from the technical information of the field for which you want to pass the value.

Let me know if you need more informatino.

Thanks & Best regards,

Ajay

0 Kudos

Ajay,

Yes, I have created those parameter structure for the line item values. But I still not able to understand how these values can be passed from external variant while running this eCatt. Usually if we pass from external variant from excel each line in excel consider as one variant for the eCatt script. In this case for single sales order we may need to more than 1 line item. Do we have to have different excel files for each parameter structure?.

Would appreciate if you could provide some more information.

thanks

Venkat

0 Kudos

Hi,

First create a test data container like a template. download the test data container with the structure in it. This shud give you the excel template.

Regards,

Justin

0 Kudos

Hello,

Once the structure parameter is created as import parameter now execute the script ,at the run time go to the variants tab and there you could see the import structure parameter, double click on the parameter value for tht structure parameter, at the bottom of the screen you could see the structure , pass the values (how many ever line items you need to pass).

Before that we need to pass the values from the structure parameters into the variables in the recording .

eg: here I_AFVGD is the structure parameter &LPC is the loop counter which is based on the number of line items passed and the ARBPL is the field in the table.

I_AFVGD[&LPC]-ARBPL

Let me know if you need more info.

Thnaks & Best regards,

Ajay

0 Kudos

Ajay,

Do I understand correctly:

If i want to put several line items to sales document via import parameter I have to create as many structured parameter as i need lines?

I can't find functionality for adding several lines for one structured parameter....

Eg:

I've created structured parameter "Line1" with reference to VBAP.

For another line should be another structured parameter Line2?

Or I misunderstand the idea of structured parameter in this example?

0 Kudos

Hi,

I'm recording sales order creation which have several schedule lines (The delivery dates can change).
I read up on most of the ecatt documents and I believe i have a some what of knowledge on ecatt.
From my understanding when entering schedule lines, the ecatt keeps track of the column and row.
This is recorded J_3ASZDI-J_3ASIZED[2,0] as the GuiElement ID.

I have added a loop to make repeat different schedule lines, the code is down bellow.

I_COUNT  --> Ref Parameter COUNT

*Adding I_COUNT amount  of Schedule line

DO(I_COUNT).

SAPGUI ( VA01_2010_STEP_41 ). --> entering Grid name GUIELEMENT ID - J_3ASZDI-J_3ASIZED[2,0]

SAPGUI ( VA01_5000_STEP_5 ).--> entering Grid value GUIELEMENT ID - J_3ASZDI-J_3ASIZED[3,0]

*Pressing Enter on schedule line

*SAPGUI ( VA01_2010_STEP_42 ).

SAPGUI ( VA01_2010_STEP_42_1 ).

*This clicks on to the next line.

SAPGUI ( VA01_2010_STEP_42_2 ).---> GUIELEMENT ID - J_3ASZDI-J_3ASIZED[2,1]

ENDDO.

My question is even if you add a loop in to the SAPGUI (Creating schedule line and next line), since the GuiElement ID has [2,1]  --> [Column,Row] on next schedule line it wont full fill the loop. does the DO(x) function disregards this GuiElement ID or is this and issue? If so, is there another way?

Please reply as soon as you can. I need to show this to my supervisor on friday.
Thanks and regards,
Hellanga

0 Kudos

Hi guys,

I know I'm replying on my own question, I have moved pass that now, but I'm facing with another problem.

I created the sales order with SAPGUI REC, and added a loop for line item creation and schedule line creation.

*LINE ITEM NUMBER

DO ( V_LNIT_NO ).

     SAPGUI ( VA02_2010_STEP_2 ). --> Adding line item

     V_LI_ROW = V_LI_ROW + 1.

ENDDO.

And i amended the line item selection Guielement ID - (Changes are in bold)

'wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPLJ3AD:2930/ssubSUBITEM_L2:SAPMJ3AS:2001/tblSAPMJ3ASTCTRL_LINE_ENTRY/ctxtJ_3ASZDI-MATNR[3,<!V_LI_ROW!>]'

so that the loop will make the line item selection to the next line.

My requirement is to upload the data through a excel file, so I created a test configuration with the relevant variables. But the data from the excel line wont populate the loop data, it only repeats the data from the same line over and over again.
How can I fix this? Please help.

Ps - I have tried to make the the MATNR_D to a table by adding [], --> MATNR_D[] - Table. And it becomes a <INITIAL>, and by clicking on the value column cell, it goes in to parameter I_MATNR (I defined this)

and you can add Parameter 1, 2,  3 etc and within the parameter you can add table-line. To my knowledge, this would be the solution but, the variable is not recorded on the excel sheet as a column. Please help

0 Kudos

That is because your string is not working and if eCATT could not read it exactly it will just take the first line.

Build one local parameter like V_ID1 =

'wnd[0]/usr/tabsTAXI_TABSTRIP_OVERVIEW/tabpT\02/ssubSUBSCREEN_BODY:SAPLJ3AD:2930/ssubSUBITEM_L2:SAPMJ3AS:2001/tblSAPMJ3ASTCTRL_LINE_ENTRY/ctxtJ_3ASZDI-MATNR[3,'

And now you build your final string within the loop:
V_ID = V_ID1 & V_LI_ROW & ']'.

V_ID need to be assigned to the ID of the Gui-Element

Upload of Excel data into a table is not supported, you need to copy and past it.

Rgds

Christian