on 12-02-2008 5:51 AM
Hi ,
I am using BAdi to populate the drop down for the field in the HCM forms
The field shows value when we click the drop down button .
Requirement : I want to have the default value in the form when it is displayed for the first time using BAdi .
Understanding : I know it can be done from the form side but that will not come dynamically .
Please give your input on this .
Thanks
-Om
Hey Om,
What I have done for passing default values from the backend to the form is binding the fieldname to the dropdown. The fieldname is the same as the name you use to populate the dropdown... So, the binding for the form field is:
$record.<FORM_FIELD>.DATA[*].FIELD
and the binding for the Item values is:
$record.sap-vhlist.<FORM_FIELD>\.DATA\.FIELD.item[*]
Hope this helps...
Cheers,
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin ,
This is working for me but what i need is little different from this .
I am able to get the default and the drop down value only if i don't declare the field as special field
but i have to use the value of this field in the BAdi to retrieve other values based on this then i need to make it as a special field .
If i declare the field as special field then i can am getting the drop down and at the same time value in the backend but no default value .
Set Default value only
DATA: lds_service_fields TYPE REF TO hrasr00gensrv_dataset_init.
READ TABLE service fields REFERENCE INTO lds_service_fields
WITH KEY fieldname = lv_tdate
CHECK sy-subrc = 0.
lds_service_fields->fieldvalue = '01012008 ' .
This code is getting executed in both the case whether i declare the lv_tdate as service field or special field
but if i declare lv_tdate as special field then no value bind to this will be displayed .
At the same time if i declare this as service field then the default value is populated and the drop down too but the value after getting selected from the drop down is not fetched .
Please let me know if u need any more details .
Thanks ,
- Om
Hey Om,
When you define a field as a Special Field, and populate it, you can change the value, but you can never clear the field. If you need to reference the field when you call other Operations (making an assumption here), add the field to the field group associated to the operation being called. This way, you don't have to make the field special.
Hope this helps...
Cheers,
Kevin
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.