Skip to Content
Author's profile photo Naga Chaitanya Challa

Add New or Custom Fields to COOIS Output

Add New Or Custom Fields To Transaction COOIS Output


USING BADI WORKORDER_INFOSYSTEM


METHOD – TABLES_MODIFY_LAY

Foreword about the requirement:


The requirement is to add new fields or custom fields or new columns to the transaction COOIS ALV output. Hence, I have prepared a document to help resources who are looking for a step by step guidance on this. All the steps to implement the proposed solution are captured in the document; references have been taken from the notes mentioned below and the requirement is fulfilled. However, any such implementation should be thoroughly tested before moving to next systems, as it can help identify side-affects, which cannot be predicted before/after the implementation. Hence such side-affects may be identified in testing, further helping to better the solution as per your own requirements and needs.


Symptom:


You need to enhance / add / display additional fields or columns in the ALV OUTPUT of order information system which are not provided in the standard system in COOIS ALV output.


References / Related OSS Notes:


For preparing this document, references have been taken from the below notes.


Note #

Description

615206

COOIS: BADI order delay in IOHEADER

806375

COOIS: Order delay Business Add-In in IOHEADER

434123

Filling and displaying own fields in information system

363327

COOIS/CO26/CO28: Change list of fields that can be displayed

How:


This requirement can be achieved by implementing the BADI WORKORDER_INFOSYSTEM – Method – TABLES_MODIFY_LAY.


Detailed procedure for implementation:


Following is the step by step procedure for adding new fields for the COOIS transaction output:

1. Create a DDIC structure in SE11 with the name (any name) : ZCOOIS_QALS_DATA

/wp-content/uploads/2015/10/1_804840.png

2. Add the required fields in the structure (this structure will later be added as an append structure in IOHEADER_DELAY ). These fields are the new fields or new columns that will be displayed on the COOIS ALV output.

/wp-content/uploads/2015/10/2_804841.png


SAVE the structure. Input the name of a package, Transport Request number and ACTIVATE the structure.


3. Go to SE11, display the structure IOHEADER_DELAY:


/wp-content/uploads/2015/10/3_804845.png

Below is the screen print of the structure IOHEADER_DELAY before adding the fields (or before performing an append structure):


/wp-content/uploads/2015/10/4_804846.png

Click on Append Structure button/wp-content/uploads/2015/10/5_804847.png


In the pop up, input the name of the structure that we created in step 1 & step 2 so that this structure can be appended to IOHEADER_DELAY.


/wp-content/uploads/2015/10/6_804854.png


4. Below is the screen print of the structure IOHEADER_DELAY after appending structure ZCCCIS_QALS_DATA which has the required fields:


/wp-content/uploads/2015/10/7_804856.png


Activate and close SE11.


5. Use transaction SE38 to execute the report RCNCT000.


/wp-content/uploads/2015/10/8_804863.png


Input “IOHEADER” in the field string name and “RCNHEAD” in the include name as shown below and click on Execute –


/wp-content/uploads/2015/10/9_804864.png


In the following pop up, click on the CONTINUE button: /wp-content/uploads/2015/10/27_804865.png


/wp-content/uploads/2015/10/10_804866.png


6. In the following screen, click on the GENERATE Button:    /wp-content/uploads/2015/10/11_804867.png


/wp-content/uploads/2015/10/12_804868.png


Following is the information message that shows up after “generating”:


/wp-content/uploads/2015/10/13_804872.png


7. Use transaction SE38 to execute the report RCOTX000 and enter IOHEADER as the field string name (afterwards, choose F8).

/wp-content/uploads/2015/10/14_804873.png

Input the name of the structure “IOHEADER” in the field string name Choose F8 to execute the report.


/wp-content/uploads/2015/10/15_804858.png


Below is the screen print of the report RCOTX000 output. You will be able to identify your fields in the below screen (fields per this requirement are not shown below though)


/wp-content/uploads/2015/10/28_804913.png


Click “SAVE” and you will be taken to back to the selection screen. You can now close the transaction SE38.


8. Go to transaction SE19 to create the implementation for the BADI WORKORDER_INFOSYSTEM. This is the appropriate BADI for the requirement to add new/customer fields to the COOIS output.


/wp-content/uploads/2015/10/17_804881.png


Input a name for the implementing WORKORDER_INFOSYSTEM. In this case, I created an implementation as ZENH_ADD_QALS_FIELDS.


/wp-content/uploads/2015/10/18_804882.png


Click Continue. On the following screen, input the implementation short text and click SAVE.


/wp-content/uploads/2015/10/19_804883.png


  • Input the name of the package and Transport Request.
  • ACTIVATE the implementation so that it gets called in the run time. This can also be done once the business logic is implemented / written. You can either activate now or even after writing your logic. How ever, if you activate before writing your logic, the implementation would trigger but there would be no logic in any method to execute )


