06-21-2007 6:44 PM
Hi Gurus,
i am creating ecatt with TCD recording. My requirement is if i record a sales order with one line item can i use the same ecatt for multiple line items.
for example if i create a test script z_va01 in this i record a sales order having one line item. For this i created test data and configaration. Can i use same ecatt to create a sales order having multiple line items.
Thanks in advace
anil
06-22-2007 9:03 AM
Hi Anilkumar,
I don't think you can use same TCD script for single line item and multiple line item. The reason behind is the line items are part of recording. And their positions get recorded. So data has to match with run time behavior of transaction.
In SAPGUI recording, record VA01 transaction for multiple line items first. And see whether you get different dynpro for each line item. If so, then you can make them Optional. Now this script can run for both multiple line item as well as single item provided one dynpro for each line item.
Find the following weblog for SAPGUI recording and making screens optional -
/people/sapna.modi/blog/2006/04/10/ecatt-scripts-creation--sapgui-mode-part-iii
/people/sapna.modi/blog/2006/04/18/ecatt-chaining-parameterization-creation-of-test-datatest-configuration-system-data-part-iv
But my personal experience says not to play much with the recorded scripts in the given scenario. If you can record two different scripts for the different line items, your life will be simpler.
Hope this helps.
PS If the answer solves your query, plz close the thread by marking it Solved and rewarding each reply.
06-16-2009 4:15 AM
Hi.
Will u help me in creating multiple line item PR through SECATT. I could not able to get it via your earlier reply. Pl help.
Parag Mahajan
06-16-2009 9:33 AM
Hello,
You have to record the script for one line item but call the script multiple times within the loop to enter multiple items.
Before you call it multiple times, alter the script to handle multiple items , you have to change the ids of the gui-element for the item fields dynamically for each time the item is entered .
Hope this answers ur question.
Thanks & Best regards,
Ajay
06-16-2009 9:50 AM
Thanks Ajay for your quick reply but i could not get you for statement "change the ids of the gui-element for the item fields dynamically for each time the item is entered" as it will prove repititive cumbersome activity. I m talking for the case thousands of line item in PR as my requirement is to create PR with thousands of items (Note: All items with different mat code).
Pl suggest.
Thanks in advance,
Parag Mahajan
06-17-2009 8:48 AM
Hello,
Say for example the items data is stored in the table A , so you define a variable I_A of type table A.
Now you pass all the data to I_A table.
Now find the length of table I_A using GETLEN function then
DO ( Lenght of I_A ).
IW32_1-DYNPRO[3]-FIELD[2]-NAME = 'RESBD-MATNR(' & &LPC & ')'.
IW32_1-DYNPRO[3]-FIELD[2]-VALIN = I_RESBD[&LPC]-MATNR.
TCD ( IW32 , IW32_1 ).
ENDDO.
If you look at the statements the name of the field is changed dynamically at run time and the value is populated at runtime based on the number of values.
Hope this answers ur question.
Thanks & Best regards,
Ajay
06-17-2009 9:47 AM
Thanks Ajay,
I will definitely try the way you had suggested.
07-21-2009 7:38 PM
Did you able to create multiple line items, please let me know the procedure ..
thanks
05-03-2013 5:46 AM
Hi guys,
I know it has been a long time since this thread was opened, but I'm facing with the same 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. I read that this is the solution but, the variable is not recorded on the excel sheet as a column. Please help