cancel
Showing results for 
Search instead for 
Did you mean: 

ECATT: Generate PO No for VA01

Former Member
0 Kudos

Dear All Ecatt Expert,

I'm recording transaction code VA01 for create sales order in SAPGUI mode, during the recording I need to key in the mandatory field "PO Number". I like this PO Number to be auto generate, so I won't need to define them in the Test Data Container.

Do you guys have any inputs in this issue?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Eugenia,

You can use Store and Retrieve commands to increment the PO number automatically.

This will help you in solving this issue.

After execution,you store the PO number.While executing for the next time,retrieve the PO number that you have used in last execution and increment by any number.

Hope this solves your query.

Best Regards,

Kumar S.

Former Member
0 Kudos

Hi Kumar,

Appreciate to received your advice.

I have try to add in STORE and Retrieve command in my ECATT script but how can I increase the value from SRM001 to SRM002.

Can I user ABAP........ENDABAP to define the parameter to increase 1 before RETRIEVE? And I prefer the PO number will look like SRM001, can I CONCATENATE in the script.

If it's possible can you provide me some example of ecatt script regards on this?

Thank you.

Eugenia

Former Member
0 Kudos

Hi Eugenia,

The logic is very simple.

Take SRM in local variable say var1 and 001 in another local variable var2.

Make sure these these local variables are declared as local parameters.

Now ,Before automated code please use retrieve command for the local var2.

check subrc.

If subrc fails then initialize to 001.

Now after successfully retrieving that value,concatenate using & command available with eCATT.

Use the concatenated value in the transaction.

After recording ,Increment var2 by 1.

use store command for storing var2.

Hope this solves your query.

Regards,

Kumar S.

Former Member
0 Kudos

Hi Kumar,

Your reply really help alots, but I'm still unable to execute the script successfully to auto generate the PO Number.

I have insert the command concatenate, check subrc and increment VAR2 by 1 in between ABAP......ENDABAP. It's seem that the script not able to read the code in ABAP statement. Do I need to preset any setting to allow abap code able to be execute.

Currently in Transaction Code SM31 Table T000, the restriction when starting CATT and eCATT, I had defined as eCATT and CATT Allowed. Do I need to set this to eCATT allow; FUN//ABAP and CATT for Trusted RFC only?

Beside this, I would like to know how code the ECATT Variable like:-

&SUBRC System field SY-SUBRC.

&VARID Variant name.

When I key in &SUBRC I will get an error message "unknow function &SUBRC".

Can u provide any example link on how to use the ECATT variable.

Thank you.

Answers (0)