Advertising:
Additional writable customer fields in COOIS output: Difference between revisions
From SAP Knowledge Base
Line 17: | Line 17: | ||
==== Programming the "TABLES_MODIFY_LAY" interface method ==== | ==== Programming the "TABLES_MODIFY_LAY" interface method ==== | ||
<syntaxhighlight lang="abap" line> | |||
METHOD if_ex_workorder_infosystem~tables_modify_lay. | |||
LOOP AT ct_ioopcomp ASSIGNING FIELD-SYMBOL(<add_fields>). | |||
SELECT SINGLE comments FROM zpp_coois_comp_c INTO <add_fields>-zzcomment | |||
WHERE aufnr = aufnr_in | |||
AND posnr = posnr_in | |||
AND matnr = matnr_in. | |||
ENDLOOP. | |||
ENDMETHOD. | |||
</syntaxhighlight> |
Revision as of 00:07, 26 December 2024
The aim of this enhancement is to be able to save any text, e.g. a comment for a particular entry, by means of an additional button in a newly added field.
A BAdI and a Z program are used for this. No SAP standard code is modified. The text entry is only displayed once it has been called up again after the selection.
This is shown using an example for the "Component" list. An entry for components can be clearly identified with the order no., item no. and material number (component).
Extend table "IOOPCOMP" with append structure
Create a table in customer namespace to save a text
Implementation storage text
Create program in customer namespace to save the text in created table (see step 2)
Create transaction code for created program
Use BADI "WORKORDER_INFOSYSTEM" to read text
Create BAdI implementation in customer namespace or extend existing one
To do this, call up SE18 and a implementation in customer namespsace is created on the "Implementation" tab under "Create". The BAdI can be used multiple times. Therefore, more than one implementation can be created and activated here.
Programming the "TABLES_MODIFY_LAY" interface method
METHOD if_ex_workorder_infosystem~tables_modify_lay.
LOOP AT ct_ioopcomp ASSIGNING FIELD-SYMBOL(<add_fields>).
SELECT SINGLE comments FROM zpp_coois_comp_c INTO <add_fields>-zzcomment
WHERE aufnr = aufnr_in
AND posnr = posnr_in
AND matnr = matnr_in.
ENDLOOP.
ENDMETHOD.