9. Click on the interface tab. In the list of methods, the logic for the current requirement is to be implemented in the method TABLES_MODIFY_LAY.


/wp-content/uploads/2015/10/20_804893.png


10. Double click on the method name TABLES_MODIFY_LAY to go ahead and implement the business logic to populate data into the required fields.


11. For the current requirement, the logic is written to add data into the method interface parameter CT_IOHEADER. This internal table contains data that would be displayed as the output. Hence we implement our logic in this method.


/wp-content/uploads/2015/10/21_804894.png


The logic for the current requirement is as follows:


/wp-content/uploads/2015/10/22_804895.png
/wp-content/uploads/2015/10/23_804905.png

/wp-content/uploads/2015/10/24_804906.png


Also, below is the code for your help.


METHOD if_ex_workorder_infosystem~tables_modify_lay.

**– Types Declarations

TYPES: BEGIN OF ty_qals,
prueflos   
TYPE qalsprueflos,
aufnr     
TYPE qalsaufnr,
zzstat34   
TYPE qalsstat34,
zzstat35   
TYPE qalsstat35,
zzlmengezub
TYPE qalslmengezub,
zzvcode   
TYPE qavevcode,
END OF ty_qals,

BEGIN OF ty_qave,
prueflos   
TYPE qalsprueflos,
aufnr     
TYPE qalsaufnr,
vcode     
TYPE qavevcode,
END OF ty_qave.

**– Internal table Declarations
DATA: lt_qals TYPE STANDARD TABLE OF ty_qals,
lt_qave
TYPE STANDARD TABLE OF ty_qave,

**– Work Area Declarations
ls_qals
TYPE ty_qals,
ls_qave
TYPE ty_qave.

**– Field Symbol for the Importing parameter CT_IOHEADER
FIELD-SYMBOLS: <fs_ct_ioheader> TYPE ioheader.

IF ct_ioheader IS NOT INITIAL.
SELECT prueflos aufnr stat35 stat35 lmengezub
INTO TABLE lt_qals
FROM qals
FOR ALL ENTRIES IN ct_ioheader
WHERE aufnr = ct_ioheaderaufnr.
IF sysubrc = 0.


SELECT qave~prueflos qals~aufnr qave~vcode
INTO TABLE lt_qave
FROM qave
INNER
JOIN qals AS qals
ON qals~prueflos = qave~prueflos
FOR ALL ENTRIES IN ct_ioheader
WHERE aufnr = ct_ioheaderaufnr.
IF sysubrc = 0.
ENDIF.


LOOP AT ct_ioheader ASSIGNING <fs_ct_ioheader>.


CLEAR: ls_qals.
READ TABLE lt_qals INTO ls_qals WITH KEY aufnr = <fs_ct_ioheader>aufnr.
IF sysubrc = 0.
<fs_ct_ioheader>
prueflos    = ls_qalsprueflos.
<fs_ct_ioheader>
zzstat34    = ls_qalszzstat34.
<fs_ct_ioheader>
zzstat35    = ls_qalszzstat35.
<fs_ct_ioheader>
zzlmengezub  = ls_qalszzlmengezub.


CLEAR: ls_qave.
READ TABLE lt_qave INTO ls_qave WITH KEY prueflos = ls_qalsprueflos
aufnr   
= <fs_ct_ioheader>aufnr.


IF sysubrc = 0.
<fs_ct_ioheader>
zzvcode      = ls_qavevcode.

ENDIF.


ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.


After writing the logic, SAVE and ACTIVATE the method and the BADI implementation. Also, for your requirements, please debug and check if you are able to populate data as needed into the relevant fields.


12. Now, go to transaction COOIS, key in the input parameters as required(or as per your test case) and click EXECUTE.


/wp-content/uploads/2015/10/25_804907.png


Following are the new fields or columns that we have added to the COOIS ALV OUTPUT. Please note that, displaying the below fields or columns may also need a change in the layout settings to display the below columns. Hence, please make sure that these columns exist in the ALV output by changing the layout settings.


/wp-content/uploads/2015/10/26_804912.png


You have now completed the procedure to enhance / add new or custom fields to the transaction COOIS using the BADI WORKORDER_INFOSYSTEM.


Finally, I request you to share your opinions on the document so that it can be enhanced for helping our resources who are interested or who have a requirement to implement this solution.


Thank you so much for reading and I am happy to have helped, Great Day Ahead !!


My Best Regards,

