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: 

Need BAPI to update the data of customised fields of VTTS table.

Former Member
0 Kudos

Hi,

There are some customised fields in the table VTTS.

I need to modify some fields data of the table VTTS ( standard fields + customised fields).

Please suggest some BAPI which can modify the fields.

14 REPLIES 14

Former Member
0 Kudos

Hi Shweta,

This is the requirement for updating shipment stages. Here we generally use BAPI_SHIPMENT_CHANGE, but as your requirement is to update custom field this is not suitable.

For custom fields update, we have to have EXTENSIONIN and EXTENSIONINX structure or the updation of custom fields.

On debugging BAPI_SHIPMENT_CHANGE I got that it is calling SD_SHIPMENT_PROCESS_EXT_CHANG. So may be you have to create your ZBAPI and enhance this FM. Modify the fields here and it should work.

Hope it helps...

Regards,

Sumit


0 Kudos

Hi Sumit,

Thanks..for the reply.

Do I need to add my customised fields in this FM SD_SHIPMENT_PROCESS_EXT_CHANG? Can u please advice how to proceed on this?

0 Kudos

Instead of enhancing function modules I would say change the standard fields with the regular BAPI and if successful just update the custom fields directly in the table.

That's what I would do... even if probably not the most elegant approach.

Regards,

Bruno

nabheetscn
Active Contributor
0 Kudos

Can you please check function module

 

RV_SHIPMENT_UPDATE

0 Kudos

Where would you pass the custom fields on that one Nabheet?

Regards,

Bruno

EDIT: Oops, just saw it

That way you can just as easily use function module SD_SHIPMENT_CREATE to create a shipment I believe!

0 Kudos

Hi, I tried

RV_SHIPMENT_UPDATE . There are many tables which are mandotory to pass while using this.

I have data for VTTK and VTTS only in my internal tables

0 Kudos

Hi Bruno, I need to just update the shipment stages data and my customised fields are not available here.

0 Kudos

Hi Bruno

I normally prefer to use release function module. But many a times we are struck and dont have any other option so that time we are forced to use these not released FM..

I guess rather than updating custom fields directly it is still a better way. what do you think?

Nabheet

0 Kudos

Hi Shweta,

Have you tried using FM RV_SHIPMENT_READ before hand to get the mandatory information for the update FM?

Regards,

Bruno

0 Kudos

Hi Nabheet,

I think that is a good and fair question with no definitive answer (in my humble opinion).

When it comes to custom fields (and custom fields only) I would be too afraid to change them through direct updates... and it might be even preferable doing the update directly than using a non-released function module.

For SAP standard tables/fields I would be very VERY careful (or not do it at all) to use direct update or non-released function modules.

Regards,

Bruno

Former Member
0 Kudos

Yes Shweta,

There is a subroutine "SET_HEADER_CHANGE_DATA", where you can put the break-point.

see what all values you get here. I am sure you can modify your custom fields here.

Thanks,

Sumit

0 Kudos

Hi,

When updating standard fields for stages using BAPI_SHIPMENT_CHANGE, the header is getting updated but the stages are not getting updated.

I am using the below code..Pls advice

stagebapi-service_agent = stages-tdlnr.
stagebapi-special_process_id = stages-sdabw.
stagechg-service_agent = 'C'.
stagechg-special_process_id = 'C'.

APPEND stagebapi TO stagebapi.
APPEND stagechg TO stagechg.

CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
          EXPORTING
            headerdata           = headerbapi
            headerdataaction     = change
          TABLES
            stagedata            = stagebapi
            stagedataaction      = stagechg
            return               = return.

Former Member
0 Kudos

Populate ITEMONSTAGE and ITEMONSTAGEACTION.

It will update.

Thanks,

Sumit

0 Kudos

Hi Sumit,

I tried populating  ITEMONSTAGE and ITEMONSTAGEACTION.

Do we need to pass delivery number also in this. if yes then what to pass in action table for delivery.

If we leave it blank then it gives error.

If you have tried this out, Can u pls provide the code for this with what needs to be passed to tables.