‎2007 Feb 12 5:55 AM
Hi all,
How can I check the status of a screen field if it is displayed only in some case?
e.g. an input field in a sales order is grayed out
Thanks.
‎2007 Feb 12 5:59 AM
http://www.sapdevelopment.co.uk/reporting/selscr/selscr_loopscreen.htm
In the event AT SELECTION SCREEN OUTPUT you can do a LOOP AT SCREEN and turn off the ACTIVE indicator. Use the debugger to determine what the name of the field is that you want to hide.
something like
LOOP AT SCREEN.
IF SCREEN-FIELDNAME = 'the name'.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ENDLOOP
parameters : fname like rlgrap-filename.
DATA : filename TYPE string.
DATA : table1 TYPE filetable,
rc TYPE i.
DATA : VAL LIKE DYNPREAD-FIELDVALUE.
data: dynfields type table of dynpread with header line.
PARAMETERS : R1 RADIOBUTTON GROUP RG modif id abc.
PARAMETERS : R2 RADIOBUTTON GROUP RG modif id def.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
default_filename = '*.*'
CHANGING
file_table = table1
rc = rc.
IF sy-subrc <> 0.
MESSAGE e000(zXXX) WITH 'Error'.
ENDIF.
read table table1 index 1 into fname.
IF fname cs '.XLS'. "substitute .csv
dynfields-fieldname = 'R1'.
dynfields-fieldvalue = 'X'.
append dynfields.
dynfields-fieldname = 'R2'.
dynfields-fieldvalue = ' '.
append dynfields.
elseif fname cs '.DOC'.
dynfields-fieldname = 'R1'.
dynfields-fieldvalue = ' '.
append dynfields.
dynfields-fieldname = 'R2'.
dynfields-fieldvalue = 'X'.
append dynfields.
ENDIF.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
‎2007 Feb 12 5:59 AM
Go to the program.
See the code in AT SELECTION-SCREEN OUTPUT.
You Can find the condition.
‎2007 Feb 12 6:15 AM
Thanks for replying.
My case is that,
I'm going to do the batch input for a field which is a structure but no storage in the db table, i.e. RV60F-KFREL.
In some cases, the field is grayed out and does not allow user to change it no matter it is batch input or not.
I just want to escape from such cases whenever my batch program hit this case, so I have to check it first before excuting the batch input codes.
But seems that I can't check it by searching the db table....
‎2007 Feb 12 8:05 AM
Macy,
Try to get the program name of that DYNPRO and check the corresponding module.
If you are dealing with a standard program then copy it to zname and then do the necessary modification in that corresponding PBO.
Hope it will work.
Even if you don't give points I don't mind, but please let me whether the above said works or not.
Kiran.