Naga Chaitanya Challa

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Amit Sharma
      Amit Sharma

      Hello Chaitanya,

      Thanx for sharing such a informative document.

      I have a same requirement in which i have to pass Posting date of order confirmation (CO11N/COHV) through the selection screen of COOIS.

      How can we get that field in selection screen of COOIS ??

      Regards,

      Amit

      Author's profile photo Naga Chaitanya Challa
      Naga Chaitanya Challa
      Blog Post Author

      Hi Amit,

      Could you please elaborate on the requirement.

      As per what I understand from the above:

      You need to pass the Posting date of the order confirmation to COOIS selection screen and the output data should get fetched accordingly.

      Is the above correct ? If yes:

      1. May I know if you have looked into the date fields that are provided at the bottom of the screen.


      - Could you check if there are any other parameters on the existing selection screen, that can work as an alternate parameters/fields that can be used to fetch the same intended data ?

      2. Is posting date the only factor you think, that the data is not relevant to ?

      3. Are you not able to pass the posting date on the existing selection screen ?

      Then you will need to implement a BADI or an implicit enhancement that triggers/works even before the data is fetched. Hence you would need to look for a BADI or enhancement for this.

      Else, implement the BADI WORKORDER_INFOSYSTEM & put a break point in the method TABLES_MODIFY_LAY (or the other methods as well, not sure if they trigger though) and run COOIS. See if the data in the interface parameters can be handled in the method to solve your requirement. 


      - If you think that all the detail you wanted is in the internal table CT_IOHEADER (and shows on the output), but only that it is not based on the posting date, then try filtering that data in the aforesaid method TABLES_MODIFY_LAY.

      Also, please go through the SAP notes mentioed above and below link and see if these can hep.

      COOIS Enhancement | SCN

      http://scn.sap.com/thread/1793842

      http://wiki.scn.sap.com/wiki/display/ERP6/COOIS+-+Adding+Profile+Parameter+to+Screen

      https://scn.sap.com/thread/2092904

      http://b2tio00e.benxbrain.com/en/sap/transaction/COISN-COOIS-modifiy-the-screen-select-thread-1-1671090.htm

      Please reply back with any further questions.

      Best Regards,

      Naga Chaitanya

      Author's profile photo Naga Chaitanya Challa
      Naga Chaitanya Challa
      Blog Post Author

      Dear Amit,

      Here are couple of other links that might help your requirement.

      COOIS: Additional Selection Screen

      Requirement Date on seelction screen of COOIS not working for Lists-Compone

      Do let me know if these help.

      Best Regards,

      Naga Chaitanya

      Author's profile photo Amit Sharma
      Amit Sharma

      Hello Chaitanya,

      Thank you for your prompt reply.

      You understood right that i need to add  posting date on the selection screen of COOIS so that i can check the Number of Production order's Posted on the particular date or monthly.

      I will check the same on my Development client as suggested by you and let you know.

      Regards,

      Amit

      Author's profile photo Giribabu Sakala
      Giribabu Sakala

      Hello Chaitanya,

      Very nice piece of information about Tcode COOIS.

      I have same requirement for Tcode COHV, Can I follow the same approach as back end report for COHV is also PPIO_ENTRY only.

      If yes, which structure we need to append our custom structure that needs to be shown in COHV output.

      Thanks in advance!

      Regards,

      Ramiz

      Author's profile photo Naga Chaitanya Challa
      Naga Chaitanya Challa
      Blog Post Author

      Hi Giribabu,

      You can try the same approach as back end report for COHV is also PPIO_ENTRY itself.

      I need to check/debug COHV to confirm the name of the structure that you need to append your custom structure. Could you also please try with F1 help/debug COHV output and check the BADI, for the name of the standard structure to append your custom fields.

      Regards,

      Naga

      Author's profile photo Muthukumarran Balaguru
      Muthukumarran Balaguru

      Hello Naga,

      Greetings for the day!!

      Nice document and Thanks for sharing,

      Addition to this in COOIS report, already standard filed/column is available i.e "Yeild to be confirmed" currently it is displayed blank. The logic for the field is Yield to be confirmed = Order quantity-[confirmed qty+ Confirmed scrap+ Rework Qty].

      Technically: structure IOOPER

      CONF_QUANT= MGVRG - [LMNGA + XMNGA + RMNGA].

      Please let me know how to proceed on this.

      Thanks in advance for your support.

      Regards

      Muthu

       

      Author's profile photo Giribabu Sakala
      Giribabu Sakala

      Hello Naga,

      Thanks for your fast reply!

      I debugged COHV output and find out a structure IOHEADER. But I am not sure on this. Can you check from your end to confirm.

      Secondly, After appending customer specific fields to standard structure (say IOHEADER) using 'Append Structure' technique, do we need to see 'Where used list' of IOHEADER i.e. programs, function modules, classes etc which is using IOHEADER structure will get disturbed or we get any error while executing those ? Could you also please comment on this ?

      Hope you got the question.

      Thanks in advance!

      Regards,

      Giri

       

      Author's profile photo Zaberca David
      Zaberca David

      Hello,

       

      Thanks for the information. There is a mistake at appending structure. You must append to IOHEADER, not IOHEADER_DELAY.

       

      Thank you