cancel
Showing results for 
Search instead for 
Did you mean: 

custom button in the POWL

Former Member
0 Kudos

Hi,

I have a requirement to create a new shopping cart referring the old shopping cart and updating the old PO which got created from SRM.

for ex : SC 1001 -> PO 2001(Classic PO) is created. Now new SC 1002 will be created referring the old SC 1001 and for new SC 1002, PO should not be created, but PO 2001 should be updated.

for this requirement i am planning to create a new button 'Create Reference SC' via POWL and advanced search -> Adjust POWL Layout, Search Criteria, and Pushbuttons -> Actions for POWL type ID SAPSRM_FEEDER_SC_PROF.

Once the button got added, i am planning to write an enhancement to control the visibility of the button based on follow on document status in the class /SAPSRM/CL_CLL_POWL_A_BO_SC-> ENABLE_BUTTONS.

My Question : Once i click on the 'Create Reference SC' button, this should open a new SC screen and the data from old shopping cart should be copied to the new one. Do any one know how to achieve this?

How do we link the action to the newly created button as we are not adding the new button in the webdynpro? Attached the screen shot of where i am trying to add the button.

Accepted Solutions (1)

Accepted Solutions (1)

laurent_burtaire
Active Contributor

Hello Lokesh,

Lokesh Bollineni wrote:

(...)

My Question : Once i click on the 'Create Reference SC' button, this should open a new SC screen and the data from old shopping cart should be copied to the new one. Do any one know how to achieve this?

(...)

You just have to do as for "Copy" button from POWL type ID SAPSRM_FEEDER_SC_PROF.

Lokesh Bollineni wrote:

(...)

How do we link the action to the newly created button as we are not adding the new button in the webdynpro? Attached the screen shot of where i am trying to add the button.

(...).

  1. In ENABLE_BUTTONS method from class /SAPSRM/CL_CLL_POWL_A_BO_SC, SC status helper is used to know which actions are possible using /SAPSRM/IF_PDO_STATIC_HELPER~GET_STATIC_ACTIONS method from /SAPSRM/CL_PDO_SC_STAT_HELPER). So, you have to enhance this class to add you action ID.
  2. You need to enhance /SAPSRM/CL_CLL_PWL_A_SC_PROF class (Feeder class of POWL Type ID SAPSRM_FEEDER_SC_PROF)to add process linked to you new Action ID (based on ORDER_PDO_BO_SC method). But, in your case you must update existing PO created as first SC follow-on document and not create a new PO.

Regards.

Laurent.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lokesh,

What I can think of is using the same action that is there in the SC POWL screen for creating a SC. To your Z button add this action ( you might have to debug to see what are the importing parameters that you need to pass the to the WD screen to launch) but if you do it this way you can trigger the doc_change_badi and in the doc_change_badi you can write your code to pick up the reference of the old SC that you launched the new SC screen from.

The other option is to debug the GAF of SC and over there when you are in the first step click on the OLD Shopping carts and templates and on selecting the SC number whne you click OK( debug the calls that happens to launch the new screen) and try and replicate it to you Z button.

Hope this helps.

Regards,

Naveen