Application Development and Automation 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: 
Read only

Can we update The extended VBPA database table using BAPI

Former Member
0 Likes
1,410

Hi,

We have a table VBPA appended with two fields start date and end date. Our scenario is to when modifying the sales order using the bapi BAPI_SALESORDER_CHANGE we need to update the two fields star_date and end_date of VBPA table for the corresponding Ship to or Sold to partner for the Given Sales Order.

Thanks,

Venkat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,067

Hi,

YES You can, You should be updating this to fields using a BAPI - "BAPI_SALESORDER_CHANGE" and use table user this BAPI "EXTENSIONIN" to update this fields. Refer to BAPI documentation for more reference. Please check below code which was done for VBAK (2 date fields).

Regards,

Tim

DATA:

ZBAPISDH1 TYPE BAPISDH1,

ZBAPISDH1X TYPE BAPISDH1X,

ZEXTENSIONIN TYPE TABLE OF BAPIPAREX WITH HEADER LINE,

BAPE_VBAK TYPE BAPE_VBAK,

BAPE_VBAKX TYPE BAPE_VBAKX.

ZBAPISDH1X-UPDATEFLAG = 'U'.

BAPE_VBAK-VBELN = P_VBELN.

BAPE_VBAK-ZZSD_FROM = P_START.

BAPE_VBAK-ZZSD_TO = P_END.

BAPE_VBAKX-VBELN = P_VBELN.

BAPE_VBAKX-ZZSD_FROM = CO_X.

BAPE_VBAKX-ZZSD_TO = CO_X.

ZEXTENSIONIN-STRUCTURE = 'BAPE_VBAK'.

ZEXTENSIONIN-VALUEPART1 = BAPE_VBAK.

APPEND ZEXTENSIONIN.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'.

3 REPLIES 3
Read only

Former Member
0 Likes
1,068

Hi,

YES You can, You should be updating this to fields using a BAPI - "BAPI_SALESORDER_CHANGE" and use table user this BAPI "EXTENSIONIN" to update this fields. Refer to BAPI documentation for more reference. Please check below code which was done for VBAK (2 date fields).

Regards,

Tim

DATA:

ZBAPISDH1 TYPE BAPISDH1,

ZBAPISDH1X TYPE BAPISDH1X,

ZEXTENSIONIN TYPE TABLE OF BAPIPAREX WITH HEADER LINE,

BAPE_VBAK TYPE BAPE_VBAK,

BAPE_VBAKX TYPE BAPE_VBAKX.

ZBAPISDH1X-UPDATEFLAG = 'U'.

BAPE_VBAK-VBELN = P_VBELN.

BAPE_VBAK-ZZSD_FROM = P_START.

BAPE_VBAK-ZZSD_TO = P_END.

BAPE_VBAKX-VBELN = P_VBELN.

BAPE_VBAKX-ZZSD_FROM = CO_X.

BAPE_VBAKX-ZZSD_TO = CO_X.

ZEXTENSIONIN-STRUCTURE = 'BAPE_VBAK'.

ZEXTENSIONIN-VALUEPART1 = BAPE_VBAK.

APPEND ZEXTENSIONIN.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'.

Read only

0 Likes
1,067

Hi Tim,

I really appreceate your reply, however I couldn't find a structure name "BAPI_VBPA". can you please provide me some more information.

Thank You,

Venkat.

Read only

0 Likes
1,067

Hi Venkat,

It will be "BAPE_VBAP" in you case. Check the BAPI "BAPI_SALESORDER_CHANGE" function module document for "EXTENSIONIN".

Regards,

Tim