on 11-25-2010 8:50 AM
Dear Experts,
how can I set a BDT-Field mandatory?
I made an BDT-Application including a field group and a view and hooked it into the first tab of contract. Now, I want to have a certain field dynamically switched to mandatory if a specific condition is true.
I tried to set OUT_STATUS of my ZZGC_REGC_EVENT_FMOD2 function to u2018u2019 (required) but this puts to set the field group in edit mode even if the whole tab is in view mode. I can hide my subscreen though by using u2018-u2018 instead of u2018u2019 but is there a way to set a single field to mandatory?
Thanks for your help,
Jan Dahl
Hi ,
Even i have tried to do similar thing and found out that, if we want to control filed status of a single field, we need to create separate field group only for that field, then we can control the status of the filed alone.
You are mentioning that based on some condition you want to make that field mandatory, then only option left with is to write that condition in BADI of the contract "Check All" method, which checks the condition and shows error message saying the field is mandatory. If you are using this BADI (BADI_RE_CN_CN), then you don't need to define only this field in a field group as using BADI we are controlling the field behavior.
Thanks,
Bala.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bala,
you have been able to set a field to mandatory by setting the whole field group mandatory? That would be sufficient for my case. How did you do that? I wasnu2019t even able to set fields statically to mandatory. Iu2019m still a newbie to RE-FX and BDT, maybe I donu2019t see the simple things.
Thanks
Jan
Finaly I solved it. And it works like it is designd I was just confused the field was editable even in view mode. Now I don't touch the status when in view mode and change it only to 'required' when in edit mode.
To feedback the comunity, here is the code:
function z_gc_regc_event_zzgc20 .
* Wenn Vertrag Anwenderstatus OFFE dann Offe_datum = Pflicht
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(FLDGR) LIKE TBZ3W-FLDGR
*" VALUE(IN_STATUS) LIKE BUS000FLDS-FLDSTAT
*" EXPORTING
*" VALUE(OUT_STATUS) LIKE BUS000FLDS-FLDSTAT
*"----------------------------------------------------------------------
*---------------------------------------------------------------------
* Set OUT_STATUS to
* optional: '.'
* required: '+'
* display: '*'
* suppressed: '-'
*
* IN_STATUS = SPACE means not specified
*
* FLDGR is the fieldgroup in BDT-Customizing
*---------------------------------------------------------------------
if in_status = '*'.
* Edit mode
out_status = in_status.
else.
.... put your query here, for the field must be mandatory
if YourQuery is true.
out_status = '+'.
else.
* set default
out_status = in_status.
endif.
endif.
endfunction.
User | Count |
---|---|
16 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.