on 12-08-2010 9:43 AM
Dear,
I want to display the year by using a floating field.
There are fields available in the template provided by SAP (HAP_PDF_OFFLINE_FORM).
I want to use the AP_START_DATE field but when I try this it gives no value.. Does anybody know how this value is passed through the form? I have a Badi to test my adobe form that I have designed but there is no date in a field somewhere. Is this necessary?
Thanks in advance.
Kr,
Tom
Maybe this is possible, maybe not. But for me it sounds hihly unproffesional.
Anyway: you cannot only assignt the value into the field I believe, you need to cut out the right part of the date and assign only a part into the field you want. Well... not sure it this could work (like pass the checks etc.), but your can try.
Otto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Otto,
I tested my form in transaction SFP with F8. I've put a breakpoint on the AP_START_DATE field and I saw the value was 00000000 so I changed it to 20100101 and it was displayed in the field.
How can I test in transaction PHAP_ADMIN if the value is passed? Because at this moment it doesn't show a date eventhough the field is displayed. There is a start date entered in the Badi so it should normally display the date that is in that field.
Thanks for your help.
Kr,
Tom
Hi Tom,
I am not sure u r requirement is format or data being passing to form but thought the below script might help you some how.
This is done in form ready event.
var valArray = this.rawValue.split("."); // Assuming you get data in mm.dd.yyyy from backend if its not . replace the split accordingly.
var actualVal = Date.parse(valArray[1]+"/"+valArray[0]+"/"+valArray[2]);
var monthWord=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dayWord = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var dateType=new Date(actualVal);
var day=dateType.getDate();
var month=dateType.getMonth();
var year=dateType.getFullYear();
var weekDay = dateType.getDay();
var dateFormat= dayWord[weekDay]+", "+day+" "+monthWord[month]+" "+year;
// This displays date 09/12/2010 as "Thursday, 9 December 2010" modify the above line w.r.t your requirement.
this.rawValue = dateFormat;
If its that you need current year just use the below
var dateType=new Date();
var year=dateType.getFullYear();
this.rawValue = year;
Cheers,
Sai
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.