F0005 udc

Koala100

Guest
I am creating a UBE. One of the requirement is to copy F0005 UDC value (00/04) size 3 to UDC (05/AP) size 4. When the copy is done, there is a leading blank in the beginning of 05/AP UDC value.

example MNT --> ' 'MNT

I have tried many ways to remove the leading blank from the target UDC, but have been unsuccessful. The size of target UDC needs to remain at size 4.


Does anyone have any ideas on how to removing the leading blank?




E1 9.1
 

Matt S

Member
I recently had the same issue.

There weren't may entries in our table so I ended up physically removing the space.
An SQL update could remove that leading space.
 

RussellCodlin

Reputable Poster
The UDC key field is size 10. JDE left pads with spaces out to 10 - UDC key size. So in 00/04 you'll get seven spaces and in 05/AP you'll get six. Ultimately you still end up with 10 characters in the database.

How are you actually performing the copy?
 

Koala100

Guest
I have been told to delete all existing records in the target UDC. So I delete them with no issue. Then I do Select from original UDC on SY and RT, then FetchNext from original UDC grabbing KY and inserting SY, RT and KY into target UDC. The Select, FetchNext and Insert are in While loop.


E9.1
 

RussellCodlin

Reputable Poster
I'd start by not using the UDC Key item for your variable and instead just use a generic text element. This might cause the DAL to translate the key for you when you copy from one to the other.
 

Koala100

Guest
I'd start by not using the UDC Key item for your variable and instead just use a generic text element. This might cause the DAL to translate the key for you when you copy from one to the other.

I sub KY for AA10. What I did was:

Select on SY, RT
FetchNext grab KY -> AA10
Insert F0005 using SY, RT and AA10.

It is still adding extra blank " " in the target UDC KY field.
 

CHo

VIP Member
Hey welcome Koala100!

I ran into the same issue.

I did this:

Use B9800150 to left justify the KY value.
Rpad KY by 1.
Lpad KY by 9.

This works. The user has confirmed it.
 
Top