on 2005 Nov 16 3:40 PM
Hi All,
I have to create an update rule for an infoobject "address". The data is coming from the attributes of a master data infoobject called 0vendor. The attributes are street, city, state and zip.
So I created an update routine which would Concatenate as follows:
Tables: Vendor.
Data: Begin of IT_VENDOR occurs 0,
street like Vendor-street,
city like Vendor-street,
state like Vendor-state,
Zip like Vendor-zip.
End of IT_Vendor.
Data: V_addr type c.
Clear V_ADDR.
Select * from Vendor(table) when Customer no. = comm_strcuture-Customer no. into corresponding fileds of table IT_Vendor.
Concatenate IT_vendor-street IT_vendor-City IT_vendor-State IT_Vendor-zip into V_addr.
Result = V_ADDR.
Now is there something wrong with the routine. Beacause it is not working. There is no data being updated into the cube.
Please help.
Thanks,
Ashmith Roy
Hi,
would be a great idea to check sy-subrc, and if it's 0 he concat's the empty haederline of his table, also not very succesful.
/manfred
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
The actual code that worked eventually looke dlike this:
Tables: Vendor.
Data: Begin of IT_VENDOR occurs 0,
street like Vendor-street,
city like Vendor-street,
state like Vendor-state,
Zip like Vendor-zip.
End of IT_Vendor.
Data: V_addr type c.
Clear V_ADDR.
Select * from Vendor(table) when Customer no. = comm_strcuture-Customer no. into corresponding fileds of table IT_Vendor.
If Sy-subrc eq 0
Read Table IT_vendor.
Concatenate IT_vendor-street IT_vendor-City IT_vendor-State IT_Vendor-zip into V_addr.
Endif.
Result = V_ADDR.
Message was edited by: Ashmith Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashmith,
I guess select is wrong.Try this
Select single street city state Zip into ( IT_VENDOR -street, it_vendor-city , it_vendor-state, it_vendor-zip )from Vendor(table) where Customer no. = comm_strcuture-Customer no
or
Tables: Vendor.
Data:IT_VENDOR like vendor occurs 0 with header line.
Data: V_addr(60) type c.
Clear V_ADDR.
Select single * from Vendor(table) into table it_vendor where Customer no. = comm_strcuture-Customer no.
if sy-subrc = 0.
Concatenate IT_vendor-street IT_vendor-City IT_vendor-State IT_Vendor-zip into V_addr.
endif.
Hope this will help.
Sudha
Result = V_ADDR.
hi Ashmith Roy,
CONCATENATE just work with Data Type 'Character', have no access to system, not sure the infoobject vendor-zip has other than Character type. i do suggest you use char in the internal table store the data, xx is the length.
For performance consideration you may select first for all related vendors in 'start routine' instead of accessing database each time.
Data: Begin of IT_VENDOR occurs 0,
street char(xx),
city char(xx),
state char(xx),
Zip char(xx),
End of IT_Vendor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check if your select work well; take a customer no anche chack in vendor master data if exist 1 record.
Your routine seems to be good.
Hope it helps.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ashish,
I am guessing maybe there is a problem with the length of characteristic Address. It has the maximum possible length. I am trying to debug the update rules from the manage tab by simulating the update. If there is a better way to reach the routine directly, and if you could let me know how, that would be great.
Thanks once again for the prompt reply,
Ashmith Roy
Hi Ashmit,
Go to the update rule and put a break-point there just before the code..
By this you can navigate directly to the code which you are trying to debug..Saves a lot of time..:-)
You might want to keep in mind that the fields you are concatenating don`t add up to more than 60 Chars..
Hope it helps
Ashish..
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.