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: 

Handling Table Control (Item Data) in eCATT

former_member186055
Active Participant
0 Kudos

Dear All,

I'm currently working on eCATTs, I gone through the SCN for the subject line. I know how to handle index values in Table Control, But I want to know how to create parameters for the Item Data along with the Header data. If we create Item as a  seperate varient, then system will create a document with only one item.

I can able to write the code in command editor to loop the item data. before looping item data we have to fecth the data into local internal table. How to get the item data into our local internal table.

I have search a lot in that I found by using some upload function modules, if we are using function modules, this function module will trigger for each header document and all the item data is fetched to local internal table each header data. Looping of this item data will lead to more time consuming.

I've created parameters by refering Table type. but I don't know how to handle the parameters.

Please anyone can post how to handle table control data in eCATTs.

Regards,

SuryaPraveen Pati.

12 REPLIES 12

0 Kudos

Hi Prakash,

Thanks! I searched a lot to work with table control through eCATT. I already gone through these threads. I didn't find exact relevent solution.

My question is,

Can we Handle Table Control with External Varients (*.txt)?

After analysis and Mr. Christian reply I conclude that it is not possible. If you or anyone knows it, please post here.

Regards,

Surya.

Wutschi
Explorer
0 Kudos

Your parameter and reference need to be correct:

V_MARA with Reference MARA, means one table line

V_MARA with Reference MARA[], means  table as Parameter

You can now do a double click on the gray field <initial> it will open the table where you can maintain Values. Or you fill the table during runtime with the command APPEND.

Rgds

Christian

0 Kudos

Dear Christian,

Thanks for your reply. I've decleraded correctly. I don't know how create varients for importing parameters for Table of records (item records). Can you please let me know how to handle Table control in eCATTs.

Actually, I created varient for header data. By using some function modules I'm uploading complete Item data in EDITOR and then LOOP ENDLOOP item date by mentioning where condition for that particular Header document. In that loop I'm capturing item data of that partucular Header document and storing locally.

After that I'm doing DO ENDDO for no. of items, in this I'm calling SAPGUI commands which I need to repeat.

Every thing working fine.

My question is, I hope this is not the correct procedure to handle Item data. Can you please let me know how to handle item data.

I'm doing in the following, I hope this is not the correct way, can you please correct me and if possible please provide the any useful information,

ABAP.

****

UPLOADING ITEM DATA

****

ENDABAP.

v_header = im_header.

**    Initial screen..................................................
SAPGUI ( XXXX_100_STEP_1 ).

*    Populate item data for current document..........................
ABAP.
  loop at v_t_items into v_fs_items
  where header eq v_header.
    append v_fs_items to v_t_items_temp.
  endloop.
  describe table v_t_items_temp lines v_lines.
ENDABAP.

DO ( v_lines ).
  v_row = v_row + 1.
*    Read items.......................................................
  ABAP.
    read table v_t_items_temp into v_fs_items
    index v_row.
  ENDABAP.
*    Pagedown if records reached end of table control.................
  IF ( v_row = 4 ) .
*    First time Pagedown..............................................
    SAPGUI ( XXXX_1111_STEP_3 ).
*    Second time pagedown.............................................
*    IF ( v_row = 62 ) .
*    SAPGUI ( XXXX_1111_STEP_3 ).
    v_index = 1.
  ELSEIF ( v_row = 8 ) .
    SAPGUI ( XXXX_1111_STEP_3 ).
*    ELSE.
    v_index = 1.
  ENDIF.
*ELSEIF ( ).
*  ELSE.
*ENDIF.
*    Items............................................................
if ( v_index = 0).
SAPGUI ( XXXX_1111_STEP_1 ).
else.
SAPGUI ( XXXX_1111_STEP_2 ).
endif.
*<!v_index!>
  v_index = v_index + 1.

ENDDO.
**    PageUp...........................................................
*IF ( v_lines > 4 ) .
***   First time pageUp................................................
*  SAPGUI ( me51_106_step_5 ).
**    Second time pageUp...............................................
*ELSEIF ( v_lines > 8 ) .
*  SAPGUI ( me51_106_step_5 ).
**ELSEIF ( ).
**  ELSE.
**  ENDIF.
**ELSE.
*ENDIF.

