Escolar Documentos
Profissional Documentos
Cultura Documentos
1
HACER OBLIGATORIOS O NO CAMPOS SEGÚN GRUPOS…..................................2
AYUDA DE SAP:...............................................................................................................3
MODIFY - Change the attributes of a screen field.............................................................5
if sy-subrc = 0.
screen-invisible = '0'.
screen-active = '1'.
if screen-name = 'INP_102'.
screen-input = '1'.
endif.
endif.
* screen-input = '0'. " cerrar campo para input
* when others. " para resto de campos cerrados si material initial
* if mara-matnr is initial.
* if screen-group1 <> '1'. " Botones son del grupo1 = 1
** solo cerrar campos <> pulsadores (F1,F2,...
* screen-input = 0.
* endif.
* endif.
endcase.
modify screen.
endloop.
HACER OBLIGATORIOS O NO CAMPOS SEGÚN GRUPOS…
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
* Forzar campos obligatorios en función del grupo de cuentas del deudor
MODULE SET_OBLIGATORIOS.
*&---------------------------------------------------------------------*
*& Module SET_OBLIGATORIOS OUTPUT
*&---------------------------------------------------------------------*
* Forzar campos obligatorios en función del grupo de cuentas del deudor
*----------------------------------------------------------------------*
module SET_OBLIGATORIOS output.
SELECT *
INTO TABLE it_zsd013
FROM ZSD013.
IF sy-subrc <> 0.
ENDIF.
LOOP AT SCREEN.
* Para los campos que dependen del grupo de cuentas del deudor
CHECK SCREEN-GROUP1 IS NOT INITIAL.
Basic form
LOOP AT SCREEN.
Effect
All fields of the current screen are stored in the system table SCREEN with their attributes.
The LOOP AT SCREEN statement places this information in the header line of the system table.
If you want to change the attributes, you must put back the changed header line with MODIFY
SCREEN. However, you can only do this in the PBO module of a screen.
If you use this statement for step loop processing, the information (and any changes) apply only to
the current steploop line. Outside step loop processing, the information for a step loop field applies
to the complete column.
You can also modify fields in the loop processing of a table control using this loop statement. Unlike
a step loop, modifications before the loop have no effect, since the system gets the initial values for
the columns from the column table of the table view.
Step loop fields should never be changed after the corresponding step loop processing has been
performed.
You can use the CONTINUE statement to leave the current loop pass prematurely and continue with
the next loop pass.
Related
Additional help
Additional help
The system table SCREEN contains information about the fields contained on the current screen.
You can read them using the LOOP AT SCREEN statement, and change them using MODIFY
SCREEN.
Basic form
MODIFY SCREEN.
Effect
Changes the attributes belonging to the current screen field whilst processing with LOOP AT
SCREEN ... ENDLOOP.
The attributes of all fields of a screen are stored in the system table SCREEN. This can be edited line
by line using LOOP AT SCREEN ... ENDLOOP. Changes to the properties of the attributes of the
current screen field (= current line in the system table SCREEN) can be put into effect using MODIFY
SCREEN.
Addition
Effect
This addition assigns screen objects ( Comment, Underscore line, Parameter, ...) to a
modification group and hence allows dynamic modification of the selction screen display.
The modification group name modid must be specified directly and must be no longer than 3
characters. The addition MODIF ID assigns modid to the column SCREEN-GROUP1 of the
predefined internal table SCREEN. Parameters assigned to a modification group can be changed
together using the LOOP AT SCREEN and MODIFY SCREEN statements at the event AT
SELECTION SCREEN OUTPUT or in the subroutine PBO of the database program of the assigned
logical database.
- SELECTION-SCREEN COMMENT
- SELECTION-SCREEN ULINE
- SELECTION-SCREEN PUSHBUTTON
- PARAMETERS
- SELECT-OPTIONS
In each case all relevant screen objects are assigned to the modification group.
Without the MODIF ID addition, the SCREEN-GROUP1 component is empty. The remaining three
fields for modification groups in the SCREEN table are populated by the runtime environmentand can
be analyzed:
GROUP2 contains the value "DBS" for elements that are defined in a logical database.
Example
All screen objects (text, input fields, pushbuttons) belonging to the selection option S_PTYPE as well
as all comments defined with SELECTION-SCREEN COMMENT are set to the output format
INTENSIFIED.