cancel
Showing results for 
Search instead for 
Did you mean: 

ecatt: how to test the creation of a purchase requisistion (ME51N)

Former Member
0 Kudos

Hello ecatt-experts,

I have some questions concerning the creation of a purchase requisition with ecatt:

- is it possible to use TCD recording instead of sapgui recording for ME51N ?

(as far as I've seen it's not possible with TCD as I didn't get back the field-values)

- Is it possible to record the creation of a PR with 1 item and to write a script which can be used for the creation of a PR with n items ?

For this I would need to cread GUIElement- Parameters dynamically.

Or is the only solution to this problem to register a sapgui with n items and to define n parameters ?

regards,

monika

Accepted Solutions (1)

Accepted Solutions (1)

former_member585451
Active Participant
0 Kudos

HI Monika,

It is difficult to use TCD for creating a Purchase Requisition (I am not telling you that it is impossible, you can do it, but its really hard to manipulate screen elements and to pass values to them).

One thumb rule is to use SAPGUI for all Enjoy transactions(ME21N, ME51N, MIGO....)

Answer to your second question is YES. You can use the single recording for N number of items without creating multiple parameters.

You have to create a parameter with the parameter reference as the table/structure mentioned in the transaction grid(Press F1 on the TA screen and then go to technical help and copy the table/structure name and paste it in the parameter reference area of the eCATT parameter ending with [] like <b><I_MARA> <Description> <MARA[]></b> ).

Then create another local parameter of type numeric(may be V_COUNT )

In the eCATT, use a GETLENGTH (I_MARA, V_COUNT).

Then loop the grid values like

DO (V_COUNT).

SAPGUI RECORDING <b>ONLY</b> FOR THE ITEMS..

Here map the values with the values of the St. Parameter

like I_MARA[&LPC]-MATNR.

ENDDO.

This way, you can pass multiple values to the grid to the parameter I_MARA in the runtime and also use a single line recording for passing multiple values.

This thread might help you in a way.

Hope the solution helps.

Best regards,

Harsha

PS: Reward points accordingly for all responding.

Former Member
0 Kudos

Hello Harsha,

thank you for you information. Unfortunately I don't manage to get this going.

Some questions:

How is the parameter I_MARA filled ?

Can you fill this structure parameter using variants ?

Is the parameter defined as local variable or as input parameter ?

Maybe you could have a look at my script and give me some further hints (my problem is that I_MEREQ3211GRID is empty and GETLEN results in 0).

GETLEN(I_MEREQ3211GRID, V_COUNT).

DO ( V_COUNT ).

*Recording for creation of 1 PR item

SAPGUI ( ME51N_14_STEP_1 ).

MEREQ3211GRID[&LPC]-EKGRP = V_EKGRP.

MEREQ3211GRID[&LPC]-NAME1 = V_PLANT.

MEREQ3211GRID[&LPC]-WGBEZ = V_WGBEZ.

MEREQ3211GRID[&LPC]-EEIND = V_DELIVERYDATE.

MEREQ3211GRID[&LPC]-MEINS = V_UOM.

MEREQ3211GRID[&LPC]-MENGE = V_MENGE .

MEREQ3211GRID[&LPC]-MATNR = V_MATNR.

ENDDO.

*Message "creation of PR"

SAPGUI ( ME51N_14_STEP_2 ).

former_member585451
Active Participant
0 Kudos

Hi Monika..

I have already mentioned that the table/structure in the transaction grid should be used as a parameter reference to the parameter in eCATT.

<b><Parameter> <Description> <Value> <Mode> <Parameter Reference></b>

<i><I_MARA> <Structure for Options Display in ALV Grid> <INITIAL> <I> <MARA[]></i>

THis parameter reference would make this field as a reference or a copy of the table, which would have all the fields that the table has..

All you have to do here is to pass values into this parameter(Double click on the initial and pass values to the necessary fields..). Also, you dont need to create those local parameters to pass values.. That is taken care by the st. parameter itself.

Best regards,

Harsha

PS: Reward points as applicable for all responding.

Message was edited by:

HarshaChaithanya Kethepalle

Former Member
0 Kudos

Harsha,

thanks a lot for your help !

Just 2 more last questions:

how do I manage that each line is written in the same form (has this something to to with RESETGUI) ?

is it possible to download a variant with a structure parameter into a file (when I downloaded such, the structure values didn't appear in the text-file).

best regards,

monika

former_member585451
Active Participant
0 Kudos

Hi Monica,

I didnot understand the first point.

<b> how do I manage that each line is written in the same form (has this something to to with RESETGUI) ? </b>

And for the second question, It is not possible to download a varaint with a structure parameter to a file, you might see that in the file as a single variable, not as a structure.

In such case, wherein you have to use the structure values, you have to create individual parameters and map them to the structure in the script. Apart from that I donot see any other way of doing it.

Best regards,

Harsha

<b>PS: Reward points as applicable for all responding.

Also, try to create individual threads for every question, so that ppl looking for a particular solution might find it easily.</b>

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you for your help !

The proposed solution doesn't seem this straight-forward, but it could work.