on 01-18-2013 10:43 AM
Hello,
My requirement is add a new field on the create expense application screen in ESS
This is requried so that user keys in a particular reference travel request number. (advance approval functionality)
This value should be stored against the trip number , possibly in PTREQ_HEADER table (willput zfield in append structure)
Also there is whole set of validations to be applied to this field which should happen on Save button on last screen as the validations have to be done against the receipt data entered.
I am refering the thread http://scn.sap.com/message/13660041 and other linked threads to this.
I have been able to make the new field appear on the screen, but the saving and validation needs to be implemented
Please could you give me hints how to approach.
thanks
bhakti
Hello Lukas,
Thanks a ton for sharing the very much valuable details. thanks for your time and efforts.
I will need time to implement this, ill let you know
I appreciate your help
kind regards,
bhakti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello Lukas,
Our requirement has been met by tweaking the design from functional perspective rather than technical.
we have finally applied below design fyi.
requirement : expense workflow is already in place but for one of the countries , a pre-approval of expense amount is required, against which the actual expense would be checked for necesarry re-approval.
initial design : a new expense type for preapproval, user creates preapproval expense using this expense type before the trip. Create new field on the create expense screen, user enters the preapproved expense number in the actual post-trip expense.
current design : while we were realising that adding new field was not quite fitting into our timelines, the functional consultant found that another form travel request gets converted into expense post-approval. so there was no need to use two different documents for pre and post-trip expenses and then link them explicitly. we could continue with the same document. we have built it with required workflow changes and have not faced any hurdle so far.
my proposal of adding custom field, almost failed, so its a lesson learnt for me. As I have worked majorly in SRM UI, I thought adding new field on the screen should not be considered impossible.
I will certainly apply your details on test purpose in our system. it is to know the fundamentals of the UI design in latest ESS MSS webdynpro abap based designs.
thank you ,
bhakti
Hi Bhakti,
For the validation there is a BADI TRIP_WEB_CHECK available. Please check the methods
USER_CHECK_RECEIPTS and USER_CHECK_LINE_OF_RECEIPTS for your needs. I have implemented checks there.
There is lots of data available there to validate against but you will probably have to retrieve data for your new field yourself unless included in existing structure. You can also do simple field validation by implementing post exist in your view that has the field but I guess you are aware of how to do that?
Regarding saving your new field I would suggest you have a look at the save methods in the assistance class as shown below to see how you best get it included in save.
Br Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jan,
thanks a lot for your answer.
I will check the methods you have given to store the new field.
regarding validation : I will explore the BADI now immediately.
I can manage to implement post exit but cannot use post exit in the first view because I need to check what expense types the user has entered in the next screen (Wdcomp FITE_VC_RECEIPTS) in order to determine the validity of the new field contents....... and then issue the error message.
so ill see if I can use post exit in the view of the receipts screen but I need to have all the data requried to validate it, apart from expense types I need several other things like start date, cost assignment, etc.
So all this data along with the content of the new field should be available either in the BADI TRIP_WEB_CHECK or the post exit of the second step.
thank you,
bhakti
hello Jan,
I am still trying to save the contents of my custom field
I have bound it to a new attribute i created in context
but I am not able to get the value
I saw a method INIT_FROM_URL_PARAMETERS in the assistance class which seems to be the origin of the attribute GS_GENERAL_DATA which is actualy getting passed on as the general data context values. but this method doesnt stop at debug and why would they get the values from URL instead of context ?
thanks
bhakti
I agree - the values should be retrieved from context in a normal scenario.
Have you checked and debugged the assistance method GET_GENERAL_DATA?
I would guess that is the one that retrieves the data and maybe needs to be enhanced to retrieve your new field as well.
Regarding saving your new value - can you show where and how you have added it in the context if you still have problem saving it?
hi Jan,
thank you for your much requried reply
yes the method GET_GEENRAL_DATA is the one that gets general data that is used further on, but instead of reading the context it is getting from the assistance class attribute gs_general_data
to see how this attribute is getting populated (where the context is being read) I am trying but I think there are function modules like PTRA_WEB_GENERAL_DATA_GET
because I was asked to update a structure PTP02 used in one of stadard programs when I appended the structure PTRV_HEAD
your inputs are highly useful and realy required at this point.
thank you
bhakti
Hello Jan,
I 'll try if i can get inputs from Lukas Weigelt.
not having found way to get the custom field contents from the screen in feasible timeline, is it ok to take up below appraoch
- bind the custom input field to independently new context node
- find a point in view controller of receipts screen where all required data (receipts, amounts, cost objects, general data etc) are available, read the new z-context ourselves and validate against the trip data and issue required message
- store this z-input field against the trip document in separate z-table and not in PTREQ_HEAD , as it doesnt seem feasible. but this will need to be done after the new trip number has got generated.
thanks
bhakti
Hi Bhakti,
I've only been able to give you guidelines as I have not implemented a new field in this specific application my self and at the minute I don't have time to dig into the code to guide you the rest of the way - sorry
If I get some time I will have a look. If not I hope you can find a way around to get it implemented possibly the way you mention above - I think it is fine to keep it in Z (if you can get it to work) as you then make sure it doesn't interfere with rest of application but I can't say for sure this is the correct approach by the book.
Br Jan
Hi Bhakti, Hi Jan,
I have indeed added about 70 custom fields from scratch and implemented them into the entire standard process (and it even solidly works out the way I intended it, good gracious! ). Here's the approach I used:
SAP provides the Standard Structure "PTK99" which has been implemented in many (not all, but it's getting better the more rant-OSS-messages I raise) portions of the entire FI-TV process. Here's where it is (by now) applied and in my opinion genuinely working:
There are other portions where PTK99 is also 'propagated' but doesn't really work like TP01 and other old Dynpro-Technology stuff like that. Just to clear out misunderstandings, this is SAP standard, I didn't invent this myself so you do have a huge advantage up to this point. So what I did first was make a DDIC-enhancement to PTK99 and add all the fields I required (approach suggested by SAP in IMG documentation).
Here's the big downer to it though: PTK99 is not applied in the WDA scenarios in standard and the subsequent business logic, this is what I built myself, here's a short overview:
Here's a little screen I made with my overly elite ms-paint skills for a better understanding
I already had the plan to share this experience within a blog but I never blogged before and didn't have the time to put effort into it, maybe in the future I'll do so 😜
best regards + Cheers
Lukas
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.