02-03-2012, 06:28 PM
Hi All,
This is very common issue with SAP.
There are few fields in SAP which throws 'Bad Length' error on setting values into it during run time(using Script). However you will be able to set the values manually.
The problem is with the length assigned to such field during run session. The field length is usually smaller ,say 4, at runtime. So if you are trying to set a value of length more than 4, you will get this error.
I figured out a way of doing with using the below undocumented method.
The above code worked fine for me.
Hope this will help few of you.
Regards,
Ankesh
This is very common issue with SAP.
There are few fields in SAP which throws 'Bad Length' error on setting values into it during run time(using Script). However you will be able to set the values manually.
The problem is with the length assigned to such field during run session. The field length is usually smaller ,say 4, at runtime. So if you are trying to set a value of length more than 4, you will get this error.
I figured out a way of doing with using the below undocumented method.
Code:
SAPGuiSession("Session").SAPGuiWindow("Display Order").SAPGuiEdit("<FieldName>").Object.text="<Your Text>"
The above code worked fine for me.
Hope this will help few of you.
Regards,
Ankesh