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: 

IW37N /IW49N copying Standard program RI_ORDER_OPERATION_LIST and creating a custom program

former_member563268
Participant
0 Kudos

Hello Experts,

I have a requirement to copy the standard program RI_ORDER_OPERATION_LIST to create a custom program. I have copied this using the copy option and have recreated the z program. Now the requirement is to add the confirmation details to this report(entries from afru table).

I have tried a sample by adding few fields for confirmation into the new fieldcatalog and table fetch towards end of program before calling the subroutine display_list_f14. This one works fine with the smaller set. But while trying to change the layout alv output is refreshed and it pulls the standard output result and the he newly added columns are cleared becoming blank.

Identied that, this is from the standard code; specifically the routine change_list_fields_f30 where the final table to output is filled again with the values from standard code fetch. What could be a possible solution to avoid the refresh.?

Also is there a better option to include the structure afru in this custom report, rather than explicitly creating the field catalog and the fields.

Please drop in your suggestions.

Thanks,

6 REPLIES 6

p244500
Active Contributor
0 Kudos

Hi,

I suggest you , without copy standard program, you should enhance it with IWOC0004 and

You can also look for some enhancement spots.

or use BADI for it. BADI_EAM_SINGLELEVEL_LIST

0 Kudos

Thanks for the note. But I want a custom copy and a new z tcode for this.

J ABAP Do you really "want" that? As a developer, your responsibility is to inform your customer of the important risks of copying a program, that may occur when future patches and upgrades are performed. Even if there are no enhancement options available, I often highly recommend to do a modification of the standard with kinds of simple but secure switches (the modifications should be only statements ENHANCEMENT-POINT and implementations should be "if given-condition then custom else standard" + define your enhancements under a package attached to a switch attached to a reversible enterprise business function so that you can easily switch off your changes) - Give the following note to your customer and make him sign the consent form (*) if still want to do a copy : 213751 - Programs: Copying versus modification. (*) it's a joke, there's no consent form.

former_member563268
Participant
0 Kudos

sandra.rossi , nawanandana.edirisinghe

So i tried it this way. Created a custom tcode for the same program. Have used the BADI BADI_EAM_SINGLELEVEL_LIST(IF_EX_BADI_EAM_SINGLELEVELLIST~CHANGE_FIELD_CATALOG) for changing the field catalog. But with the addition of new columns i couldn't use this, as i have to add confirmation list from AFRU table which is kind off 1: n (order: confirmation). And the method ADD_NEW_fields cannot be used here (as it is just the workarea that is being called each time the method is instantiated). Now for adding the fields, I have used the BADI IHREP_EXTENSIONS and confirmations against each order are appended to the final output table within this BADI. Tried with few fields in place and it works.

Issues Faced: on adding the field-catalog by using append table in RIH_ORDER_OPERATION_LIST, the fields would appear while selecting the layout from IW37n/IW49n. But this has to be avoided as i need this only for custom tcode. Inroder to achieve this, we have added TECH = 'X' based on condition in CHANGE_FIELD_CATALOG BADI. But this has resulted in a lengthy code mentioning the fieldcatalog text based on condition and updating cs_fieldcatalog-tech = abap_true, when sy-tcode <> 'ZTCODE'. This is to be repeated for 140 fields which makes the code quite lengthy.
Same is the case while appending the values to final output table ct_order_operation_list[] under BADI IHREP_EXTENSIONS.

0 Kudos

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area: "Before answering You should only submit an answer when you are proposing a solution to the poster's problem"

0 Kudos

I wonder why your code is so long. Don't you want to show it? (at least for one of the 140 new columns, in every part of the BAdI methods where it appears)