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: 

How to auto populate Actual GI Date in Delivery

Former Member
0 Kudos

Hi All,

I have created a report in which sales order and delivery gets created automatically using bapi's. When I go to my delivery number which is created thru vl02n, I see the Planned GI date gets automatically populated thru bapi.

But, my Actual GI Date is blank. I need to auto fill the Actual GI date with my Sales Order PO date.

Is there a way that I can do this automatically with delivery bapi or do I need to use copy routines to achieve this?

Please help.

Thanks.

1 ACCEPTED SOLUTION

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Which BAPI are you using to create the delivery?

10 REPLIES 10

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Which BAPI are you using to create the delivery?

0 Kudos

Hi Tamas,

Thanks for the response. I am using 'BAPI_OUTB_DELIVERY_CREATE_SLS'.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

The interface of that BAPI is pretty restricted and it doesn't offer the capability to specify too many header fields.

I'd rather try to achieve your goal using a copy routine that populates the field.

Or if that's not an option, then look into function modules RV_DELIVERY_CREATE_SINGLE or RV_DELIVERY_CREATE instead of the BAPI.

0 Kudos

Why not use the delivery BADI LE_SHP_DELIVERY_PROC?

0 Kudos

Can you please be able to tell me how to achieve this using copy routines. Sample snippet is appreciable.

Thanks.

0 Kudos

Why don't you look at the existing copy routines and config in your system?

0 Kudos

Hi Brad,

Thanks for the response. I know the transaction for copy routines is VOFM.But I do not know at what point I need to check for my Actual GI Date.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Go to VOFM -> Data transfer -> Deliveries. Take a look at routine 201 (or better yet, check which copy routine is currently used in your configuration to copy fields into the delivery header).

You can either modify the currenlty used copy routine (in case it is not a standard one) or you can copy it and add your code to populate the field LIKP-WADAT.

In routine 201 as the example, there is structure XKOMDLGN with field BSTDT. This should (hopefully) be already populated with the PO date from the order. If not, then you can read the order header you're delivering and use VBAK-BSTDK as the source field. Then simply set LIKP-WADAT to whatever date you need.

Please check the online documentation for exact details about copy control. If you copied a standard routine, you will have to set the new routine in the configuration so that it's used when a delivery is created referencing an order.

0 Kudos

Hi,

Check the data transfer routine in transaction VTLA for the order type to delivery type at header level.

Let me know, it helps you. Thanks.

0 Kudos

I am closing this thread since my problem is solved. Points issued for the useful answers. Thank you for the response Tamas.