cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Personas , script OnEnter with unwanted "enter" function - HUPAST

emmanuelm1
Explorer
0 Kudos
776

Hello,

I've created a flavor on HUPAST where my user can scan the EAN number of a product instead of the product in a specific field.

I've made the script to filled automatically the material and quantity, and the script should stop here.

  - When I execute the script manually, it works fine and stop on the quantity field.

  - But when I put the script on the OnEnter event (to be able to scan the EAN), the script runs and pack automatically the quantity without stopping. (normally the packing is done via an Enter function).

I debug it and cannot figure out why it doesn't stop. (it doesn't go twice in my script OnEnter).

I'm on personas SP18 / ECC6 EHP7.

To illustrate the problematic, I've create a new flavor very simple with 1 new field and 1 script triggered on the OnEnter event.

The script copy the material to material field, press Enter to get the quantity field open and fill the qty with 1.

See screenshot below.

But in fact the system packed automatically the material/qty to the HU without stopping in the quantity field.

 

 

Thanks and best regards,

Emmanuel.

Accepted Solutions (0)

Answers (2)

Answers (2)

cristin_charbonneau
Participant

Hi Emmanuel.  

I am able to replicate the issue you are having. HUPAST is such a special transaction and especially the quantity field it seems. I think it has special programming behind it.

I'm not quite sure what you are doing with the custom field and how the scanning of the EAN to the custom field translates to the value being populated into the material/handling unit field?  What I can tell you is I think I'm doing something similar in my HUPAST flavor (so that users are not typing in material numbers) and when I change my script to include setting the quantity to "1" it is not automatically packing the box.

Here is what I have done.

- users select a material line to be packed from the table at the bottom

- script button is clicked that reads the material number from the selected row and puts that material into the "material/handling unit" field

- presses enter to open the quantity field

- sets focus to a custom batch field for lot number verification (we use a barcode scanner here)

emmanuelm1
Explorer
0 Kudos

Hell Cristin,

Thanks for your reply.

But my business requirement is completely different and I cannot process as you do.

I have deliveries with hundred lines and the user need to scan the EAN. EAN is defined in MARM table and can be for multiple unit of measure. So my script do several checks : validation of the ean, retrieving of the uom and calculating the qty for the specific ean.

I have 1 flavors where users scan all ean which pack automatically and it's fine.

But I have another requirement where the user could amend the qty for the ean by a multiple, and this where I cannot stop.

I was wondering if there was an instruction to stop the further actions.

Thanks anyway,

I will write a message in OSS to check with SAP.

Emmanuel. 

cristin_charbonneau
Participant
You could try the command "return true" to exit the script but I'm not sure that will get around the quantity field programming. Have you tried running the script using the onChange event of the material/handling unit field instead of the onEnter event?
emmanuelm1
Explorer
0 Kudos

Hello Christin,

The "return true" works on the simple flavor but not on the complex one.

I will try to figure out.

I need to use the Enter event as my users scans the EAN and all barcode are  setup with Enter function.

Thanks,

emmanuelm1
Explorer
0 Kudos

Hello Cristin,

Finally I didn't managed to adjust my script.

So I created new fields for the material and quantity and copy these values to the standard field when the user is ok.

Thanks anyway.

emmanuelm1
Explorer
0 Kudos

-

cristin_charbonneau
Participant
0 Kudos
Would you be able to post your onEnter script here?
emmanuelm1
Explorer
0 Kudos
Hello Cristin, It's posted. I replicate the problem with a simple flavor.