cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using the BAPI_CREATE_SHIPMENT

yan3
Explorer
0 Kudos
1,443

Hi,

I was trying to see if the data I entered in the different structures for the BAPI were ok (not very easy to find where data should be entered, as the data in the different structures don't have the same name as in VTTK, VTTP, VTSP tables).

But though I get a success message telling me that a shipment was created, I can't find any shipment with the number in the message.

Am I missing anything?

Thanks for the help

Kind regards

Yan

Accepted Solutions (1)

Accepted Solutions (1)

HakanHaslaman
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you're having trouble locating the shipment with the provided number, consider following these steps:

1. Remember to call 'BAPI_TRANSACTION_COMMIT' after using the BAPI. This action will save any changes you've made. If you forget to do this, the shipment will be created, but it won't be saved.

2. Make sure you're looking in the correct transaction. For instance, VT03N is the transaction for creating a shipment.

3. Ensure you're looking in the correct system and client where the BAPI was executed.

4. Even if you received a success message, there might be warnings or errors that are preventing the shipment from being saved. Check the return table of the BAPI for any messages.

5. The shipment number could be within a range that isn't displayed in your transaction. Verify the number range for shipments in your system.

6. Make sure the data you've entered into the BAPI is correct. If it's not, this could be preventing the shipment from being saved.

7. If you've tried everything else and are still having issues, you might need to debug the BAPI to find the problem.

yan3
Explorer
0 Kudos

Hi,

As I said, everything was telling me that a shipment was creared, meaning then that the data I entered were correct.

The only thing that missed in the FM was the COMMIT, what surprized me as it's not always the case when you test an FM in SE37.

But telling this isn't really helpful to a non-developer, so, here is the trick:

Display the source code of the FM in SE37.

Go to the 'Function Module' menu, submenu 'Execute' and 'Test Sequences'.

Enter as first sequence the BAPI_SHIPMENT_CREATE, as second one BAPI_TRANSACTION_COMMIT and validate the sequence.

The test screen is then displayed, either you populate the values for the different structures there ot you go to the test data diretory to retrieve your's.

Execute then the BAPI_SHIPMENT_CREATE.

When finished, look for the number of the shipment that was created.

Then, press the back arrow to go tho the BAPI_TRANSACTION_COMMIT and execute it.

Once finished, you can see in VT03N the shipment that was created.

Answers (1)

Answers (1)

yan3
Explorer
0 Kudos

Hi,

As there is a bug when entering the TIME_TYPE in HEADER- and STAGEDEADLINE (entries are not kept), I was looking for a note on the support portal.

I couldn't find one related to that issue, just changed the content of the structures in debug to enter the different TIME_TYPE.

However, I found another note that helped withe TIME_TYPE in the BAPI_SHIPMENT_CREATE.

The documentation of the FM is unclear and even not correct if you display the doc for structures HEADERDEADLINE and STAGEDEADLINE.

The different TIME_TYPE to use can be found in the code, but also in the note 531207 - Use of BAPI_SHIPMENT_CREATE concerning shipping statuses.

Ask a Question