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.
SAPGuiSession("Session").SAPGuiWindow("Display ").SAPGuiEdit("<Field>").Object.text="<Your Text>"
The above code worked fine for me.
Hope this will help few of you.
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.
SAPGuiSession("Session").SAPGuiWindow("Display ").SAPGuiEdit("<Field>").Object.text="<Your Text>"
The above code worked fine for me.
Hope this will help few of you.
Hi Ankesh,
ReplyDeleteI had the same problem and I used the above solution but still I face a general error at the same SAPGUIEdit. The error does not come frequently though but once in a day and I am not able to replicate it.
Thanks,
Rifatra
ok thanks for this post it's quite informative and I have learned new things.
ReplyDeleteKissAnime alternative