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: 

External Variants File in ECATT

Former Member
0 Kudos
391

We have a provision to provide external variants to CATT. I wanted to know whether we can also provide an external file for variants to ECATT.

If this is not possible please do tell me about some other option to load evxternal variants in ECATT

3 REPLIES 3

Former Member
0 Kudos
106

Hi Jyotsna,

Even i have the same problem.I think that this facility is not available in ECATT and the only option is creating Variants in the Test Data for the parameters you create in the Test Script and then executing the Test Configuration with the Test Script and the Test data for the Script mentioned in that.

I hope this might help you for some extent.

Please let me know if you found out any other solution for the above scenario.

Thanks,

Shashidhar.

jayanthi_jayaraman
Active Contributor
0 Kudos
106

Hi,

Check this link fully.

former_member181959
Contributor
0 Kudos
106

Hi Jyotsna and sashidhar,

Loading variants from file can be done programmatically in abap…endabap. Block

While recording the application find out what are the required fields for the script.

Instead of using variants store the values in the file. Then use an internal table to store this data for the screen processing.

I am sending you some sample code, which may be helpful to you.

If you find any other alternative please let me know.

prasadbabu.koribilli@gmail.com

Regards,

Prasad babu.

Sample code:

for ME22 transaction code.

abap.

DATa : tot type i value 0.

*itab whicj stores PO numbers in the file.

data : begin of itab occurs 0,

bstnr like rm06e-bstnr,

end of itab.

  • to open the file dialog.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

FIELD_NAME = 'FILE'

IMPORTING

FILE_NAME = FILE_V-PATH.

  • storing file path for future use.

DATA FILE TYPE STRING.

FILE = FILE_V-PATH.

  • loading file from application server.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = FILE

FILETYPE = 'ASC'

tables

DATa_tab = ITAB.

  • determinig the number of records(POs) in the file.

describe table itab lines tot.

  • assigning to local vble.

count = tot.

CLEAR ITAB.

endabap.

  • looing count number of times.

do (count).

  • abap block to get the details required for the screen processing.

abap.

  • itab for storing PO numbers

data : begin of itab occurs 0,

bstnr like rm06e-bstnr,

end of itab.

  • itab for storing items in the table

data : begin of itab2 occurs 0,

ebelp like ekpo-ebelp,

end of itab2.

  • itab for storing ORD qty and REC qty

data : begin of itab3 occurs 0,

menge like eket-menge,

wemng like eket-wemng,

end of itab3.

  • workareas to store the values.

data : wa like itab.

data : wa2 like itab2.

data : int type i.

  • last item in the itab.

data : last_item type i value 0.

DATA FILE TYPE STRING.

FILE = FILE_V-PATH.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = FILE

FILETYPE = 'ASC'

tables

DATa_tab = ITAB.

int = int_loc.

  • reading table for PO numbers.

read table itab index int into wa.

  • storing in local PO vble.

bstnr_loc = wa-bstnr.

  • calculating last item in the table

select ebelp from ekpo into table itab2 where ebeln = wa-bstnr.

describe table itab2 lines last_item.

read table itab2 index last_item into wa2.

  • stores the last item number in the itab.

itemcount_loc = wa2-ebelp.

*calculating ordered qty and received qty

data : wa3 like itab3.

  • getting details for 0020 item.

select menge wemng from eket into table itab3 where ebeln eq bstnr_loc and ebelp eq '00020'.

read table itab3 into wa3.

ordqty_loc = wa3-menge.

recqty_loc = wa3-wemng.

  • finding the difference.

diffqty_loc = ordqty_loc - recqty_loc.

  • assigning default value for creating new line.

if diffqty_loc = 0.

diffqty_loc = 200.

endif.

ordqty_loc = recqty_loc.

clear itab3.

  • getting details for 0030 item.

select menge wemng from eket into table itab3 where ebeln eq bstnr_loc and ebelp eq '00030'.

read table itab3 into wa3.

ordqty_loc2 = wa3-menge.

recqty_loc2 = wa3-wemng.

diffqty_loc2 = ordqty_loc2 - recqty_loc2.

if diffqty_loc2 = 0.

diffqty_loc2 = 200.

endif.

ordqty_loc2 = recqty_loc2.

clear itab.

endabap.

  • TCD for changing the PO.

TCD ( ME22 , ME22_1 ).

  • counter for the next record (POs).

int_loc = int_loc + 1.

enddo.