ABAP.
  clear:
  v_row.
ENDABAP.


*    Initial screen after save........................................
SAPGUI ( XXXX_1111_STEP_5 ).
*    Information screen
SAPGUI ( XXXX_10_STEP_1 ).

e_docnum = XXXX_10_STEP_1-PROCESSEDSCREEN[1]-MESSAGE-PARAMETER1.

Regards,

Surya.

0 Kudos

Hi Surya,

well I would say that is not the most efficient way

To maintain the Values for the table is the same way as with normal parameters.

To work with Variants you need to have your table as import parameter:

To maintain Values direct on your script (both import and local) you need to do a double click on the value field, it will open the table and you can insert values:

To create Variants you need to work with test configuration, on the test configuration you can maintain only the paramter type import and you do as well a double click on the value filed:

parameters with type import are not available in the ABAP/ENDABAP statements, so you need to move them from import parameter to local parameter:

V_MARA = I_MARA

You are using a lot of ABAP statements instead of ecatt commands.

in ecatt it would be something like that:

V_MARA = I_MARA.

GETLEN ( V_MARA , V_LINES ).

DO ( V_LINES ).

*Assign values

  V_MATNR = V_MARA[&LPC]-MATNR.

  V_ERNAM = V_MARA[&LPC]-ERNAM.

* Your sapgui processing

ENDDO.

Regards

Christian

0 Kudos

Dear Christian,

Once again thank you very much for your detailed explanation with Screen Shot. I'm upto that mark what you explained.

Can you please explain in detail about External Varient Creation for Multiple Header Items. How can we handle the same?

If you Get the no. of items by using GETLEN ( V_MARA , V_LINES ). Then V_LINES contains no. of items for all the Headers instead of a particular HEADER.

Regards,

Surya.

0 Kudos

Hi Surya,

I understand that you would like to work with external Variant in test configuration, that is not possible in case of structured or deep structured parameters because you could not have the structure in a single flat file. You need to maintain your values on the system, if that data should be used in more than one test script you can work with test data containers.

I recommend always to work with the data on the system. You have it centrally, everbody could acess it and could execute the script.

I do not understand what do you mean with header items, in ecatt there is no header. You have header data and item data in sap documents (EKKO & EKPO for example) but there is no header on an ecatt script.

Rgds

Christian

0 Kudos

Dear Christian,

Thank you very much!

Regards,

Surya.

AjayHS
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes this is possible, You can either do it using the TCD driver or SAPGUI driver.

For SAPGUI driver

GETLEN ( I_ITEMS , V_COUNT ). *** get the count of number of items that you want to input through input variable (table type)  in to the V_COUNT ***

DO ( V_COUNT )

SAPGUI ( SAPGUI_1 ).  *** recording to input more number of items into the items table , make sure to change the gui element id pointing to row in the table by incrementing the counter using <!V_ROW_COUNT!>

V_ROW_COUNT = V_ROW_COUNT + 1.

ENDDO.

Hope it helps

Thanks,

Aj

0 Kudos

Dear Ajay,

Please read the complete discussion. Your suggested solution will works only for one Header document only. If I've more than one header document are there and let us say for 1st document there 6 items and for 2nd document there are 4 items and 3rd document 7 items and so on..

Then how can I upload header and items details.

I hope/thought there no such senario will works in eCATTs from external files.

Regards,

Surya.

AjayHS
Product and Topic Expert
Product and Topic Expert
0 Kudos

Surya,

You need to split the your scenario into multiple scripts.

1 Script just to create document

1 Script just to add item to the document

Now you can call the script created to create document input the document number and add as many items you want using structure parameter as input parameter or buy passing values from external file.

Thanks,

Aj

0 Kudos

Thanks, Ajay.

I'll elaborate your previous reply, please let me know am I getting you correctly or if not, give me your explanation.

In First Script I created the document. Then In second Script I changed that document and added the Items to that document. Up to here, it is ok.

When I'm calling second Script to add Items, How Can I Upload the Items of that Particular Document? and How can I configure two Test Data Containers?

Regards,

Surya.