Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Updating BOLNR (Bill of Lading) Through Extension2 of BAPI_OUTB_DELIVERY_CHANGE

droughtrye
Explorer
0 Kudos

Hello All,

I am trying to use BAPI_OUTB_DELIVERY_CHANGE to add a Bill Of Lading to a given OBD.


I have found numerous posts about it and have been unsuccessful in implementing a JCo function that accomplishes this task.

            JCoTable ext = function.getTableParameterList().getTable("EXTENSION2");
            ext.appendRow();           
            ext.setValue("PARAM", "LIKP");
            ext.setValue("FIELD", "BOLNR");
            ext.setValue("VALUE", "<SOME BILL OF LADING>");

As well I have specified:

            JCoStructure tech = function.getImportParameterList().getStructure("TECHN_CONTROL");
            tech.setValue("UPD_IND", 'X');

When I run the function and display the RETURN table I get no errors but BOLNR on the OBD is still blank.

Any advise would be greatly appreciated.

Thanks,

Droughtrye

1 ACCEPTED SOLUTION

droughtrye
Explorer
0 Kudos

All,

I found the solution:

Instead of using BAPI_OUTB_DELIVERY_CHANGE to change the Bill of Lading. I used WS_DELIVERY_UPDATE.

This enabled me to specify the delivery and a VBKOK structure specifying the BOLNR on that.

As long as you use the commit flag then it will take.

Example:

            function.getImportParameterList().setValue("DELIVERY", "0300999584");
function.getImportParameterList().setValue("COMMIT", "X"); JCoStructure vbkok = function.getImportParameterList().getStructure("VBKOK_WA");
vbkok.setValue("BOLNR", "<SOME BILL OF LADING>"); function.execute(destination);

Thanks,

Adam.

3 REPLIES 3

Ryan-Crosby
Active Contributor
0 Kudos

Hi Ada,

Has the 'SMOD_V50B0001' BADI been implemented appropriately in your back-end system to pass the data from the EXTENSION2 structure to the VBKOK structure?

Regards,

Ryan Crosby

0 Kudos

Hello,

I am not sure and I don't have the access to the T-Code to check.

I found the solution answering below.


Thanks,

Adam.

droughtrye
Explorer
0 Kudos

All,

I found the solution:

Instead of using BAPI_OUTB_DELIVERY_CHANGE to change the Bill of Lading. I used WS_DELIVERY_UPDATE.

This enabled me to specify the delivery and a VBKOK structure specifying the BOLNR on that.

As long as you use the commit flag then it will take.

Example:

            function.getImportParameterList().setValue("DELIVERY", "0300999584");
function.getImportParameterList().setValue("COMMIT", "X"); JCoStructure vbkok = function.getImportParameterList().getStructure("VBKOK_WA");
vbkok.setValue("BOLNR", "<SOME BILL OF LADING>"); function.execute(destination);

Thanks,

Adam.