08-20-2014 11:33 AM
Hi experts, wish you good health.
Need your help:
I have done a report program which call a pool program by call transaction. So at the beginning I fill the screen of that called transaction using BDCDATA, and I want to block input for some fields of the screen.
I tried to put those fields I need to block the input in the same group and in the init module of the screen I have implemented- screen-input = 0. So when I do it the BDCDATA couldn't/ doesn't fill the fields.
When I perform those fields, by checking only output Data, in the screen painter-attributes, the BDC data couldn't work too.
What I need is that the displaying field work, like it work in a report when I initialize field by value and perform this code below,
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = '901'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
The ield values displayed, but I'm not able to edit/change it, it's displayed only, for output(for seeing)
Sory if it is not relevant.
My thank for you all who will be able to help.
08-21-2014 9:40 AM
Hi Elina,
I think I did not get your requirement completely.
But I can see that you want to enable and disable editing(input fields) based on your requirement. Right?
If yes, then try to use a condition flag which you have to set based on your requirement.
Example code.
LOOP AT SCREEN.
if lv_condtion_flag = 'X'.
IF screen-group1 = '901'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
else.
IF screen-group1 = '901'.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
endif.
ENDLOOP.
This above code enables and disables editing of input fields based on value
in lv_condition_flag(type boolean).
Please ask if your requirement differs from my understanding.
thanks,
vidyasagar
08-21-2014 11:11 AM
Hi,
Sorry but you cannot change attribute of a field using BDC.
What you can do is, in the PBO of the screen, write a logic that if the field value is not initial then input = 0.
Assign an function code to some key combination like ENTER key but do not add any code for it.
So, while recording BDC, press enter after filling in the fields, which will trigger the PAI and PBO of the screen thus the logic for disabling field when it has value will run and the field will get disabled.
08-21-2014 11:20 AM
Hi Elina,
you can check on field SY-CALLD for the condition to activate input on this field-group.
Regards,
Klaus
08-21-2014 11:25 AM
Hi,
Are those fields(to be kept disabled) fixed/static? Or do they change according to data.
If static, you can use "transaction variants" for your transaction and hide those fields through transaction variants. -Please search on net as to how to use txn variants.
Now say the original transaction is XYZ, you create ZXYZ with txn variants.
In BDC call, call txn ZXYZ(where the fields are statically disabled)
otherwise call XYZ as required.
-Sumit