Skip to main content

ABAP: Once in a blue moon..

Yup, once in a blue moon, you'll get a kind of weird requirement to work on .. and today, I'm getting one too.. adding a serial number to an order .. which originally created from CRM.

In the first place, this is all bespoke, so .. standard middleware wouldn't work .. the serial number is passed through CRM order in a customer field and left out when the middleware is called in. What I need is to move this serial number over to R/3 .. and update the batch number too .. in the order!!! Easy does it? Nope!!! But there is a way ...

1. In CRM, there is a BDOC exchange BADI which I could use to transfer the serial number over to R/3, the BADI is CRM_DATAEXCHANGE_BADI, use the CRM_DATAEXCH_AFTER_BAPI_FILL method to fill in missing information. I need to enhance the BAPISDITM structure to add this new serial number field.

2. On the R/3 receiving end, thing doesn't seem to be that simple. The BAPI_SALESDOCU_PROXY_UPLOAD doesn't have BADI that I could use to transfer these fields from CRM.. but .. yes, there always be a but .. there is BTE available which I could use .. BTE/Process 00501020/00501021 could be use to transfer some missing information from CRM to R/3, batch number could be assigned here, no problem. I need to enhance the BAPISDITM here too .. and probably the VBAPKOM structure too so I could pass this to the final user exit .. which is .. yes.. to assign this serial number to the order.

3. Now, how the heck am I going to update this serial number into the order? I have never done this before, I've done updating serials into delivery document .. but not to an order document. This yet to be tested .. but this URL seems to be promising .. will try this one out:

https://forums.sdn.sap.com:443/thread.jspa?threadID=1470413

Two function modules described at the end of the thread there: IWOL_WV_ADD_OBJECTS & IWOL_WV_POST_OBJECT_LIST.

Will try this and see if I could get it to work! Wish me luck ..

Update 1: Success!! Got it to work in less than a day .. couldn't pass the vbapkom to the final stage so I need to use an ABAP memory to pass the final table into the final user exit before I could post it. But somehow, the serial isn't get copied to a delivery document .. no idea why, someone needs to fix this for sure .. functional problem :)

Update 2: A small hitch, after they fixed the config, a short dump occurs when creating a delivery. Probably something has to do with the serial counter at VBAP. Need to take a look into this..

Update 3: Scrapped everything on the last part.. doesn't seem to work!!! Yes, I could get the serial into the order but as update no 2, I have problem when creating delivery document.. it wasn't the serial counter but the object type in OBJK. So, I've implemented this using a new function module SERNR_ADD_TO_AU. I added this in userexit_save_document_prepare instead. I've no problem copying the serial number into the delivery document now.

Comments

9W2BSR said…
It is all greek to me but good luck anyway... :-)
I'm sure, in between the drooling, you can find the inspiration to solve the problem... |||8-r
9W2TPT said…
Muhaa..haa.. its alright Basir .. aku pun x paham some of your works gak ..

Popular posts from this blog

Configuring TechniColor TG784N V3 (Maxis issued broadband router) to use different DNS servers

Previous write up deleted. It seems to change the DNS servers in as shown on the status, but it does not really work.

Check the following website, this seems to work:

http://www.o2help.co.uk/router-change-dns/

This can be done from the WEB GUI too, go into the following configuration path:


In my example above, I'm using paid service unblock-us instead of google public DNS servers.

Raspberry Pi + svxlink = Low power echolink node

What is the easiest way to get echolink node up and running on raspberry pi? Surely, get a premade image which has everything inside. I've created one image which can fit into 2GB SD card for this, just follow the following steps to get it up and running:

For hardware, you need to have the following:
Raspberry Pi for sure, with a minimum 4GB SD cardA USB echolink interface, can be commercially sourced or DIY. There are many DIY schematics out there that you could follow.  Here is the configuration on how to get the things working together, courtesy of svxlink.de website:

For software:
Download the following prepared image from google drive, it is based on raspbian-2015-02-16 image and has pre-installed svxlink-14.08. raspi-wheezy-svxlink.img.zipUnzip the file and copy it to your SD card using the following instructions that can be found here.Boot up the RasPi, if you do not have an HDMI monitor, you may want to access the RasPi from your terminal emulator (putty or the like), connec…

Debugging DMEE

I've come across many posting on the Internet (via google search), people asking on how to debug a DMEE for payment program. One of the few suggestion was to create a user exit just before the node that we would like to debug and put our breakpoint there. It seems that SAP has built-in this feature without needing us to create a user exit (available in ECC 6, have no idea if this is available on prior releases). Here is how you can put your breakpoint without any coding.

1. Display your DMEE tree using transaction: DMEE_DEBUG.


2. Click on the node that you would like to debug.
3. Go to conditions tab, you could see the Set Breakpoint button. Click to set.



4. Run the SAPFPAYM and specified the payment run date/id, payment format etc. SAP will stop at the node which you point your breakpoint at, as in 2.
5. To remove your breakpoint, just run the DMEE_DEBUG again, there is an option to delete all own breakpoints or all.