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

VA02 from an ABAP program

SantoshB
Explorer
0 Kudos
2,012

Hi,I have a requirement to call transaction VA02 from an ABAP program, which will run as a background task. The user will provide input via a selection screen. This input should be populated in VA02, and the sales order should be saved automatically. I'm considering two options for achieving this: BDC (Batch Data Communication) or BAPI_SALESORDER_CHANGE. Which option would be the most suitable for this scenario? Additionally, my VA02 screen has a custom tab with fields populated from a Z table. Is it possible to update this Z table using either BDC or BAPI_SALESORDER_CHANGE? Are there any other alternatives besides BDC or BAPI that I should consider? Your insights and suggestions would be greatly appreciated. Regards,

Accepted Solutions (0)

Answers (3)

Answers (3)

819
Active Participant
0 Kudos

Hi, about your custom field, you can try to check the TABLE parameter:EXTENSIONIN in this bapi.

please check this parameter's long text to get how to use.

Thanks!

SantoshB
Explorer
0 Kudos

@Ryan-Crosby 

Hi Ryan-Crosby,

In my current process, I manually update sales orders through the on-screen transaction code VA02. The steps involved include:

  1. Updating the Order Reason field.
  2. Navigating to the Conditions tab and clicking the Update button.

To automate this process, I am considering two options:

  1. BDC recording: My initial plan was to record a BDC session to replicate the steps performed manually.
  2. BAPI_SALESORDER_CHANGE: However, considering the preference for BAPIs over BDC for standard transactions, I am exploring the possibility of achieving the same outcome using the BAPI_SALESORDER_CHANGE function module.

Before proceeding further, I would appreciate your guidance on whether BAPI_SALESORDER_CHANGE can effectively handle the required updates. Additionally, if you have any insights or recommendations on the most efficient approach for this task, please feel free to share them.

SantoshB_0-1709914127802.png]

SantoshB_1-1709914134315.png

 

Ryan-Crosby
Active Contributor
0 Kudos
@SantoshB yes, you can most certainly update the order reason code and conditions in the BAPI (assuming it's permitted in the pricing procedure configuration).
SantoshB
Explorer
0 Kudos

Hi @Ryan-Crosby ,

in below screenshot, there is update button, whatever this update button does , whether the same functionality is available in BAPI_SALESORDER_CHANGE?

SantoshB_0-1709869448101.png