Skip to Content
1
May 07, 2018 at 01:18 PM

How to create a button in VA22 toolbar that will copy the items from another quotation ?

396 Views

Hello SAP ABAPers,

I have a request to enhance VA22 transaction with a new button in the application toolbar that will have to raise a pop-up window in which I will introduce a quotation number and then I will copy the items from the inserted quotation number to the displayed quotation number.

I have proceeded below steps:

  1. copy PF-status 'U' into pf-status 'ZZ1' from prog SAPMV45B into Z* prog and add my button, than Activate
  2. Into PAI module of screen 4001 in program SAPMV45A, I create an implicit enhancement Z* at the end of the routine CUA_SETZEN with the below code where I am using the pf-status created above:

if sy-tcode = 'VA22' and SY-DYNNR = '4001'.
set PF-STATUS 'ZZ1' OF PROGRAM 'ZTSTGUI'.

endif.

3. Create an enhancement Z* into PBO module of screen 4001 in program SAPMV45A, module FCODE_BEARBEITEN, and code the functionality here (raise pop-up, get value and call bapi BAPI_QUOTATION_GETDETAILBOS to get the items of the inserted quotation and call bapi BAPI_CUSTOMERQUOTATION_CHANGE for updating my quotation .


Should you please check my steps and advice me where am I wrong ? Why the pf-status is not identical with the old pf-status even if I have copied the correct pf-status ? (now i have more buttons) Why the BAPI for QUOTATION_CHANGE is returning error V1 - 045 - "Insert document number" , even if the input values and tables were maintained correctly ?

Can you give your opinion regarding the requirement of copying items from a different quotation into another is feasible and that it will not affect the SAP standard ?

Thank you,

Andreea