In the Update Address Book BV, I pass the version correctly(the 32nd parameter with value VERBE009), but it does not forward this value to the 6th parameter of Address Book MBF. I wonder why ?
How about the 103rd parameter(szVersionconsolidated). The function "Get PO version for MBF" reads this parameter and defaults the version of P0100041 application.
As you suggested I also checked the code of Update Address Book function, it calls the Address Book MBF in the line number 445.
I can call the Address Book MBF, but I am afraid of blank values for Address Book fields such as MCU, DOB etc. Because my screen will have only address details. So if I pass a blank value or don't assign the parameter for MCU(for example), will the Address Book MBF write the blank value to address book?
To avoid updating the address book record with blank or default values, you should call the MBF in inquiry (I) mode first, save the existing values and then call the MBF in update (C or U) overriding the values you want to change.
My recommendation is to create a C business function that wraps the calls to the Address Book MBF. You won't have to create 134 variables as you can simply declare the data structure in one line. The C business function will accept the address number along with the fields you need to update.
As I am not that much into JDE C API's, it will take more time to learn, and implement the task.
But these things happened only because of the P0100041 Version issue. I still did not understand, why the "Update Address Book" function do not forward the P0100041 version to the Address Book - MBF ? I can fix this issue by specifying a "Default Business Unit" in the default version (ZJDE001) of P0100041, but I am afraid of touching the standard version.
The szN0100041_Version parameter is completely ignored by The UpdateAddressBook business function. So, it will use ZJDE0001 no matter what you specify. The ZJDE0001 version in your system has business unit set to blank. If left blank, the system will use 1 as the business unit by default. If 1 is not defined as a valid business unit in your system, you will get an error. Business unit is not a required field for entry in standard address book. In your debug log, address# 1032143 is showing up as having a blank business unit (i.e not padded by spaces) - my guess is that this is causing the business unit to default from the version instead of just passing it though as a blank formatted business unit.
You are absolutely right.
We identified(some posts ago) this is the real cause of the issue. And now, I need to fix this issue or find an alternative way.
As I can see in our discussion "The szN0100041_Version parameter is completely ignored by The UpdateAddressBook business function", I wonder why does this function completely ignore the version ?